Skip to content

Commit

Permalink
efi: disable mirror feature during crashkernel
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Ma Wupeng <[email protected]>
Acked-by: Mike Rapoport (IBM) <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Ma Wupeng authored and akpm00 committed Jan 12, 2024
1 parent 7bb9438 commit 7ea6ec4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mm/mm_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7ea6ec4

Please sign in to comment.