Skip to content

Commit 7ea6ec4

Browse files
Ma Wupengakpm00
authored andcommitted
efi: disable mirror feature during crashkernel
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>
1 parent 7bb9438 commit 7ea6ec4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

mm/mm_init.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/pgtable.h>
2727
#include <linux/swap.h>
2828
#include <linux/cma.h>
29+
#include <linux/crash_dump.h>
2930
#include "internal.h"
3031
#include "slab.h"
3132
#include "shuffle.h"
@@ -381,6 +382,11 @@ static void __init find_zone_movable_pfns_for_nodes(void)
381382
goto out;
382383
}
383384

385+
if (is_kdump_kernel()) {
386+
pr_warn("The system is under kdump, ignore kernelcore=mirror.\n");
387+
goto out;
388+
}
389+
384390
for_each_mem_region(r) {
385391
if (memblock_is_mirror(r))
386392
continue;

0 commit comments

Comments
 (0)