summaryrefslogtreecommitdiffstats
path: root/kernel/kexec_file.c
diff options
context:
space:
mode:
authorMike Rapoport <rppt@linux.ibm.com>2019-05-13 20:22:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-14 12:47:50 -0400
commit350e88bad4964da6feabee02a1a70381bcdb087e (patch)
tree7bfbd4c2a090c7885899ea4a8858b7b7100824a6 /kernel/kexec_file.c
parentf27a5136f70a8c90e8b30a983b6f54540742f849 (diff)
mm: memblock: make keeping memblock memory opt-in rather than opt-out
Most architectures do not need the memblock memory after the page allocator is initialized, but only few enable ARCH_DISCARD_MEMBLOCK in the arch Kconfig. Replacing ARCH_DISCARD_MEMBLOCK with ARCH_KEEP_MEMBLOCK and inverting the logic makes it clear which architectures actually use memblock after system initialization and skips the necessity to add ARCH_DISCARD_MEMBLOCK to the architectures that are still missing that option. Link: http://lkml.kernel.org/r/1556102150-32517-1-git-send-email-rppt@linux.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Cc: Russell King <linux@armlinux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: James Hogan <jhogan@kernel.org> Cc: Ley Foon Tan <lftan@altera.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Rich Felker <dalias@libc.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Eric Biederman <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kexec_file.c')
-rw-r--r--kernel/kexec_file.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index f7fb8f6a688f..072b6ee55e3f 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -500,13 +500,7 @@ static int locate_mem_hole_callback(struct resource *res, void *arg)
500 return locate_mem_hole_bottom_up(start, end, kbuf); 500 return locate_mem_hole_bottom_up(start, end, kbuf);
501} 501}
502 502
503#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK 503#ifdef CONFIG_ARCH_KEEP_MEMBLOCK
504static int kexec_walk_memblock(struct kexec_buf *kbuf,
505 int (*func)(struct resource *, void *))
506{
507 return 0;
508}
509#else
510static int kexec_walk_memblock(struct kexec_buf *kbuf, 504static int kexec_walk_memblock(struct kexec_buf *kbuf,
511 int (*func)(struct resource *, void *)) 505 int (*func)(struct resource *, void *))
512{ 506{
@@ -550,6 +544,12 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf,
550 544
551 return ret; 545 return ret;
552} 546}
547#else
548static int kexec_walk_memblock(struct kexec_buf *kbuf,
549 int (*func)(struct resource *, void *))
550{
551 return 0;
552}
553#endif 553#endif
554 554
555/** 555/**
@@ -589,7 +589,7 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf)
589 if (kbuf->mem != KEXEC_BUF_MEM_UNKNOWN) 589 if (kbuf->mem != KEXEC_BUF_MEM_UNKNOWN)
590 return 0; 590 return 0;
591 591
592 if (IS_ENABLED(CONFIG_ARCH_DISCARD_MEMBLOCK)) 592 if (!IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK))
593 ret = kexec_walk_resources(kbuf, locate_mem_hole_callback); 593 ret = kexec_walk_resources(kbuf, locate_mem_hole_callback);
594 else 594 else
595 ret = kexec_walk_memblock(kbuf, locate_mem_hole_callback); 595 ret = kexec_walk_memblock(kbuf, locate_mem_hole_callback);