mm: remove CONFIG_HAVE_MEMBLOCK
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Tue, 30 Oct 2018 22:07:44 +0000 (15:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 31 Oct 2018 15:54:15 +0000 (08:54 -0700)
All architecures use memblock for early memory management. There is no need
for the CONFIG_HAVE_MEMBLOCK configuration option.

[rppt@linux.vnet.ibm.com: of/fdt: fixup #ifdefs]
Link: http://lkml.kernel.org/r/20180919103457.GA20545@rapoport-lnx
[rppt@linux.vnet.ibm.com: csky: fixups after bootmem removal]
Link: http://lkml.kernel.org/r/20180926112744.GC4628@rapoport-lnx
[rppt@linux.vnet.ibm.com: remove stale #else and the code it protects]
Link: http://lkml.kernel.org/r/1538067825-24835-1-git-send-email-rppt@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/1536927045-23536-4-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Tested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Serge Semin <fancer.lancer@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
40 files changed:
arch/alpha/Kconfig
arch/arc/Kconfig
arch/arm/Kconfig
arch/arm64/Kconfig
arch/c6x/Kconfig
arch/csky/Kconfig
arch/csky/kernel/setup.c
arch/csky/mm/highmem.c
arch/csky/mm/init.c
arch/h8300/Kconfig
arch/hexagon/Kconfig
arch/ia64/Kconfig
arch/m68k/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/nds32/Kconfig
arch/nios2/Kconfig
arch/openrisc/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/riscv/Kconfig
arch/s390/Kconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/um/Kconfig
arch/unicore32/Kconfig
arch/x86/Kconfig
arch/xtensa/Kconfig
drivers/of/fdt.c
drivers/of/of_reserved_mem.c
drivers/staging/android/ion/Kconfig
fs/pstore/Kconfig
include/linux/bootmem.h
include/linux/memblock.h
include/linux/mm.h
lib/Kconfig.debug
mm/Kconfig
mm/Makefile
mm/nobootmem.c
mm/page_alloc.c

index 04de6be101bc21f30191beafd126f629626187d0..5b4f8836345381017ff54770f44180115a81c7e4 100644 (file)
@@ -31,7 +31,6 @@ config ALPHA
        select ODD_RT_SIGACTION
        select OLD_SIGSUSPEND
        select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
-       select HAVE_MEMBLOCK
        help
          The Alpha is a 64-bit general-purpose processor designed and
          marketed by the Digital Equipment Corporation of blessed memory,
index 56995f356f6968e77972a58f7a045ec93184cfb2..c9e2a1323536313c8ee0e10906db67902c846674 100644 (file)
@@ -37,7 +37,6 @@ config ARC
        select HAVE_KERNEL_LZMA
        select HAVE_KPROBES
        select HAVE_KRETPROBES
-       select HAVE_MEMBLOCK
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_OPROFILE
        select HAVE_PERF_EVENTS
index 37d4c40f405a6325ad3d36654a2e64a8a9da0e83..91be74d8df658ccd5a4701fe7438053115dceeb9 100644 (file)
@@ -82,7 +82,6 @@ config ARM
        select HAVE_KERNEL_XZ
        select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M
        select HAVE_KRETPROBES if (HAVE_KPROBES)
-       select HAVE_MEMBLOCK
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_NMI
        select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
index a8f36c7041ff1582c0e3adc47344664aa3e15d38..787d7850e0643d80197e29bcfbfedf6d40ab46eb 100644 (file)
@@ -139,7 +139,6 @@ config ARM64
        select HAVE_GENERIC_DMA_COHERENT
        select HAVE_HW_BREAKPOINT if PERF_EVENTS
        select HAVE_IRQ_TIME_ACCOUNTING
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP if NUMA
        select HAVE_NMI
        select HAVE_PATA_PLATFORM
index f65a084607fd4ae509db40df3385895f0c6c7a21..84420109113d50ac3cc2f3a46b9f7938ffdf6bf2 100644 (file)
@@ -13,7 +13,6 @@ config C6X
        select GENERIC_ATOMIC64
        select GENERIC_IRQ_SHOW
        select HAVE_ARCH_TRACEHOOK
-       select HAVE_MEMBLOCK
        select SPARSE_IRQ
        select IRQ_DOMAIN
        select OF
index 46966f5762498cb61930bbf3e279dbd2f1a63cc8..cb64f8dacd08ee6fa56f622ddb89299f1305f607 100644 (file)
@@ -36,7 +36,6 @@ config CSKY
        select HAVE_C_RECORDMCOUNT
        select HAVE_DMA_API_DEBUG
        select HAVE_DMA_CONTIGUOUS
-       select HAVE_MEMBLOCK
        select MAY_HAVE_SPARSE_IRQ
        select MODULES_USE_ELF_RELA if MODULES
        select OF
index a5e3ab1d536032c72f052487bb98f14d08ca26f6..dff8b89444ec5571a6eeb82d36ac2f7f0329b8d7 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <linux/console.h>
 #include <linux/memblock.h>
-#include <linux/bootmem.h>
 #include <linux/initrd.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
index e168ac087ccb2a4c6dafb9b10fe6352a38e567dc..53b1bfa4c462e798aa3753d4d4d838639d4f6cf4 100644 (file)
@@ -4,7 +4,7 @@
 #include <linux/module.h>
 #include <linux/highmem.h>
 #include <linux/smp.h>
-#include <linux/bootmem.h>
+#include <linux/memblock.h>
 #include <asm/fixmap.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
@@ -140,7 +140,7 @@ static void __init fixrange_init(unsigned long start, unsigned long end,
                        pmd = (pmd_t *)pud;
                        for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
                                if (pmd_none(*pmd)) {
-                                       pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
+                                       pte = (pte_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
                                        set_pmd(pmd, __pmd(__pa(pte)));
                                        BUG_ON(pte != pte_offset_kernel(pmd, 0));
                                }
index ce2711e050ad8759b916ffa9f51b1dd704242d04..dc07c078f9b8e92ee704bf1ef3664fb1ce9fae6c 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/ptrace.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
-#include <linux/bootmem.h>
 #include <linux/highmem.h>
 #include <linux/memblock.h>
 #include <linux/swap.h>
@@ -47,7 +46,7 @@ void __init mem_init(void)
 #endif
        high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
 
-       free_all_bootmem();
+       memblock_free_all();
 
 #ifdef CONFIG_HIGHMEM
        for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) {
index 5e89d40be8cd9764bb3c8e80dc7cbcfa3f2ce959..d19c6b16cd5d08a914c862465472620bc693a56e 100644 (file)
@@ -15,7 +15,6 @@ config H8300
        select OF
        select OF_IRQ
        select OF_EARLY_FLATTREE
-       select HAVE_MEMBLOCK
        select TIMER_OF
        select H8300_TMR8
        select HAVE_KERNEL_GZIP
index 7823f15e17b2954445bce8b533d4839b405c5c5d..2b688af379e6d8dbed0bdd94ba67332cdef541ac 100644 (file)
@@ -21,7 +21,6 @@ config HEXAGON
        select GENERIC_IRQ_SHOW
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_TRACEHOOK
-       select HAVE_MEMBLOCK
        select ARCH_DISCARD_MEMBLOCK
        select NEED_SG_DMA_LENGTH
        select NO_IOPORT_MAP
index 2bf4ef792f2cea3442b115e9e7db10b3be89794f..36773def6920b4104a0c190b306e2aaf8019bd36 100644 (file)
@@ -26,7 +26,6 @@ config IA64
        select HAVE_FUNCTION_TRACER
        select TTY
        select HAVE_ARCH_TRACEHOOK
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_VIRT_CPU_ACCOUNTING
        select ARCH_HAS_DMA_MARK_CLEAN
index 26edf2542295bc8468a38321a2e0f6ff2423bcd0..1bc9f1ba759a7bb3ab66c1f53ef531642048070b 100644 (file)
@@ -27,7 +27,6 @@ config M68K
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
        select DMA_DIRECT_OPS if HAS_DMA
-       select HAVE_MEMBLOCK
        select ARCH_DISCARD_MEMBLOCK
 
 config CPU_BIG_ENDIAN
index 5c2777bb55555997a44806ad20c12300759a0858..effed2efd306c33804a769738e01f3614f0564b7 100644 (file)
@@ -28,7 +28,6 @@ config MICROBLAZE
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_OPROFILE
        select IRQ_DOMAIN
index 36693415763216a26b093dbb131c984ba7f097f8..8272ea4c72645777b0174907f621d57040857599 100644 (file)
@@ -60,7 +60,6 @@ config MIPS
        select HAVE_IRQ_TIME_ACCOUNTING
        select HAVE_KPROBES
        select HAVE_KRETPROBES
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_NMI
index 93c0b587ee23ab46f0fdc80349cd9ce27dec68e9..7a04adacb2f0bd3a46e1bb7745f5b700b27a496e 100644 (file)
@@ -29,7 +29,6 @@ config NDS32
        select HANDLE_DOMAIN_IRQ
        select HAVE_ARCH_TRACEHOOK
        select HAVE_DEBUG_KMEMLEAK
-       select HAVE_MEMBLOCK
        select HAVE_REGS_AND_STACK_ACCESS_API
        select IRQ_DOMAIN
        select LOCKDEP_SUPPORT
index b01febeb5ce3ffe932cbf136133aab9c3db53535..7e95506e957aae25123ca9349eb35ad8e8dac791 100644 (file)
@@ -23,7 +23,6 @@ config NIOS2
        select SPARSE_IRQ
        select USB_ARCH_HAS_HCD if USB_SUPPORT
        select CPU_NO_EFFICIENT_FFS
-       select HAVE_MEMBLOCK
        select ARCH_DISCARD_MEMBLOCK
 
 config GENERIC_CSUM
index cbfaf15f9d70fe7748a259352af1b57f9304b095..285f7d05c8ed2d9a1a6b230b7d14009274dbb1ae 100644 (file)
@@ -12,7 +12,6 @@ config OPENRISC
        select OF_EARLY_FLATTREE
        select IRQ_DOMAIN
        select HANDLE_DOMAIN_IRQ
-       select HAVE_MEMBLOCK
        select GPIOLIB
         select HAVE_ARCH_TRACEHOOK
        select SPARSE_IRQ
index 7418ebeeb4a4d104745f380b30f3ac8d272f9a96..92a339ee28b385e918613a794aa21566d6dabe90 100644 (file)
@@ -15,7 +15,6 @@ config PARISC
        select RTC_CLASS
        select RTC_DRV_GENERIC
        select INIT_ALL_POSSIBLE
-       select HAVE_MEMBLOCK
        select BUG
        select BUILDTIME_EXTABLE_SORT
        select HAVE_PERF_EVENTS
index 5798ffb1379b56d142f6e6d3f4cd90897615c50a..2d51b2bd4aa132992f2f28be908b0571a79ae4d3 100644 (file)
@@ -206,7 +206,6 @@ config PPC
        select HAVE_KRETPROBES
        select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
        select HAVE_LIVEPATCH                   if HAVE_DYNAMIC_FTRACE_WITH_REGS
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_NMI                         if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
index f7c6b7cf124a13f66d1f792ab547d1dbf9a344fc..d86842c217103fff945d34a11a14b0f0513eaf90 100644 (file)
@@ -28,7 +28,6 @@ config RISCV
        select GENERIC_STRNLEN_USER
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_ATOMIC64 if !64BIT || !RISCV_ISA_A
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_DMA_CONTIGUOUS
        select HAVE_FUTEX_CMPXCHG if FUTEX
index c7af83a15b2d4d99b5a2be2d80424c16e8999dfa..5173366af8f359b98d9683afd6a9e105c7a7a910 100644 (file)
@@ -163,7 +163,6 @@ config S390
        select HAVE_LIVEPATCH
        select HAVE_PERF_REGS
        select HAVE_PERF_USER_STACK_DUMP
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_MEMBLOCK_PHYS_MAP
        select HAVE_MOD_ARCH_SPECIFIC
index 7aaea9690e18c641549cc4a37537356904b55873..f82a4da7adf3fb34d4a8d03bf9a294f3a6312108 100644 (file)
@@ -9,7 +9,6 @@ config SUPERH
        select CLKDEV_LOOKUP
        select DMA_DIRECT_OPS
        select HAVE_IDE if HAS_IOPORT_MAP
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select ARCH_DISCARD_MEMBLOCK
        select HAVE_OPROFILE
index 98c0996f3c2c3017835c7e7757ed51c5b97b15d5..490b2c95c212cf794671ec2e72b4458d33fbdde8 100644 (file)
@@ -45,7 +45,6 @@ config SPARC
        select LOCKDEP_SMALL if LOCKDEP
        select NEED_DMA_MAP_STATE
        select NEED_SG_DMA_LENGTH
-       select HAVE_MEMBLOCK
 
 config SPARC32
        def_bool !64BIT
index ce3d56299b2850d6d6cdff8b79ee0a07fed78d1c..6b9938919f0bab07e46fefbe97b45c4cab663a8c 100644 (file)
@@ -12,7 +12,6 @@ config UML
        select HAVE_UID16
        select HAVE_FUTEX_CMPXCHG if FUTEX
        select HAVE_DEBUG_KMEMLEAK
-       select HAVE_MEMBLOCK
        select GENERIC_IRQ_SHOW
        select GENERIC_CPU_DEVICES
        select GENERIC_CLOCKEVENTS
index 3a3b40f795589220c7183227de470033bb5316fd..a4c05159dca5c29ce4393176e13a61a6ec3fcb84 100644 (file)
@@ -5,7 +5,6 @@ config UNICORE32
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_MIGHT_HAVE_PC_SERIO
        select DMA_DIRECT_OPS
-       select HAVE_MEMBLOCK
        select HAVE_GENERIC_DMA_COHERENT
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_BZIP2
index 0354f52ef30ea778b1ef7c1a0c00d7957cc6dea3..c51c989c19c08da99155d354cc11558c1cdb36d4 100644 (file)
@@ -169,7 +169,6 @@ config X86
        select HAVE_KRETPROBES
        select HAVE_KVM
        select HAVE_LIVEPATCH                   if X86_64
-       select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_MIXED_BREAKPOINTS_REGS
        select HAVE_MOD_ARCH_SPECIFIC
index df43d2e7684270fc19b01ea106ba8de3ef68da20..60c141af222bc5e05c426e6c0edf976e93c036d0 100644 (file)
@@ -28,7 +28,6 @@ config XTENSA
        select HAVE_FUTEX_CMPXCHG if !MMU
        select HAVE_HW_BREAKPOINT if PERF_EVENTS
        select HAVE_IRQ_TIME_ACCOUNTING
-       select HAVE_MEMBLOCK
        select HAVE_OPROFILE
        select HAVE_PERF_EVENTS
        select HAVE_STACKPROTECTOR
index 76c83c1ffeda9368c4d464e486d3a1d529fbf15b..4f915cea6f755a1e3660d023f1521ec9b116177f 100644 (file)
@@ -1115,7 +1115,6 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
        return 1;
 }
 
-#ifdef CONFIG_HAVE_MEMBLOCK
 #ifndef MIN_MEMBLOCK_ADDR
 #define MIN_MEMBLOCK_ADDR      __pa(PAGE_OFFSET)
 #endif
@@ -1178,26 +1177,6 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
        return memblock_reserve(base, size);
 }
 
-#else
-void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
-{
-       WARN_ON(1);
-}
-
-int __init __weak early_init_dt_mark_hotplug_memory_arch(u64 base, u64 size)
-{
-       return -ENOSYS;
-}
-
-int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
-                                       phys_addr_t size, bool nomap)
-{
-       pr_err("Reserved memory not supported, ignoring range %pa - %pa%s\n",
-                 &base, &size, nomap ? " (nomap)" : "");
-       return -ENOSYS;
-}
-#endif
-
 static void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
 {
        return memblock_virt_alloc(size, align);
index 895c83e0c7b6c4c816b1aad72c67e2a1a5235a88..d6255c276a41333323f9a4a200bd22d02dafbf02 100644 (file)
 #include <linux/of_reserved_mem.h>
 #include <linux/sort.h>
 #include <linux/slab.h>
+#include <linux/memblock.h>
 
 #define MAX_RESERVED_REGIONS   32
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
 static int reserved_mem_count;
 
-#if defined(CONFIG_HAVE_MEMBLOCK)
-#include <linux/memblock.h>
 int __init __weak early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
        phys_addr_t align, phys_addr_t start, phys_addr_t end, bool nomap,
        phys_addr_t *res_base)
@@ -54,16 +53,6 @@ int __init __weak early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
                return memblock_remove(base, size);
        return 0;
 }
-#else
-int __init __weak early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
-       phys_addr_t align, phys_addr_t start, phys_addr_t end, bool nomap,
-       phys_addr_t *res_base)
-{
-       pr_err("Reserved memory not supported, ignoring region 0x%llx%s\n",
-                 size, nomap ? " (nomap)" : "");
-       return -ENOSYS;
-}
-#endif
 
 /**
  * res_mem_save_node() - save fdt node for second pass initialization
index c16dd16afe6a92d504ec4455d872228cfd8d9991..0fdda6f629533d4de97549aecc1d1751490a5190 100644 (file)
@@ -1,6 +1,6 @@
 menuconfig ION
        bool "Ion Memory Manager"
-       depends on HAVE_MEMBLOCK && HAS_DMA && MMU
+       depends on HAS_DMA && MMU
        select GENERIC_ALLOCATOR
        select DMA_SHARED_BUFFER
        help
index 503086f7f7c1b1a2890a2db3fa3ab4bacea37051..0d19d191ae70b85daae2276b85a3f42eb48645ac 100644 (file)
@@ -141,7 +141,6 @@ config PSTORE_RAM
        tristate "Log panic/oops to a RAM buffer"
        depends on PSTORE
        depends on HAS_IOMEM
-       depends on HAVE_MEMBLOCK
        select REED_SOLOMON
        select REED_SOLOMON_ENC8
        select REED_SOLOMON_DEC8
index 1f005b5c1555866307009cdddece71467a35a2f7..ee61ac355104e6d68cf2266d5c31938f1a651b0a 100644 (file)
@@ -132,9 +132,6 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
 #define alloc_bootmem_low_pages_node(pgdat, x) \
        __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
 
-
-#if defined(CONFIG_HAVE_MEMBLOCK)
-
 /* FIXME: use MEMBLOCK_ALLOC_* variants here */
 #define BOOTMEM_ALLOC_ACCESSIBLE       0
 #define BOOTMEM_ALLOC_ANYWHERE         (~(phys_addr_t)0)
@@ -234,115 +231,6 @@ static inline void __init memblock_free_late(
        __memblock_free_late(base, size);
 }
 
-#else
-
-#define BOOTMEM_ALLOC_ACCESSIBLE       0
-
-
-/* Fall back to all the existing bootmem APIs */
-static inline void * __init memblock_virt_alloc(
-                                       phys_addr_t size,  phys_addr_t align)
-{
-       if (!align)
-               align = SMP_CACHE_BYTES;
-       return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT);
-}
-
-static inline void * __init memblock_virt_alloc_raw(
-                                       phys_addr_t size,  phys_addr_t align)
-{
-       if (!align)
-               align = SMP_CACHE_BYTES;
-       return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);
-}
-
-static inline void * __init memblock_virt_alloc_nopanic(
-                                       phys_addr_t size, phys_addr_t align)
-{
-       if (!align)
-               align = SMP_CACHE_BYTES;
-       return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);
-}
-
-static inline void * __init memblock_virt_alloc_low(
-                                       phys_addr_t size, phys_addr_t align)
-{
-       if (!align)
-               align = SMP_CACHE_BYTES;
-       return __alloc_bootmem_low(size, align, 0);
-}
-
-static inline void * __init memblock_virt_alloc_low_nopanic(
-                                       phys_addr_t size, phys_addr_t align)
-{
-       if (!align)
-               align = SMP_CACHE_BYTES;
-       return __alloc_bootmem_low_nopanic(size, align, 0);
-}
-
-static inline void * __init memblock_virt_alloc_from_nopanic(
-               phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
-{
-       return __alloc_bootmem_nopanic(size, align, min_addr);
-}
-
-static inline void * __init memblock_virt_alloc_node(
-                                               phys_addr_t size, int nid)
-{
-       return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES,
-                                    BOOTMEM_LOW_LIMIT);
-}
-
-static inline void * __init memblock_virt_alloc_node_nopanic(
-                                               phys_addr_t size, int nid)
-{
-       return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size,
-                                            SMP_CACHE_BYTES,
-                                            BOOTMEM_LOW_LIMIT);
-}
-
-static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size,
-       phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid)
-{
-       return __alloc_bootmem_node_high(NODE_DATA(nid), size, align,
-                                         min_addr);
-}
-
-static inline void * __init memblock_virt_alloc_try_nid_raw(
-                       phys_addr_t size, phys_addr_t align,
-                       phys_addr_t min_addr, phys_addr_t max_addr, int nid)
-{
-       return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align,
-                               min_addr, max_addr);
-}
-
-static inline void * __init memblock_virt_alloc_try_nid_nopanic(
-                       phys_addr_t size, phys_addr_t align,
-                       phys_addr_t min_addr, phys_addr_t max_addr, int nid)
-{
-       return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align,
-                               min_addr, max_addr);
-}
-
-static inline void __init memblock_free_early(
-                                       phys_addr_t base, phys_addr_t size)
-{
-       free_bootmem(base, size);
-}
-
-static inline void __init memblock_free_early_nid(
-                               phys_addr_t base, phys_addr_t size, int nid)
-{
-       free_bootmem_node(NODE_DATA(nid), base, size);
-}
-
-static inline void __init memblock_free_late(
-                                       phys_addr_t base, phys_addr_t size)
-{
-       free_bootmem_late(base, size);
-}
-#endif /* defined(CONFIG_HAVE_MEMBLOCK) */
-
 extern void *alloc_large_system_hash(const char *tablename,
                                     unsigned long bucketsize,
                                     unsigned long numentries,
index 2acdd046df2d5dda3edd9b30e9e4bd7700f42dca..224d27363ccaa434e2623b5c5858c72469861ea7 100644 (file)
@@ -2,7 +2,6 @@
 #define _LINUX_MEMBLOCK_H
 #ifdef __KERNEL__
 
-#ifdef CONFIG_HAVE_MEMBLOCK
 /*
  * Logical memory blocks.
  *
@@ -440,12 +439,6 @@ static inline void early_memtest(phys_addr_t start, phys_addr_t end)
 {
 }
 #endif
-#else
-static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align)
-{
-       return 0;
-}
-#endif /* CONFIG_HAVE_MEMBLOCK */
 
 #endif /* __KERNEL__ */
 
index 1e52b8fd168593fb85356afedb07a29b66d95aac..fcf9cc9d535faf54c6b0fa463b6cf09643d0e5c4 100644 (file)
@@ -2163,7 +2163,7 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn,
                                        struct mminit_pfnnid_cache *state);
 #endif
 
-#if defined(CONFIG_HAVE_MEMBLOCK) && !defined(CONFIG_FLAT_NODE_MEM_MAP)
+#if !defined(CONFIG_FLAT_NODE_MEM_MAP)
 void zero_resv_unavail(void);
 #else
 static inline void zero_resv_unavail(void) {}
index e0ba05e6f6bd151aea1ae5353a13f749ff0848c2..1af29b8224fdff289c210af95d3d9228769dbd2e 100644 (file)
@@ -1292,7 +1292,7 @@ config DEBUG_KOBJECT
        depends on DEBUG_KERNEL
        help
          If you say Y here, some extra kobject debugging messages will be sent
-         to the syslog. 
+         to the syslog.
 
 config DEBUG_KOBJECT_RELEASE
        bool "kobject release debugging"
@@ -1980,7 +1980,6 @@ endif # RUNTIME_TESTING_MENU
 
 config MEMTEST
        bool "Memtest"
-       depends on HAVE_MEMBLOCK
        ---help---
          This option adds a kernel parameter 'memtest', which allows memtest
          to be set.
index f7cb608f9ab205324655ce9ed2c613484be7e0c1..d85e39da47aed166d58f7bba669d60afb12bad59 100644 (file)
@@ -127,9 +127,6 @@ config SPARSEMEM_VMEMMAP
         pfn_to_page and page_to_pfn operations.  This is the most
         efficient option when sufficient kernel resources are available.
 
-config HAVE_MEMBLOCK
-       bool
-
 config HAVE_MEMBLOCK_NODE_MAP
        bool
 
@@ -478,7 +475,7 @@ config FRONTSWAP
 
 config CMA
        bool "Contiguous Memory Allocator"
-       depends on HAVE_MEMBLOCK && MMU
+       depends on MMU
        select MIGRATION
        select MEMORY_ISOLATION
        help
index ea5333886593b04da5b375a8f02c0d924a9c1510..ca3c844d7a56d35b0fe8f9e214c24ef46c32e3ef 100644 (file)
@@ -43,11 +43,11 @@ obj-y                       := filemap.o mempool.o oom_kill.o fadvise.o \
 
 obj-y += init-mm.o
 obj-y += nobootmem.o
+obj-y += memblock.o
 
 ifdef CONFIG_MMU
        obj-$(CONFIG_ADVISE_SYSCALLS)   += madvise.o
 endif
-obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o
 
 obj-$(CONFIG_SWAP)     += page_io.o swap_state.o swapfile.o swap_slots.o
 obj-$(CONFIG_FRONTSWAP)        += frontswap.o
index 439af3b765a766fe77ece1b8acb9d517b1f12df6..d4d0cd4740874d40227e8fa9b32266a3321284a2 100644 (file)
 
 #include "internal.h"
 
-#ifndef CONFIG_HAVE_MEMBLOCK
-#error CONFIG_HAVE_MEMBLOCK not defined
-#endif
-
 #ifndef CONFIG_NEED_MULTIPLE_NODES
 struct pglist_data __refdata contig_page_data;
 EXPORT_SYMBOL(contig_page_data);
index 863d46da6586d9b988aa5c004a46f85ca389dfe4..59d171f84445aea9783daab0c90630a80a30e50b 100644 (file)
@@ -6508,8 +6508,7 @@ void __init free_area_init_node(int nid, unsigned long *zones_size,
        free_area_init_core(pgdat);
 }
 
-#if defined(CONFIG_HAVE_MEMBLOCK) && !defined(CONFIG_FLAT_NODE_MEM_MAP)
-
+#if !defined(CONFIG_FLAT_NODE_MEM_MAP)
 /*
  * Zero all valid struct pages in range [spfn, epfn), return number of struct
  * pages zeroed
@@ -6569,7 +6568,7 @@ void __init zero_resv_unavail(void)
        if (pgcnt)
                pr_info("Zeroed struct page in unavailable ranges: %lld pages", pgcnt);
 }
-#endif /* CONFIG_HAVE_MEMBLOCK && !CONFIG_FLAT_NODE_MEM_MAP */
+#endif /* !CONFIG_FLAT_NODE_MEM_MAP */
 
 #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP