lkml.org 
[lkml]   [2023]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/mm_init: Ignore kernelcore=mirror boot option when no mirror memory presents.
Date
In the machine where no mirror memory is set,
All memory region in ZONE_NORMAL is used as ZONE_MOVABLE
when kernelcore=mirror boot option is used.
So, ZONE_NORMAL couldn't be populated properly
because all of ZONE_NORMAL pages is absent.

To avoid this abnormal situation,
ignore disable kernelcore=mirror option when no mirror memory is found.

Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
---
mm/mm_init.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/mm/mm_init.c b/mm/mm_init.c
index a1963c3322af..4c180ef1a993 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -376,10 +376,13 @@ static void __init find_zone_movable_pfns_for_nodes(void)
*/
if (mirrored_kernelcore) {
bool mem_below_4gb_not_mirrored = false;
+ bool no_mirror_mem = true;

for_each_mem_region(r) {
- if (memblock_is_mirror(r))
+ if (memblock_is_mirror(r)) {
+ no_mirror_mem = false;
continue;
+ }

nid = memblock_get_region_node(r);

@@ -398,6 +401,12 @@ static void __init find_zone_movable_pfns_for_nodes(void)
if (mem_below_4gb_not_mirrored)
pr_warn("This configuration results in unmirrored kernel memory.\n");

+ if (no_mirror_mem) {
+ pr_warn("There is no mirrored memory. Ignore kernelcore=mirror.\n");
+ mirrored_kernelcore = false;
+ memset(zone_movable_pfn, 0x00, sizeof(zone_movable_pfn));
+ }
+
goto out2;
}

--
2.37.2
\
 
 \ /
  Last update: 2023-08-02 20:37    [W:0.023 / U:1.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site