linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wupeng Ma <mawupeng1@huawei.com>
To: <akpm@linux-foundation.org>, <rppt@kernel.org>, <ardb@kernel.org>
Cc: <mawupeng1@huawei.com>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH] mm: ignore nomap memory during mirror init
Date: Thu, 17 Jul 2025 16:57:23 +0800	[thread overview]
Message-ID: <20250717085723.1875462-1-mawupeng1@huawei.com> (raw)

When memory mirroring is enabled, the BIOS may reserve memory regions
at the start of the physical address space without the MR flag. This will
lead to zone_movable_pfn to be updated to the start of these reserved
regions, resulting in subsequent mirrored memory being ignored.

Here is the log with efi=debug enabled:
  efi:   0x084004000000-0x0842bf37ffff [Conventional|   |  |MR|...|WB|WT|WC|  ]
  efi:   0x0842bf380000-0x0842c21effff [Loader Code |   |  |MR|...|WB|WT|WC|  ]
  efi:   0x0842c21f0000-0x0847ffffffff [Conventional|   |  |MR|...|WB|WT|WC|  ]
  efi:   0x085000000000-0x085fffffffff [Conventional|   |  |  |...|WB|WT|WC|  ]
...
  efi:   0x084000000000-0x084003ffffff [Reserved    |   |  |  |...|WB|WT|WC|  ]

Since this kind of memory can not be used by kernel. ignore nomap memory to fix
this issue.

Signed-off-by: Wupeng Ma <mawupeng1@huawei.com>
---
 mm/mm_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mm_init.c b/mm/mm_init.c
index f2944748f526..1c36518f0fe4 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -405,7 +405,7 @@ static void __init find_zone_movable_pfns_for_nodes(void)
 		}
 
 		for_each_mem_region(r) {
-			if (memblock_is_mirror(r))
+			if (memblock_is_mirror(r) || memblock_is_nomap(r))
 				continue;
 
 			nid = memblock_get_region_node(r);
-- 
2.43.0



             reply	other threads:[~2025-07-17  8:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17  8:57 Wupeng Ma [this message]
2025-07-17 10:29 ` [PATCH] mm: ignore nomap memory during mirror init Mike Rapoport
2025-07-17 11:06   ` mawupeng
2025-07-17 13:37     ` Mike Rapoport
2025-07-18  1:37       ` mawupeng
2025-07-20 12:38         ` Mike Rapoport
2025-07-21  2:11           ` mawupeng
2025-07-22  8:23             ` Mike Rapoport
2025-07-23  2:02               ` mawupeng
2025-07-21  5:08           ` Ard Biesheuvel
2025-07-22  8:17             ` Mike Rapoport
2025-08-05  8:47               ` mawupeng
2025-08-06 10:58                 ` Mike Rapoport
2025-08-10  5:14                   ` Ard Biesheuvel
2025-08-10  8:14                     ` Mike Rapoport
2025-08-29 16:47                       ` Ard Biesheuvel
2025-08-31  9:16                         ` Mike Rapoport

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=20250717085723.1875462-1-mawupeng1@huawei.com \
    --to=mawupeng1@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).