Commit 0277fdb2 authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

efi: Disable mirror feature during crashkernel

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8USBA


CVE: NA

--------------------------------

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: default avatarMa Wupeng <mawupeng1@huawei.com>
parent a176dc6b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;