]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
efi: disable mirror feature during crashkernel
authorMa Wupeng <mawupeng1@huawei.com>
Tue, 9 Jan 2024 04:15:36 +0000 (12:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:21:02 +0000 (16:21 -0800)
commit 7ea6ec4c25294e8bc8788148ef854df92ee8dc5e upstream.

If the system has no mirrored memory or uses crashkernel.high while
kernelcore=mirror is enabled on the command line then during crashkernel,
there will be limited mirrored memory and this usually leads to OOM.

To solve this problem, disable the mirror feature during crashkernel.

Link: https://lkml.kernel.org/r/20240109041536.3903042-1-mawupeng1@huawei.com
Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/mm_init.c

index 077bfe393b5e29e73e98d4071385f7cc3c5c4cc6..513bad672708979723f630cac2d5c4d4e470e17f 100644 (file)
@@ -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;