mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Meyer <kyle.meyer@hpe.com>
To: akpm@linux-foundation.org, rppt@kernel.org, david@redhat.com,
	dan.j.williams@intel.com, Jonathan.Cameron@huawei.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Kyle Meyer <kyle.meyer@hpe.com>
Subject: [PATCH] mm: numa_memblks: Don't skip reserved areas before DRAM
Date: Tue, 22 Oct 2024 13:41:42 -0500	[thread overview]
Message-ID: <20241022184142.5691-1-kyle.meyer@hpe.com> (raw)

memblock_start_of_DRAM() returns the base address of the 1st usable
memory region. Reserved memory regions can start before that address.

Instead of skipping the truncated portions of NUMA memory blocks that
start before DRAM, add them to 'numa_reserved_meminfo'. Without this
patch, reserved areas present in the SRAT before the start of DRAM are
not assigned a node ID.

Fixes: f7feea289f9a ("mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo")
Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
---
 mm/numa_memblks.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
index be52b93a9c58..384397d39d6d 100644
--- a/mm/numa_memblks.c
+++ b/mm/numa_memblks.c
@@ -227,10 +227,14 @@ int __init numa_cleanup_meminfo(struct numa_meminfo *mi)
 			continue;
 		}
 
-		/* make sure all non-reserved blocks are inside the limits */
-		bi->start = max(bi->start, low);
+		/* preserve info for reserved areas before DRAM */
+		if (bi->start < low) {
+			numa_add_memblk_to(bi->nid, bi->start, low,
+					   &numa_reserved_meminfo);
+			bi->start = low;
+		}
 
-		/* preserve info for non-RAM areas above 'max_pfn': */
+		/* preserve info for reserved areas after DRAM */
 		if (bi->end > high) {
 			numa_add_memblk_to(bi->nid, high, bi->end,
 					   &numa_reserved_meminfo);
-- 
2.35.3


                 reply	other threads:[~2024-10-22 18:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241022184142.5691-1-kyle.meyer@hpe.com \
    --to=kyle.meyer@hpe.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®