Re: [PATCH v10 1/3] mm: Add node_to_range lookup facility to numa_memblks
From: Borislav Petkov <bp@alien8.de>
Date: 2025-08-11 15:29:01
Also in:
linux-acpi, linux-edac, linux-mm
From: Borislav Petkov <bp@alien8.de>
Date: 2025-08-11 15:29:01
Also in:
linux-acpi, linux-edac, linux-mm
On Fri, Aug 01, 2025 at 06:20:27PM +0100, shiju.jose@huawei.com wrote:
From: Shiju Jose <redacted> Lookup facility to retrieve memory phys lowest continuous range for
A commit message is not code. Please write it for humans.
a NUMA node is required in the numa_memblks for the ACPI RAS2 memory scrub use case. Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Shiju Jose <redacted> --- include/linux/numa.h | 10 ++++++++++ include/linux/numa_memblks.h | 2 ++ mm/numa.c | 10 ++++++++++ mm/numa_memblks.c | 23 +++++++++++++++++++++++ 4 files changed, 45 insertions(+)
...
+static int nid_to_meminfo(struct numa_meminfo *mi, int nid, u64 *start, u64 *end)
This function name sounds like it converts a node ID to meminfo. But it doesn't do that.
+{
+ int i;
+
+ if (!numa_valid_node(nid))
+ return -EINVAL;
+
+ for (i = 0; i < mi->nr_blks; i++) {
+ if (mi->blk[i].nid == nid) {
+ *start = mi->blk[i].start;
+ *end = mi->blk[i].end;It looks like it returns the start and end range of a node ID.
+ return 0;
+ }
+ }
+
+ return -ENODEV;
+}
+
+int node_to_phys_lowest_continuous_range(int nid, u64 *start, u64 *end)
+{
+ return nid_to_meminfo(&numa_meminfo, nid, start, end);
Where is the "lowest" thing here?
And where is the "continuous" thing?
This thing simply hides the struct numa_meminfo from the exported interface.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette