summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMa Wupeng <mawupeng1@huawei.com>2024-01-09 07:15:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-01 03:18:56 +0300
commit6c4c57669de41b382149e7273edd73ec1a1e222b (patch)
tree5932557ca250ad8b09ed29ca7781198fe0fc98ae /mm
parentce51369287dde2f9da43a883ff64387956acfbb0 (diff)
downloadlinux-6c4c57669de41b382149e7273edd73ec1a1e222b.tar.xz
efi: disable mirror feature during crashkernel
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/mm_init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 50f2f34745af..77fd04c83d04 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;