[alternative-merged] mm-mm_init-ignore-kernelcore=mirror-boot-option-when-no-mirror-memory-presents.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: mm/mm_init: ignore kernelcore=mirror boot option when no mirror memory present
has been removed from the -mm tree.  Its filename was
     mm-mm_init-ignore-kernelcore=mirror-boot-option-when-no-mirror-memory-presents.patch

This patch was dropped because an alternative patch was or shall be merged

------------------------------------------------------
From: Levi Yun <ppbuk5246@xxxxxxxxx>
Subject: mm/mm_init: ignore kernelcore=mirror boot option when no mirror memory present
Date: Wed, 2 Aug 2023 19:36:14 +0100

In a 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.

[akpm@xxxxxxxxxxxxxxxxxxxx: fix printk grammar]
Link: https://lkml.kernel.org/r/20230802183614.15520-1-ppbuk5246@xxxxxxxxx
Signed-off-by: Levi Yun <ppbuk5246@xxxxxxxxx>
Cc: Mike Rapoport (IBM) <rppt@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/mm_init.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

--- a/mm/mm_init.c~mm-mm_init-ignore-kernelcore=mirror-boot-option-when-no-mirror-memory-presents
+++ a/mm/mm_init.c
@@ -376,10 +376,13 @@ static void __init find_zone_movable_pfn
 	 */
 	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_pfn
 		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. Ignoring kernelcore=mirror.\n");
+			mirrored_kernelcore = false;
+			memset(zone_movable_pfn, 0x00, sizeof(zone_movable_pfn));
+		}
+
 		goto out2;
 	}
 
_

Patches currently in -mm which might be from ppbuk5246@xxxxxxxxx are

damon-use-pmdp_get-instead-of-drectly-dereferencing-pmd.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux