linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] efi: Disable mirror feature during crashkernel
@ 2024-01-09  4:15 Wupeng Ma
  2024-01-09  6:05 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Wupeng Ma @ 2024-01-09  4:15 UTC (permalink / raw)
  To: akpm, rppt; +Cc: linux-mm, mawupeng1, linux-kernel

From: Ma Wupeng <mawupeng1@huawei.com>

If system have no mirrored memory or use crashkernel.high while
kernelcore=mirror is enabled in cmdline, during crashkernel,
there will be limited mirrored memory and this usually lead to
OOM.

To solve this problem, disable mirror feature during crashkernel.

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

diff --git a/mm/mm_init.c b/mm/mm_init.c
index 077bfe393b5e..513bad672708 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -26,6 +26,7 @@
 #include <linux/pgtable.h>
 #include <linux/swap.h>
 #include <linux/cma.h>
+#include <linux/crash_dump.h>
 #include "internal.h"
 #include "slab.h"
 #include "shuffle.h"
@@ -381,6 +382,11 @@ static void __init find_zone_movable_pfns_for_nodes(void)
 			goto out;
 		}
 
+		if (is_kdump_kernel()) {
+			pr_warn("The system is under kdump, ignore kernelcore=mirror.\n");
+			goto out;
+		}
+
 		for_each_mem_region(r) {
 			if (memblock_is_mirror(r))
 				continue;
-- 
2.25.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-09  6:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09  4:15 [PATCH] efi: Disable mirror feature during crashkernel Wupeng Ma
2024-01-09  6:05 ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox