mm: remove bootmem allocator
Subsystems (88)
cover mm: remove bootmem allocator
Hi,
These patches switch early memory management to use memblock directly without any bootmem compatibility wrappers. As the result both bootmem and nobootmem are removed.
The patchset survived allyesconfig builds on arm, arm64, i386, mips, nds32, parisc, powerpc, riscv, s390 and x86 and most of the *_defconfig builds for all architectures except unicore32.
The patchset is based on v4.19-rc3-mmotm-2018-09-12-16-40, so I needed a small PSI fix from [1] for some of the builds.
I did my best to verify that the failures are not caused by my changes, but I may have missed something. Most defconfig build failures I've seen were caused by assembler being unhappy about unsupported opcode, wrong encoding or something else. Some builds for allyesconfig also failed because of it and others failed because of symbol mismatch in spi-sprd or n_hdlc.
I've done boot testing on real x86-64 and Power8 machines and on qemu-system-alpha and qemu-system-mips64el VMs.
I've tried to keep the distribution list as small as possible, but it's still pretty log; my apologies for spamming.
Changes since RFC:
* updated MIPS conversion to nobootmem:
- set memblock limit to max_low_pfn to avoid allocation attempts from high memory
- use boottom-up mode for allocation of the exceptions base
* added elaborate changelogs
* updated boot-time-mm documentation
[1] https://lkml.org/lkml/2018/9/13/88
Mike Rapoport (30):
mips: switch to NO_BOOTMEM
mm: remove CONFIG_NO_BOOTMEM
mm: remove CONFIG_HAVE_MEMBLOCK
mm: remove bootmem allocator implementation.
mm: nobootmem: remove dead code
memblock: rename memblock_alloc{_nid,_try_nid} to memblock_phys_alloc*
memblock: remove _virt from APIs returning virtual address
memblock: replace alloc_bootmem_align with memblock_alloc
memblock: replace alloc_bootmem_low with memblock_alloc_low
memblock: replace __alloc_bootmem_node_nopanic with
memblock_alloc_try_nid_nopanic
memblock: replace alloc_bootmem_pages_nopanic with
memblock_alloc_nopanic
memblock: replace alloc_bootmem_low with memblock_alloc_low
memblock: replace __alloc_bootmem_nopanic with
memblock_alloc_from_nopanic
memblock: add align parameter to memblock_alloc_node()
memblock: replace alloc_bootmem_pages_node with memblock_alloc_node
memblock: replace __alloc_bootmem_node with appropriate memblock_ API
memblock: replace alloc_bootmem_node with memblock_alloc_node
memblock: replace alloc_bootmem_low_pages with memblock_alloc_low
memblock: replace alloc_bootmem_pages with memblock_alloc
memblock: replace __alloc_bootmem with memblock_alloc_from
memblock: replace alloc_bootmem with memblock_alloc
mm: nobootmem: remove bootmem allocation APIs
memblock: replace free_bootmem{_node} with memblock_free
memblock: replace free_bootmem_late with memblock_free_late
memblock: rename free_all_bootmem to memblock_free_all
memblock: rename __free_pages_bootmem to memblock_free_pages
mm: remove nobootmem
memblock: replace BOOTMEM_ALLOC_* with MEMBLOCK variants
mm: remove include/linux/bootmem.h
docs/boot-time-mm: remove bootmem documentation
Documentation/core-api/boot-time-mm.rst | 71 +-- arch/alpha/Kconfig | 2 - arch/alpha/kernel/core_cia.c | 4 +- arch/alpha/kernel/core_irongate.c | 4 +- arch/alpha/kernel/core_marvel.c | 6 +- arch/alpha/kernel/core_titan.c | 2 +- arch/alpha/kernel/core_tsunami.c | 2 +- arch/alpha/kernel/pci-noop.c | 6 +- arch/alpha/kernel/pci.c | 6 +- arch/alpha/kernel/pci_iommu.c | 14 +- arch/alpha/kernel/setup.c | 3 +- arch/alpha/kernel/sys_nautilus.c | 2 +- arch/alpha/mm/init.c | 4 +- arch/alpha/mm/numa.c | 1 - arch/arc/Kconfig | 2 - arch/arc/kernel/unwind.c | 6 +- arch/arc/mm/highmem.c | 4 +- arch/arc/mm/init.c | 3 +- arch/arm/Kconfig | 2 - arch/arm/kernel/devtree.c | 1 - arch/arm/kernel/setup.c | 5 +- arch/arm/mach-omap2/omap_hwmod.c | 8 +- arch/arm/mm/dma-mapping.c | 1 - arch/arm/mm/init.c | 3 +- arch/arm/mm/mmu.c | 2 +- arch/arm/xen/mm.c | 1 - arch/arm/xen/p2m.c | 2 +- arch/arm64/Kconfig | 2 - arch/arm64/kernel/acpi.c | 1 - arch/arm64/kernel/acpi_numa.c | 1 - arch/arm64/kernel/setup.c | 3 +- arch/arm64/mm/dma-mapping.c | 2 +- arch/arm64/mm/init.c | 5 +- arch/arm64/mm/kasan_init.c | 3 +- arch/arm64/mm/mmu.c | 2 +- arch/arm64/mm/numa.c | 5 +- arch/c6x/Kconfig | 2 - arch/c6x/kernel/setup.c | 1 - arch/c6x/mm/dma-coherent.c | 4 +- arch/c6x/mm/init.c | 7 +- arch/h8300/Kconfig | 2 - arch/h8300/kernel/setup.c | 1 - arch/h8300/mm/init.c | 6 +- arch/hexagon/Kconfig | 2 - arch/hexagon/kernel/dma.c | 2 +- arch/hexagon/kernel/setup.c | 2 +- arch/hexagon/mm/init.c | 3 +- arch/ia64/Kconfig | 2 - arch/ia64/kernel/crash.c | 2 +- arch/ia64/kernel/efi.c | 2 +- arch/ia64/kernel/ia64_ksyms.c | 2 +- arch/ia64/kernel/iosapic.c | 2 +- arch/ia64/kernel/mca.c | 10 +- arch/ia64/kernel/mca_drv.c | 2 +- arch/ia64/kernel/setup.c | 1 - arch/ia64/kernel/smpboot.c | 2 +- arch/ia64/kernel/topology.c | 2 +- arch/ia64/kernel/unwind.c | 2 +- arch/ia64/mm/contig.c | 6 +- arch/ia64/mm/discontig.c | 7 +- arch/ia64/mm/init.c | 11 +- arch/ia64/mm/numa.c | 2 +- arch/ia64/mm/tlb.c | 6 +- arch/ia64/pci/pci.c | 2 +- arch/ia64/sn/kernel/bte.c | 2 +- arch/ia64/sn/kernel/io_common.c | 9 +- arch/ia64/sn/kernel/setup.c | 6 +- arch/m68k/Kconfig | 2 - arch/m68k/atari/stram.c | 5 +- arch/m68k/coldfire/m54xx.c | 2 +- arch/m68k/kernel/setup_mm.c | 1 - arch/m68k/kernel/setup_no.c | 1 - arch/m68k/kernel/uboot.c | 2 +- arch/m68k/mm/init.c | 6 +- arch/m68k/mm/mcfmmu.c | 5 +- arch/m68k/mm/motorola.c | 8 +- arch/m68k/mm/sun3mmu.c | 6 +- arch/m68k/sun3/config.c | 2 +- arch/m68k/sun3/dvma.c | 2 +- arch/m68k/sun3/mmu_emu.c | 2 +- arch/m68k/sun3/sun3dvma.c | 5 +- arch/m68k/sun3x/dvma.c | 2 +- arch/microblaze/Kconfig | 2 - arch/microblaze/mm/consistent.c | 2 +- arch/microblaze/mm/init.c | 7 +- arch/microblaze/pci/pci-common.c | 2 +- arch/mips/Kconfig | 1 - arch/mips/ar7/memory.c | 2 +- arch/mips/ath79/setup.c | 2 +- arch/mips/bcm63xx/prom.c | 2 +- arch/mips/bcm63xx/setup.c | 2 +- arch/mips/bmips/setup.c | 2 +- arch/mips/cavium-octeon/dma-octeon.c | 4 +- arch/mips/dec/prom/memory.c | 2 +- arch/mips/emma/common/prom.c | 2 +- arch/mips/fw/arc/memory.c | 2 +- arch/mips/jazz/jazzdma.c | 2 +- arch/mips/kernel/crash.c | 2 +- arch/mips/kernel/crash_dump.c | 2 +- arch/mips/kernel/prom.c | 2 +- arch/mips/kernel/setup.c | 104 +--- arch/mips/kernel/traps.c | 6 +- arch/mips/kernel/vpe.c | 2 +- arch/mips/kvm/commpage.c | 2 +- arch/mips/kvm/dyntrans.c | 2 +- arch/mips/kvm/emulate.c | 2 +- arch/mips/kvm/interrupt.c | 2 +- arch/mips/kvm/mips.c | 2 +- arch/mips/lantiq/prom.c | 2 +- arch/mips/lasat/prom.c | 2 +- arch/mips/loongson64/common/init.c | 2 +- arch/mips/loongson64/loongson-3/numa.c | 37 +- arch/mips/mm/init.c | 7 +- arch/mips/mm/pgtable-32.c | 2 +- arch/mips/mti-malta/malta-memory.c | 2 +- arch/mips/netlogic/xlp/dt.c | 2 +- arch/mips/pci/pci-legacy.c | 2 +- arch/mips/pci/pci.c | 2 +- arch/mips/ralink/of.c | 2 +- arch/mips/rb532/prom.c | 2 +- arch/mips/sgi-ip27/ip27-memory.c | 14 +- arch/mips/sibyte/common/cfe.c | 2 +- arch/mips/sibyte/swarm/setup.c | 2 +- arch/mips/txx9/rbtx4938/prom.c | 2 +- arch/nds32/Kconfig | 2 - arch/nds32/kernel/setup.c | 3 +- arch/nds32/mm/highmem.c | 2 +- arch/nds32/mm/init.c | 13 +- arch/nios2/Kconfig | 2 - arch/nios2/kernel/prom.c | 2 +- arch/nios2/kernel/setup.c | 1 - arch/nios2/mm/init.c | 4 +- arch/openrisc/Kconfig | 2 - arch/openrisc/kernel/setup.c | 3 +- arch/openrisc/mm/init.c | 7 +- arch/openrisc/mm/ioremap.c | 2 +- arch/parisc/Kconfig | 2 - arch/parisc/mm/init.c | 3 +- arch/powerpc/Kconfig | 2 - arch/powerpc/kernel/dt_cpu_ftrs.c | 4 +- arch/powerpc/kernel/paca.c | 2 +- arch/powerpc/kernel/pci_32.c | 4 +- arch/powerpc/kernel/prom.c | 2 +- arch/powerpc/kernel/setup-common.c | 3 +- arch/powerpc/kernel/setup_32.c | 10 +- arch/powerpc/kernel/setup_64.c | 11 +- arch/powerpc/lib/alloc.c | 4 +- arch/powerpc/mm/hugetlbpage.c | 1 - arch/powerpc/mm/mem.c | 5 +- arch/powerpc/mm/mmu_context_nohash.c | 8 +- arch/powerpc/mm/numa.c | 5 +- arch/powerpc/mm/pgtable_32.c | 2 +- arch/powerpc/mm/ppc_mmu_32.c | 2 +- arch/powerpc/platforms/pasemi/iommu.c | 2 +- arch/powerpc/platforms/powermac/nvram.c | 4 +- arch/powerpc/platforms/powernv/opal.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 9 +- arch/powerpc/platforms/ps3/setup.c | 4 +- arch/powerpc/sysdev/dart_iommu.c | 2 +- arch/powerpc/sysdev/msi_bitmap.c | 4 +- arch/riscv/Kconfig | 2 - arch/riscv/mm/init.c | 5 +- arch/s390/Kconfig | 2 - arch/s390/kernel/crash_dump.c | 5 +- arch/s390/kernel/setup.c | 16 +- arch/s390/kernel/smp.c | 5 +- arch/s390/kernel/topology.c | 6 +- arch/s390/kernel/vdso.c | 2 +- arch/s390/mm/extmem.c | 2 +- arch/s390/mm/init.c | 5 +- arch/s390/mm/vmem.c | 7 +- arch/s390/numa/mode_emu.c | 3 +- arch/s390/numa/numa.c | 3 +- arch/s390/numa/toptree.c | 4 +- arch/sh/Kconfig | 2 - arch/sh/mm/init.c | 9 +- arch/sh/mm/ioremap_fixed.c | 2 +- arch/sparc/Kconfig | 2 - arch/sparc/kernel/mdesc.c | 7 +- arch/sparc/kernel/prom_32.c | 4 +- arch/sparc/kernel/prom_64.c | 2 +- arch/sparc/kernel/setup_64.c | 12 +- arch/sparc/kernel/smp_64.c | 18 +- arch/sparc/mm/init_32.c | 5 +- arch/sparc/mm/init_64.c | 27 +- arch/sparc/mm/srmmu.c | 12 +- arch/um/Kconfig | 2 - arch/um/drivers/net_kern.c | 4 +- arch/um/drivers/vector_kern.c | 4 +- arch/um/kernel/initrd.c | 4 +- arch/um/kernel/mem.c | 16 +- arch/um/kernel/physmem.c | 1 - arch/unicore32/Kconfig | 2 - arch/unicore32/kernel/hibernate.c | 2 +- arch/unicore32/kernel/setup.c | 5 +- arch/unicore32/mm/init.c | 7 +- arch/unicore32/mm/mmu.c | 3 +- arch/x86/Kconfig | 4 - arch/x86/kernel/acpi/boot.c | 5 +- arch/x86/kernel/acpi/sleep.c | 1 - arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/apic/io_apic.c | 7 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/e820.c | 5 +- arch/x86/kernel/mpparse.c | 1 - arch/x86/kernel/pci-dma.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/kernel/pvclock.c | 2 +- arch/x86/kernel/setup.c | 1 - arch/x86/kernel/setup_percpu.c | 14 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/tce_64.c | 6 +- arch/x86/mm/amdtopology.c | 1 - arch/x86/mm/fault.c | 2 +- arch/x86/mm/highmem_32.c | 4 +- arch/x86/mm/init.c | 1 - arch/x86/mm/init_32.c | 5 +- arch/x86/mm/init_64.c | 7 +- arch/x86/mm/ioremap.c | 2 +- arch/x86/mm/kasan_init_64.c | 11 +- arch/x86/mm/numa.c | 3 +- arch/x86/mm/numa_32.c | 1 - arch/x86/mm/numa_64.c | 2 +- arch/x86/mm/numa_emulation.c | 1 - arch/x86/mm/pageattr-test.c | 2 +- arch/x86/mm/pageattr.c | 2 +- arch/x86/mm/pat.c | 2 +- arch/x86/mm/physaddr.c | 2 +- arch/x86/pci/i386.c | 2 +- arch/x86/platform/efi/efi.c | 3 +- arch/x86/platform/efi/efi_64.c | 2 +- arch/x86/platform/efi/quirks.c | 7 +- arch/x86/platform/olpc/olpc_dt.c | 4 +- arch/x86/power/hibernate_32.c | 2 +- arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/enlighten_pv.c | 3 +- arch/x86/xen/mmu_pv.c | 2 +- arch/x86/xen/p2m.c | 6 +- arch/xtensa/Kconfig | 2 - arch/xtensa/kernel/pci.c | 2 +- arch/xtensa/mm/cache.c | 2 +- arch/xtensa/mm/init.c | 4 +- arch/xtensa/mm/kasan_init.c | 5 +- arch/xtensa/mm/mmu.c | 4 +- arch/xtensa/platforms/iss/network.c | 4 +- arch/xtensa/platforms/iss/setup.c | 2 +- block/blk-settings.c | 2 +- block/bounce.c | 2 +- drivers/acpi/numa.c | 1 - drivers/acpi/tables.c | 3 +- drivers/base/platform.c | 2 +- drivers/clk/ti/clk.c | 4 +- drivers/firmware/dmi_scan.c | 2 +- drivers/firmware/efi/apple-properties.c | 4 +- drivers/firmware/efi/memmap.c | 2 +- drivers/firmware/iscsi_ibft_find.c | 2 +- drivers/firmware/memmap.c | 4 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- drivers/macintosh/smu.c | 7 +- drivers/mtd/ar7part.c | 2 +- drivers/net/arcnet/arc-rimi.c | 2 +- drivers/net/arcnet/com20020-isa.c | 2 +- drivers/net/arcnet/com90io.c | 2 +- drivers/of/fdt.c | 5 +- drivers/of/of_reserved_mem.c | 13 +- drivers/of/unittest.c | 4 +- drivers/s390/char/fs3270.c | 2 +- drivers/s390/char/tty3270.c | 2 +- drivers/s390/cio/cmf.c | 2 +- drivers/s390/virtio/virtio_ccw.c | 2 +- drivers/sfi/sfi_core.c | 2 +- drivers/staging/android/ion/Kconfig | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- drivers/usb/early/xhci-dbc.c | 14 +- drivers/xen/balloon.c | 2 +- drivers/xen/events/events_base.c | 2 +- drivers/xen/grant-table.c | 2 +- drivers/xen/swiotlb-xen.c | 8 +- drivers/xen/xen-selfballoon.c | 2 +- fs/dcache.c | 2 +- fs/inode.c | 2 +- fs/namespace.c | 2 +- fs/proc/kcore.c | 2 +- fs/proc/page.c | 2 +- fs/proc/vmcore.c | 2 +- fs/pstore/Kconfig | 1 - include/linux/bootmem.h | 404 -------------- include/linux/memblock.h | 159 +++++- include/linux/mm.h | 2 +- include/linux/mmzone.h | 5 +- init/main.c | 12 +- kernel/dma/swiotlb.c | 10 +- kernel/futex.c | 2 +- kernel/locking/qspinlock_paravirt.h | 2 +- kernel/pid.c | 2 +- kernel/power/snapshot.c | 4 +- kernel/printk/printk.c | 5 +- kernel/profile.c | 2 +- lib/Kconfig.debug | 3 +- lib/cpumask.c | 4 +- mm/Kconfig | 8 +- mm/Makefile | 8 +- mm/bootmem.c | 811 ---------------------------- mm/hugetlb.c | 6 +- mm/internal.h | 2 +- mm/kasan/kasan_init.c | 7 +- mm/kmemleak.c | 2 +- mm/memblock.c | 153 +++++- mm/memory_hotplug.c | 1 - mm/nobootmem.c | 445 --------------- mm/page_alloc.c | 17 +- mm/page_ext.c | 6 +- mm/page_idle.c | 2 +- mm/page_owner.c | 2 +- mm/page_poison.c | 2 +- mm/percpu.c | 30 +- mm/sparse-vmemmap.c | 6 +- mm/sparse.c | 18 +- net/ipv4/inet_hashtables.c | 2 +- net/ipv4/tcp.c | 2 +- net/ipv4/udp.c | 2 +- net/sctp/protocol.c | 2 +- net/xfrm/xfrm_hash.c | 2 +- 326 files changed, 866 insertions(+), 2539 deletions(-) delete mode 100644 include/linux/bootmem.h delete mode 100644 mm/bootmem.c delete mode 100644 mm/nobootmem.c
Signature · 1 line
2.7.4
PATCH 1/30 mips: switch to NO_BOOTMEM
MIPS already has memblock support and all the memory is already registered with it.
This patch replaces bootmem memory reservations with memblock ones and removes the bootmem initialization.
Since memblock allocates memory in top-down mode, we ensure that memblock limit is max_low_pfn to prevent allocations from the high memory.
To have the exceptions base in the lower 512M of the physical memory, its allocation in arch/mips/kernel/traps.c::traps_init() is using bottom-up mode.
--- arch/mips/Kconfig | 1 + arch/mips/kernel/setup.c | 99 ++++++++-------------------------- arch/mips/kernel/traps.c | 3 ++ arch/mips/loongson64/loongson-3/numa.c | 34 ++++++------ arch/mips/sgi-ip27/ip27-memory.c | 11 ++-- 5 files changed, 46 insertions(+), 102 deletions(-)
arch/mips/Kconfig +1 -0
@@ -78,6 +78,7 @@ config MIPS select RTC_LIB select SYSCTL_EXCEPTION_TRACE select VIRT_TO_BUS + select NO_BOOTMEM menu "Machine selection"
arch/mips/kernel/setup.c +23 -76
178 lines not on this page · raw message
arch/mips/kernel/traps.c +3 -0
@@ -29,6 +29,7 @@#include <linux/spinlock.h> #include <linux/kallsyms.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/interrupt.h> #include <linux/ptrace.h> #include <linux/kgdb.h>
@@ -2260,8 +2261,10 @@ void __init trap_init(void)unsigned long size =0x200 +VECTORSPACING *64 ;phys_addr_t ebase_pa; +memblock_set_bottom_up (true); ebase = (unsigned long )__alloc_bootmem (size,1 <<fls (size),0 ); +memblock_set_bottom_up (false);/* * Try to ensure ebase resides in KSeg0 if possible.
arch/mips/loongson64/loongson-3/numa.c +15 -19
@@ -180,43 +180,39 @@ static void __init szmem(unsigned int node)static void __init node_mem_init (unsigned int node) { -unsigned long bootmap_size;unsigned long node_addrspace_offset; -unsigned long start_pfn, end_pfn, freepfn; +unsigned long start_pfn, end_pfn; node_addrspace_offset =nid_to_addroffset (node);pr_info ("Node%d's addrspace_offset is 0x%lx\n" , node, node_addrspace_offset);get_pfn_range_for_nid (node, &start_pfn, &end_pfn); - freepfn = start_pfn; -if (node ==0 ) - freepfn =PFN_UP (__pa_symbol (&_end));/* kernel end address */ -pr_info ("Node%d: start_pfn=0x%lx, end_pfn=0x%lx, freepfn=0x%lx\n" , - node, start_pfn, end_pfn, freepfn); +pr_info ("Node%d: start_pfn=0x%lx, end_pfn=0x%lx\n" , + node, start_pfn, end_pfn); __node_data[node] = prealloc__node_data + node; -NODE_DATA (node)->bdata = &bootmem_node_data[node];NODE_DATA (node)->node_start_pfn = start_pfn;NODE_DATA (node)->node_spanned_pages = end_pfn - start_pfn; - bootmap_size =init_bootmem_node (NODE_DATA (node), freepfn, - start_pfn, end_pfn);free_bootmem_with_active_regions (node, end_pfn); -if (node ==0 )/* used by finalize_initrd() */ + +if (node ==0 ) { +/* kernel end address */ +unsigned long kernel_end_pfn =PFN_UP (__pa_symbol (&_end)); + +/* used by finalize_initrd() */ max_low_pfn = end_pfn; -/* This is reserved for the kernel and bdata->node_bootmem_map */ -reserve_bootmem_node (NODE_DATA (node), start_pfn <<PAGE_SHIFT , - ((freepfn - start_pfn) <<PAGE_SHIFT ) + bootmap_size, -BOOTMEM_DEFAULT ); +/* Reserve the kernel text/data/bss */ +memblock_reserve (start_pfn <<PAGE_SHIFT , + ((kernel_end_pfn - start_pfn) <<PAGE_SHIFT )); -if (node ==0 &&node_end_pfn (0 ) >= (0xffffffff >>PAGE_SHIFT )) {/* Reserve 0xfe000000~0xffffffff for RS780E integrated GPU */ -reserve_bootmem_node (NODE_DATA (node), - (node_addrspace_offset |0xfe000000 ), -32 <<20 ,BOOTMEM_DEFAULT ); +if (node_end_pfn (0 ) >= (0xffffffff >>PAGE_SHIFT )) +memblock_reserve ((node_addrspace_offset |0xfe000000 ), +32 <<20 ); }sparse_memory_present_with_active_regions (node);
arch/mips/sgi-ip27/ip27-memory.c +4 -7
@@ -389,7 +389,6 @@ static void __init node_mem_init(cnodeid_t node) {unsigned long slot_firstpfn =slot_getbasepfn (node,0 );unsigned long slot_freepfn =node_getfirstfree (node); -unsigned long bootmap_size;unsigned long start_pfn, end_pfn;get_pfn_range_for_nid (node, &start_pfn, &end_pfn);
@@ -400,7 +399,6 @@ static void __init node_mem_init(cnodeid_t node) __node_data[node] =__va (slot_freepfn <<PAGE_SHIFT );memset (__node_data[node],0 ,PAGE_SIZE ); -NODE_DATA (node)->bdata = &bootmem_node_data[node];NODE_DATA (node)->node_start_pfn = start_pfn;NODE_DATA (node)->node_spanned_pages = end_pfn - start_pfn;
@@ -409,12 +407,11 @@ static void __init node_mem_init(cnodeid_t node) slot_freepfn +=PFN_UP (sizeof (struct pglist_data ) +sizeof (struct hub_data )); - bootmap_size =init_bootmem_node (NODE_DATA (node), slot_freepfn, - start_pfn, end_pfn);free_bootmem_with_active_regions (node, end_pfn); -reserve_bootmem_node (NODE_DATA (node), slot_firstpfn <<PAGE_SHIFT , - ((slot_freepfn - slot_firstpfn) <<PAGE_SHIFT ) + bootmap_size, -BOOTMEM_DEFAULT ); + +memblock_reserve (slot_firstpfn <<PAGE_SHIFT , + ((slot_freepfn - slot_firstpfn) <<PAGE_SHIFT )); +sparse_memory_present_with_active_regions (node); }
Signature · 1 line
2.7.4
PATCH 2/30 mm: remove CONFIG_NO_BOOTMEM
In reply to Mike RapoportAll achitectures select NO_BOOTMEM which essentially becomes 'Y' for any kernel configuration and therefore it can be removed.
--- arch/alpha/Kconfig | 1 - arch/arc/Kconfig | 1 - arch/arm/Kconfig | 1 - arch/arm64/Kconfig | 1 - arch/c6x/Kconfig | 1 - arch/h8300/Kconfig | 1 - arch/hexagon/Kconfig | 1 - arch/ia64/Kconfig | 1 - arch/m68k/Kconfig | 1 - arch/microblaze/Kconfig | 1 - arch/mips/Kconfig | 1 - arch/nds32/Kconfig | 1 - arch/nios2/Kconfig | 1 - arch/openrisc/Kconfig | 1 - arch/parisc/Kconfig | 1 - arch/powerpc/Kconfig | 1 - arch/riscv/Kconfig | 1 - arch/s390/Kconfig | 1 - arch/sh/Kconfig | 1 - arch/sparc/Kconfig | 1 - arch/um/Kconfig | 1 - arch/unicore32/Kconfig | 1 - arch/x86/Kconfig | 3 --- arch/xtensa/Kconfig | 1 - include/linux/bootmem.h | 36 ++---------------------------------- include/linux/mmzone.h | 5 +---- mm/Kconfig | 3 --- mm/Makefile | 7 +------ mm/memblock.c | 2 -- 29 files changed, 4 insertions(+), 75 deletions(-)
arch/alpha/Kconfig +0 -1
@@ -32,7 +32,6 @@ config ALPHA select OLD_SIGSUSPEND select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67 select HAVE_MEMBLOCK - select NO_BOOTMEM help The Alpha is a 64-bit general-purpose processor designed and marketed by the Digital Equipment Corporation of blessed memory,
arch/arc/Kconfig +0 -1
@@ -44,7 +44,6 @@ config ARC select HANDLE_DOMAIN_IRQ select IRQ_DOMAIN select MODULES_USE_ELF_RELA - select NO_BOOTMEM select OF select OF_EARLY_FLATTREE select OF_RESERVED_MEM
arch/arm/Kconfig +0 -1
@@ -100,7 +100,6 @@ config ARM select IRQ_FORCED_THREADING select MODULES_USE_ELF_REL select NEED_DMA_MAP_STATE - select NO_BOOTMEM select OF_EARLY_FLATTREE if OF select OF_RESERVED_MEM if OF select OLD_SIGACTION
arch/arm64/Kconfig +0 -1
@@ -156,7 +156,6 @@ config ARM64 select MULTI_IRQ_HANDLER select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH - select NO_BOOTMEM select OF select OF_EARLY_FLATTREE select OF_RESERVED_MEM
arch/c6x/Kconfig +0 -1
@@ -14,7 +14,6 @@ config C6X select GENERIC_IRQ_SHOW select HAVE_ARCH_TRACEHOOK select HAVE_MEMBLOCK - select NO_BOOTMEM select SPARSE_IRQ select IRQ_DOMAIN select OF
arch/h8300/Kconfig +0 -1
@@ -16,7 +16,6 @@ config H8300 select OF_IRQ select OF_EARLY_FLATTREE select HAVE_MEMBLOCK - select NO_BOOTMEM select TIMER_OF select H8300_TMR8 select HAVE_KERNEL_GZIP
arch/hexagon/Kconfig +0 -1
@@ -33,7 +33,6 @@ config HEXAGON select GENERIC_CPU_DEVICES select HAVE_MEMBLOCK select ARCH_DISCARD_MEMBLOCK - select NO_BOOTMEM ---help--- Qualcomm Hexagon is a processor architecture designed for high performance and low power across a wide variety of applications.
arch/ia64/Kconfig +0 -1
@@ -28,7 +28,6 @@ config IA64 select HAVE_ARCH_TRACEHOOK select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP - select NO_BOOTMEM select HAVE_VIRT_CPU_ACCOUNTING select ARCH_HAS_DMA_MARK_CLEAN select ARCH_HAS_SG_CHAIN
arch/m68k/Kconfig +0 -1
@@ -29,7 +29,6 @@ config M68K select DMA_NONCOHERENT_OPS if HAS_DMA select HAVE_MEMBLOCK select ARCH_DISCARD_MEMBLOCK - select NO_BOOTMEM config CPU_BIG_ENDIAN def_bool y
arch/microblaze/Kconfig +0 -1
@@ -28,7 +28,6 @@ config MICROBLAZE select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_TRACER - select NO_BOOTMEM select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP select HAVE_OPROFILE
arch/mips/Kconfig +0 -1
@@ -78,7 +78,6 @@ config MIPS select RTC_LIB select SYSCTL_EXCEPTION_TRACE select VIRT_TO_BUS - select NO_BOOTMEM menu "Machine selection"
arch/nds32/Kconfig +0 -1
@@ -36,7 +36,6 @@ config NDS32 select MODULES_USE_ELF_RELA select OF select OF_EARLY_FLATTREE - select NO_BOOTMEM select NO_IOPORT_MAP select RTC_LIB select THREAD_INFO_IN_TASK
arch/nios2/Kconfig +0 -1
@@ -25,7 +25,6 @@ config NIOS2 select CPU_NO_EFFICIENT_FFS select HAVE_MEMBLOCK select ARCH_DISCARD_MEMBLOCK - select NO_BOOTMEM config GENERIC_CSUM def_bool y
arch/openrisc/Kconfig +0 -1
@@ -32,7 +32,6 @@ config OPENRISC select HAVE_DEBUG_STACKOVERFLOW select OR1K_PIC select CPU_NO_EFFICIENT_FFS if !OPENRISC_HAVE_INST_FF1 - select NO_BOOTMEM select ARCH_USE_QUEUED_SPINLOCKS select ARCH_USE_QUEUED_RWLOCKS select OMPIC if SMP
arch/parisc/Kconfig +0 -1
@@ -16,7 +16,6 @@ config PARISC select RTC_DRV_GENERIC select INIT_ALL_POSSIBLE select HAVE_MEMBLOCK - select NO_BOOTMEM select BUG select BUILDTIME_EXTABLE_SORT select HAVE_PERF_EVENTS
arch/powerpc/Kconfig +0 -1
@@ -228,7 +228,6 @@ config PPC select MODULES_USE_ELF_RELA select NEED_DMA_MAP_STATE if PPC64 || NOT_COHERENT_CACHE select NEED_SG_DMA_LENGTH - select NO_BOOTMEM select OF select OF_EARLY_FLATTREE select OF_RESERVED_MEM
arch/riscv/Kconfig +0 -1
@@ -34,7 +34,6 @@ config RISCV select HAVE_GENERIC_DMA_COHERENT select HAVE_PERF_EVENTS select IRQ_DOMAIN - select NO_BOOTMEM select RISCV_ISA_A if SMP select SPARSE_IRQ select SYSCTL_EXCEPTION_TRACE
arch/s390/Kconfig +0 -1
@@ -166,7 +166,6 @@ config S390 select HAVE_SYSCALL_TRACEPOINTS select HAVE_VIRT_CPU_ACCOUNTING select MODULES_USE_ELF_RELA - select NO_BOOTMEM select OLD_SIGACTION select OLD_SIGSUSPEND3 select SPARSE_IRQ
arch/sh/Kconfig +0 -1
@@ -10,7 +10,6 @@ config SUPERH select HAVE_IDE if HAS_IOPORT_MAP select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP - select NO_BOOTMEM select ARCH_DISCARD_MEMBLOCK select HAVE_OPROFILE select HAVE_GENERIC_DMA_COHERENT
arch/sparc/Kconfig +0 -1
@@ -46,7 +46,6 @@ config SPARC select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH select HAVE_MEMBLOCK - select NO_BOOTMEM config SPARC32 def_bool !64BIT
arch/um/Kconfig +0 -1
@@ -13,7 +13,6 @@ config UML select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_DEBUG_KMEMLEAK select HAVE_MEMBLOCK - select NO_BOOTMEM select GENERIC_IRQ_SHOW select GENERIC_CPU_DEVICES select GENERIC_CLOCKEVENTS
arch/unicore32/Kconfig +0 -1
@@ -5,7 +5,6 @@ config UNICORE32 select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select HAVE_MEMBLOCK - select NO_BOOTMEM select HAVE_GENERIC_DMA_COHERENT select HAVE_KERNEL_GZIP select HAVE_KERNEL_BZIP2
arch/x86/Kconfig +0 -3
@@ -835,9 +835,6 @@ config JAILHOUSE_GUEST endif #HYPERVISOR_GUEST -config NO_BOOTMEM - def_bool y - source "arch/x86/Kconfig.cpu" config HPET_TIMER
arch/xtensa/Kconfig +0 -1
@@ -33,7 +33,6 @@ config XTENSA select HAVE_STACKPROTECTOR select IRQ_DOMAIN select MODULES_USE_ELF_RELA - select NO_BOOTMEM select PERF_USE_VMALLOC select VIRT_TO_BUS help
include/linux/bootmem.h +2 -34
@@ -26,34 +26,6 @@ extern unsigned long max_pfn;*/ extern unsigned long long max_possible_pfn; -#ifndef CONFIG_NO_BOOTMEM -/** -* struct bootmem_data - per-node information used by the bootmem allocator -* @node_min_pfn: the starting physical address of the node's memory -* @node_low_pfn: the end physical address of the directly addressable memory -* @node_bootmem_map: is a bitmap pointer - the bits represent all physical -* memory pages (including holes) on the node. -* @last_end_off: the offset within the page of the end of the last allocation; -* if 0, the page used is full -* @hint_idx: the PFN of the page used with the last allocation; -* together with using this with the @last_end_offset field, -* a test can be made to see if allocations can be merged -* with the page used for the last allocation rather than -* using up a full new page. -* @list: list entry in the linked list ordered by the memory addresses -*/ -typedef struct bootmem_data { -unsigned long node_min_pfn; -unsigned long node_low_pfn; -void *node_bootmem_map; -unsigned long last_end_off; -unsigned long hint_idx; -struct list_head list; -}bootmem_data_t ; - -extern bootmem_data_t bootmem_node_data[]; -#endif -extern unsigned long bootmem_bootmap_pages (unsigned long ); extern unsigned long init_bootmem_node(pg_data_t *pgdat,
@@ -125,12 +97,8 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,unsigned long align, unsigned long goal) __malloc; -#ifdef CONFIG_NO_BOOTMEM /* We are using top down, so it is safe to use 0 here */ #define BOOTMEM_LOW_LIMIT 0 -#else -#define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS) -#endif #ifndef ARCH_LOW_ADDRESS_LIMIT #define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
@@ -165,7 +133,7 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) -#if defined(CONFIG_HAVE_MEMBLOCK ) && defined(CONFIG_NO_BOOTMEM ) +#if defined(CONFIG_HAVE_MEMBLOCK )/* FIXME: use MEMBLOCK_ALLOC_* variants here */ #define BOOTMEM_ALLOC_ACCESSIBLE 0
@@ -373,7 +341,7 @@ static inline void __init memblock_free_late( {free_bootmem_late (base, size); } -#endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */ +#endif /* defined(CONFIG_HAVE_MEMBLOCK) */ extern void *alloc_large_system_hash(const char *tablename, unsigned long bucketsize,
include/linux/mmzone.h +1 -4
@@ -632,9 +632,6 @@ typedef struct pglist_data {struct page_ext *node_page_ext;#endif #endif -#ifndef CONFIG_NO_BOOTMEM -struct bootmem_data *bdata; -#endif #if defined(CONFIG_MEMORY_HOTPLUG ) || defined(CONFIG_DEFERRED_STRUCT_PAGE_INIT )/* * Must be held any time you expect node_start_pfn, node_present_pages
@@ -878,7 +875,7 @@ static inline int is_highmem_idx(enum zone_type idx) }/** -* is_highmem - helper function to quickly check if a struct zone is a +* is_highmem - helper function to quickly check if a struct zone is a * highmem zone or not. This is an attempt to keep references * to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum. * @zone - pointer to struct zone variable
mm/Kconfig +0 -3
@@ -145,9 +145,6 @@ config HAVE_GENERIC_GUP config ARCH_DISCARD_MEMBLOCK bool -config NO_BOOTMEM - bool - config MEMORY_ISOLATION bool
mm/Makefile +1 -6
@@ -42,12 +42,7 @@ obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ debug.o $(mmu-y) obj-y += init-mm.o - -ifdef CONFIG_NO_BOOTMEM - obj-y += nobootmem.o -else - obj-y += bootmem.o -endif +obj-y += nobootmem.o ifdef CONFIG_MMU obj-$(CONFIG_ADVISE_SYSCALLS) += madvise.o
mm/memblock.c +0 -2
@@ -1369,7 +1369,6 @@ phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, ireturn memblock_alloc_base (size, align,MEMBLOCK_ALLOC_ACCESSIBLE ); } -#if defined(CONFIG_NO_BOOTMEM )/** * memblock_virt_alloc_internal - allocate boot memory block * @size: size of memory block to be allocated in bytes
@@ -1576,7 +1575,6 @@ void * __init memblock_virt_alloc_try_nid( __func__, (u64)size, (u64)align, nid, &min_addr, &max_addr);return NULL ; } -#endif /** * __memblock_free_early - free boot memory block
Signature · 1 line
2.7.4
PATCH 3/30 mm: remove CONFIG_HAVE_MEMBLOCK
In reply to Mike RapoportAll architecures use memblock for early memory management. There is no need for the CONFIG_HAVE_MEMBLOCK configuration option.
--- arch/alpha/Kconfig | 1 - arch/arc/Kconfig | 1 - arch/arm/Kconfig | 1 - arch/arm64/Kconfig | 1 - arch/c6x/Kconfig | 1 - arch/h8300/Kconfig | 1 - arch/hexagon/Kconfig | 1 - arch/ia64/Kconfig | 1 - arch/m68k/Kconfig | 1 - arch/microblaze/Kconfig | 1 - arch/mips/Kconfig | 1 - arch/nds32/Kconfig | 1 - arch/nios2/Kconfig | 1 - arch/openrisc/Kconfig | 1 - arch/parisc/Kconfig | 1 - arch/powerpc/Kconfig | 1 - arch/riscv/Kconfig | 1 - arch/s390/Kconfig | 1 - arch/sh/Kconfig | 1 - arch/sparc/Kconfig | 1 - arch/um/Kconfig | 1 - arch/unicore32/Kconfig | 1 - arch/x86/Kconfig | 1 - arch/xtensa/Kconfig | 1 - drivers/of/fdt.c | 2 - drivers/of/of_reserved_mem.c | 13 +---- drivers/staging/android/ion/Kconfig | 2 +- fs/pstore/Kconfig | 1 - include/linux/bootmem.h | 112 ------------------------------------ include/linux/memblock.h | 2 - include/linux/mm.h | 2 +- lib/Kconfig.debug | 3 +- mm/Kconfig | 5 +- mm/Makefile | 2 +- mm/nobootmem.c | 4 -- mm/page_alloc.c | 4 +- 36 files changed, 8 insertions(+), 168 deletions(-)
arch/alpha/Kconfig +0 -1
@@ -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,
arch/arc/Kconfig +0 -1
@@ -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
arch/arm/Kconfig +0 -1
@@ -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)
arch/arm64/Kconfig +0 -1
@@ -134,7 +134,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
arch/c6x/Kconfig +0 -1
@@ -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
arch/h8300/Kconfig +0 -1
@@ -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
arch/hexagon/Kconfig +0 -1
@@ -31,7 +31,6 @@ config HEXAGON select GENERIC_CLOCKEVENTS_BROADCAST select MODULES_USE_ELF_RELA select GENERIC_CPU_DEVICES - select HAVE_MEMBLOCK select ARCH_DISCARD_MEMBLOCK ---help--- Qualcomm Hexagon is a processor architecture designed for high
arch/ia64/Kconfig +0 -1
@@ -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
arch/m68k/Kconfig +0 -1
@@ -27,7 +27,6 @@ config M68K select OLD_SIGSUSPEND3 select OLD_SIGACTION select DMA_NONCOHERENT_OPS if HAS_DMA - select HAVE_MEMBLOCK select ARCH_DISCARD_MEMBLOCK config CPU_BIG_ENDIAN
arch/microblaze/Kconfig +0 -1
@@ -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
arch/mips/Kconfig +0 -1
@@ -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
arch/nds32/Kconfig +0 -1
@@ -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
arch/nios2/Kconfig +0 -1
@@ -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
arch/openrisc/Kconfig +0 -1
@@ -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
arch/parisc/Kconfig +0 -1
@@ -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
arch/powerpc/Kconfig +0 -1
@@ -203,7 +203,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)
arch/riscv/Kconfig +0 -1
@@ -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_GENERIC_DMA_COHERENT
arch/s390/Kconfig +0 -1
@@ -154,7 +154,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
arch/sh/Kconfig +0 -1
@@ -8,7 +8,6 @@ config SUPERH select HAVE_PATA_PLATFORM select CLKDEV_LOOKUP select HAVE_IDE if HAS_IOPORT_MAP - select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP select ARCH_DISCARD_MEMBLOCK select HAVE_OPROFILE
arch/sparc/Kconfig +0 -1
@@ -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
arch/um/Kconfig +0 -1
@@ -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
arch/unicore32/Kconfig +0 -1
@@ -4,7 +4,6 @@ config UNICORE32 select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO - select HAVE_MEMBLOCK select HAVE_GENERIC_DMA_COHERENT select HAVE_KERNEL_GZIP select HAVE_KERNEL_BZIP2
arch/x86/Kconfig +0 -1
@@ -167,7 +167,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
arch/xtensa/Kconfig +0 -1
@@ -27,7 +27,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
drivers/of/fdt.c +0 -2
@@ -1115,13 +1115,11 @@ 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 #ifndef MAX_MEMBLOCK_ADDR #define MAX_MEMBLOCK_ADDR ((phys_addr_t)~0) -#endif void __init __weak early_init_dt_add_memory_arch (u64 base,u64 size) {
drivers/of/of_reserved_mem.c +1 -12
@@ -20,13 +20,12 @@#include <linux/of_reserved_mem.h> #include <linux/sort.h> #include <linux/slab.h> +#include <linux/memblock.h> #define MAX_RESERVED_REGIONS 32static 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
drivers/staging/android/ion/Kconfig +1 -1
@@ -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
fs/pstore/Kconfig +0 -1
@@ -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
include/linux/bootmem.h +0 -112
124 lines not on this page · raw message
include/linux/memblock.h +0 -2
@@ -2,7 +2,6 @@#define _LINUX_MEMBLOCK_H#ifdef __KERNEL__ -#ifdef CONFIG_HAVE_MEMBLOCK /* * Logical memory blocks. *
@@ -460,7 +459,6 @@ static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) {return 0 ; } -#endif /* CONFIG_HAVE_MEMBLOCK */ #endif /* __KERNEL__ */
include/linux/mm.h +1 -1
@@ -2143,7 +2143,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 ) {}
lib/Kconfig.debug +1 -2
@@ -1311,7 +1311,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"
@@ -1988,7 +1988,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.
mm/Kconfig +1 -4
@@ -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
@@ -481,7 +478,7 @@ config FRONTSWAP config CMA bool "Contiguous Memory Allocator" - depends on HAVE_MEMBLOCK && MMU + depends on MMU select MIGRATION select MEMORY_ISOLATION help
mm/Makefile +1 -1
@@ -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
mm/nobootmem.c +0 -4
@@ -23,10 +23,6 @@#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);
mm/page_alloc.c +2 -2
@@ -6432,7 +6432,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 )/* * Only struct pages that are backed by physical memory are zeroed and * initialized by going through __init_single_page(). But, there are some
@@ -6473,7 +6473,7 @@ void __init zero_resv_unavail(void)if (pgcnt) pr_info("Reserved but unavailable: %lld pages", pgcnt); } -#endif /* CONFIG_HAVE_MEMBLOCK && !CONFIG_FLAT_NODE_MEM_MAP */ +#endif /* !CONFIG_FLAT_NODE_MEM_MAP */ #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
Signature · 1 line
2.7.4
PATCH 4/30 mm: remove bootmem allocator implementation.
In reply to Mike RapoportAll architectures have been converted to use MEMBLOCK + NO_BOOTMEM. The bootmem allocator implementation can be removed.
--- include/linux/bootmem.h | 16 - mm/bootmem.c | 811 ------------------------------------------------ 2 files changed, 827 deletions(-) delete mode 100644 mm/bootmem.c
include/linux/bootmem.h +0 -16
@@ -26,14 +26,6 @@ extern unsigned long max_pfn;*/ extern unsigned long long max_possible_pfn; -extern unsigned long bootmem_bootmap_pages (unsigned long ); - -extern unsigned long init_bootmem_node (pg_data_t *pgdat, -unsigned long freepfn, -unsigned long startpfn, -unsigned long endpfn); -extern unsigned long init_bootmem (unsigned long addr,unsigned long memend); -extern unsigned long free_all_bootmem (void );extern void reset_node_managed_pages (pg_data_t *pgdat);extern void reset_all_zones_managed_pages (void );
@@ -55,14 +47,6 @@ extern void free_bootmem_late(unsigned long physaddr, unsigned long size);#define BOOTMEM_DEFAULT 0#define BOOTMEM_EXCLUSIVE (1<<0) -extern int reserve_bootmem (unsigned long addr, -unsigned long size, -int flags); -extern int reserve_bootmem_node (pg_data_t *pgdat, -unsigned long physaddr, -unsigned long size, -int flags); -extern void *__alloc_bootmem (unsigned long size,unsigned long align,unsigned long goal);
mm/bootmem.c deleted +0 -811
811 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 5/30 mm: nobootmem: remove dead code
In reply to Mike RapoportSeveral bootmem functions and macros are not used. Remove them.
--- include/linux/bootmem.h | 26 -------------------------- mm/nobootmem.c | 35 ----------------------------------- 2 files changed, 61 deletions(-)
include/linux/bootmem.h +0 -26
@@ -36,17 +36,6 @@ extern void free_bootmem_node(pg_data_t *pgdat,extern void free_bootmem (unsigned long physaddr,unsigned long size);extern void free_bootmem_late (unsigned long physaddr,unsigned long size); -/* -* Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, -* the architecture-specific code should honor this). -* -* If flags is BOOTMEM_DEFAULT, then the return value is always 0 (success). -* If flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the memory -* already was reserved. -*/ -#define BOOTMEM_DEFAULT 0 -#define BOOTMEM_EXCLUSIVE (1<<0) -extern void *__alloc_bootmem (unsigned long size,unsigned long align,unsigned long goal);
@@ -73,13 +62,6 @@ void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat,extern void *__alloc_bootmem_low (unsigned long size,unsigned long align,unsigned long goal) __malloc; -void *__alloc_bootmem_low_nopanic (unsigned long size, -unsigned long align, -unsigned long goal) __malloc; -extern void *__alloc_bootmem_low_node (pg_data_t *pgdat, -unsigned long size, -unsigned long align, -unsigned long goal) __malloc;/* We are using top down, so it is safe to use 0 here */ #define BOOTMEM_LOW_LIMIT 0
@@ -92,8 +74,6 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)#define alloc_bootmem_align (x, align) \ __alloc_bootmem(x, align, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_nopanic (x) \ - __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)#define alloc_bootmem_pages (x) \ __alloc_bootmem(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)#define alloc_bootmem_pages_nopanic (x) \
@@ -104,17 +84,11 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)#define alloc_bootmem_pages_node (pgdat, x) \ __alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_pages_node_nopanic (pgdat, x) \ - __alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)#define alloc_bootmem_low (x) \ __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) -#define alloc_bootmem_low_pages_nopanic (x) \ - __alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0)#define alloc_bootmem_low_pages (x) \ __alloc_bootmem_low(x, PAGE_SIZE, 0) -#define alloc_bootmem_low_pages_node (pgdat, x) \ - __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)/* FIXME: use MEMBLOCK_ALLOC_* variants here */ #define BOOTMEM_ALLOC_ACCESSIBLE 0
mm/nobootmem.c +0 -35
@@ -404,38 +404,3 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, {return ___alloc_bootmem (size, align, goal,ARCH_LOW_ADDRESS_LIMIT ); } - -void *__init __alloc_bootmem_low_nopanic (unsigned long size, -unsigned long align, -unsigned long goal) -{ -return ___alloc_bootmem_nopanic (size, align, goal, -ARCH_LOW_ADDRESS_LIMIT ); -} - -/** -* __alloc_bootmem_low_node - allocate low boot memory from a specific node -* @pgdat: node to allocate from -* @size: size of the request in bytes -* @align: alignment of the region -* @goal: preferred starting address of the region -* -* The goal is dropped if it can not be satisfied and the allocation will -* fall back to memory below @goal. -* -* Allocation may fall back to any node in the system if the specified node -* can not hold the requested memory. -* -* The function panics if the request can not be satisfied. -* -* Return: address of the allocated region. -*/ -void *__init __alloc_bootmem_low_node (pg_data_t *pgdat,unsigned long size, -unsigned long align,unsigned long goal) -{ -if (WARN_ON_ONCE (slab_is_available ())) -return kzalloc_node (size,GFP_NOWAIT , pgdat->node_id); - -return ___alloc_bootmem_node (pgdat, size, align, goal, -ARCH_LOW_ADDRESS_LIMIT ); -}
Signature · 1 line
2.7.4
PATCH 6/30 memblock: rename memblock_alloc{_nid,_try_nid} to memblock_phys_alloc*
In reply to Mike RapoportMake it explicit that the caller gets a physical address rather than a virtual one.
This will also allow using meblock_alloc prefix for memblock allocations returning virtual address, which is done in the following patches.
The conversion is done using the following semantic patch:
@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- arch/arm/mm/mmu.c | 2 +- arch/arm64/mm/mmu.c | 2 +- arch/arm64/mm/numa.c | 2 +- arch/c6x/mm/dma-coherent.c | 4 ++-- arch/nds32/mm/init.c | 8 ++++---- arch/openrisc/mm/init.c | 2 +- arch/openrisc/mm/ioremap.c | 2 +- arch/powerpc/kernel/dt_cpu_ftrs.c | 4 +--- arch/powerpc/kernel/paca.c | 2 +- arch/powerpc/kernel/prom.c | 2 +- arch/powerpc/kernel/setup-common.c | 3 +-- arch/powerpc/kernel/setup_32.c | 10 +++++----- arch/powerpc/mm/numa.c | 2 +- arch/powerpc/mm/pgtable_32.c | 2 +- arch/powerpc/mm/ppc_mmu_32.c | 2 +- arch/powerpc/platforms/pasemi/iommu.c | 2 +- arch/powerpc/platforms/powernv/opal.c | 2 +- arch/powerpc/sysdev/dart_iommu.c | 2 +- arch/s390/kernel/crash_dump.c | 2 +- arch/s390/kernel/setup.c | 3 ++- arch/s390/mm/vmem.c | 4 ++-- arch/s390/numa/numa.c | 2 +- arch/sparc/kernel/mdesc.c | 2 +- arch/sparc/kernel/prom_64.c | 2 +- arch/sparc/mm/init_64.c | 11 ++++++----- arch/unicore32/mm/mmu.c | 2 +- arch/x86/mm/numa.c | 2 +- drivers/firmware/efi/memmap.c | 2 +- include/linux/memblock.h | 6 +++--- mm/memblock.c | 8 ++++---- 30 files changed, 50 insertions(+), 51 deletions(-)
arch/arm/mm/mmu.c +1 -1
@@ -721,7 +721,7 @@ EXPORT_SYMBOL(phys_mem_access_prot);static void __init *early_alloc_aligned (unsigned long sz,unsigned long align) { -void *ptr =__va (memblock_alloc (sz, align)); +void *ptr =__va (memblock_phys_alloc (sz, align));memset (ptr,0 , sz);return ptr; }
arch/arm64/mm/mmu.c +1 -1
@@ -83,7 +83,7 @@ static phys_addr_t __init early_pgtable_alloc(void)phys_addr_t phys;void *ptr; - phys =memblock_alloc (PAGE_SIZE ,PAGE_SIZE ); + phys =memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE );/* * The FIX_{PGD,PUD,PMD} slots may be in active use, but the FIX_PTE
arch/arm64/mm/numa.c +1 -1
@@ -237,7 +237,7 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)if (start_pfn >= end_pfn)pr_info ("Initmem setup node %d [<memory-less node>]\n" , nid); - nd_pa =memblock_alloc_try_nid (nd_size,SMP_CACHE_BYTES , nid); + nd_pa =memblock_phys_alloc_try_nid (nd_size,SMP_CACHE_BYTES , nid); nd =__va (nd_pa);/* report and initialize */
arch/c6x/mm/dma-coherent.c +2 -2
@@ -135,8 +135,8 @@ void __init coherent_mem_init(phys_addr_t start, u32 size)if (dma_size & (PAGE_SIZE -1 )) ++dma_pages; - bitmap_phys =memblock_alloc (BITS_TO_LONGS (dma_pages) *sizeof (long ), -sizeof (long )); + bitmap_phys =memblock_phys_alloc (BITS_TO_LONGS (dma_pages) *sizeof (long ), +sizeof (long )); dma_bitmap =phys_to_virt (bitmap_phys);memset (dma_bitmap,0 , dma_pages *PAGE_SIZE );
arch/nds32/mm/init.c +4 -4
@@ -81,7 +81,7 @@ static void __init map_ram(void) }/* Alloc one page for holding PTE's... */ - pte = (pte_t *)__va (memblock_alloc (PAGE_SIZE ,PAGE_SIZE )); + pte = (pte_t *)__va (memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE ));memset (pte,0 ,PAGE_SIZE );set_pmd (pme,__pmd (__pa (pte) + _PAGE_KERNEL_TABLE));
@@ -114,7 +114,7 @@ static void __init fixedrange_init(void) pgd = swapper_pg_dir +pgd_index (vaddr); pud =pud_offset (pgd, vaddr); pmd =pmd_offset (pud, vaddr); - fixmap_pmd_p = (pmd_t *)__va (memblock_alloc (PAGE_SIZE ,PAGE_SIZE )); + fixmap_pmd_p = (pmd_t *)__va (memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE ));memset (fixmap_pmd_p,0 ,PAGE_SIZE );set_pmd (pmd,__pmd (__pa (fixmap_pmd_p) + _PAGE_KERNEL_TABLE));
@@ -127,7 +127,7 @@ static void __init fixedrange_init(void) pgd = swapper_pg_dir +pgd_index (vaddr); pud =pud_offset (pgd, vaddr); pmd =pmd_offset (pud, vaddr); - pte = (pte_t *)__va (memblock_alloc (PAGE_SIZE ,PAGE_SIZE )); + pte = (pte_t *)__va (memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE ));memset (pte,0 ,PAGE_SIZE );set_pmd (pmd,__pmd (__pa (pte) + _PAGE_KERNEL_TABLE)); pkmap_page_table = pte;
@@ -153,7 +153,7 @@ void __init paging_init(void)fixedrange_init ();/* allocate space for empty_zero_page */ - zero_page =__va (memblock_alloc (PAGE_SIZE ,PAGE_SIZE )); + zero_page =__va (memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE ));memset (zero_page,0 ,PAGE_SIZE );zone_sizes_init ();
arch/openrisc/mm/init.c +1 -1
@@ -106,7 +106,7 @@ static void __init map_ram(void) }/* Alloc one page for holding PTE's... */ - pte = (pte_t *)__va (memblock_alloc (PAGE_SIZE ,PAGE_SIZE )); + pte = (pte_t *)__va (memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE ));set_pmd (pme,__pmd (_KERNPG_TABLE +__pa (pte)));/* Fill the newly allocated page with PTE'S */
arch/openrisc/mm/ioremap.c +1 -1
@@ -126,7 +126,7 @@ pte_t __ref *pte_alloc_one_kernel(struct mm_struct *mm,if (likely (mem_init_done)) { pte = (pte_t *)__get_free_page (GFP_KERNEL ); }else { - pte = (pte_t *)__va (memblock_alloc (PAGE_SIZE ,PAGE_SIZE )); + pte = (pte_t *)__va (memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE )); }if (pte)
arch/powerpc/kernel/dt_cpu_ftrs.c +1 -3
@@ -1008,9 +1008,7 @@ static int __init dt_cpu_ftrs_scan_callback(unsigned long node, const char/* Count and allocate space for cpu features */ of_scan_flat_dt_subnodes (node, count_cpufeatures_subnodes, &nr_dt_cpu_features); - dt_cpu_features =__va ( -memblock_alloc (sizeof (struct dt_cpu_feature )* - nr_dt_cpu_features,PAGE_SIZE )); + dt_cpu_features =__va (memblock_phys_alloc (sizeof (struct dt_cpu_feature ) * nr_dt_cpu_features,PAGE_SIZE ));cpufeatures_setup_start (isa);
arch/powerpc/kernel/paca.c +1 -1
@@ -198,7 +198,7 @@ void __init allocate_paca_ptrs(void) paca_nr_cpu_ids = nr_cpu_ids; paca_ptrs_size =sizeof (struct paca_struct *) * nr_cpu_ids; - paca_ptrs =__va (memblock_alloc (paca_ptrs_size,0 )); + paca_ptrs =__va (memblock_phys_alloc (paca_ptrs_size,0 ));memset (paca_ptrs,0x88 , paca_ptrs_size); }
arch/powerpc/kernel/prom.c +1 -1
@@ -126,7 +126,7 @@ static void __init move_device_tree(void)if ((memory_limit && (start + size) >PHYSICAL_START + memory_limit) ||overlaps_crashkernel (start, size) ||overlaps_initrd (start, size)) { - p =__va (memblock_alloc (size,PAGE_SIZE )); + p =__va (memblock_phys_alloc (size,PAGE_SIZE ));memcpy (p, initial_boot_params, size); initial_boot_params = p;DBG ("Moved device tree to 0x%p\n" , p);
arch/powerpc/kernel/setup-common.c +1 -2
@@ -459,8 +459,7 @@ void __init smp_setup_cpu_maps(void)DBG ("smp_setup_cpu_maps()\n" ); - cpu_to_phys_id =__va (memblock_alloc (nr_cpu_ids *sizeof (u32), - __alignof__(u32 ))); + cpu_to_phys_id =__va (memblock_phys_alloc (nr_cpu_ids *sizeof (u32), __alignof__(u32 )));memset (cpu_to_phys_id,0 , nr_cpu_ids *sizeof (u32));for_each_node_by_type (dn,"cpu" ) {
arch/powerpc/kernel/setup_32.c +5 -5
@@ -206,9 +206,9 @@ void __init irqstack_early_init(void)* as the memblock is limited to lowmem by default */ for_each_possible_cpu (i) { softirq_ctx[i] = (struct thread_info *) -__va (memblock_alloc (THREAD_SIZE ,THREAD_SIZE )); +__va (memblock_phys_alloc (THREAD_SIZE ,THREAD_SIZE )); hardirq_ctx[i] = (struct thread_info *) -__va (memblock_alloc (THREAD_SIZE ,THREAD_SIZE )); +__va (memblock_phys_alloc (THREAD_SIZE ,THREAD_SIZE )); } }
@@ -227,12 +227,12 @@ void __init exc_lvl_early_init(void)#endif critirq_ctx[hw_cpu] = (struct thread_info *) -__va (memblock_alloc (THREAD_SIZE ,THREAD_SIZE )); +__va (memblock_phys_alloc (THREAD_SIZE ,THREAD_SIZE ));#ifdef CONFIG_BOOKE dbgirq_ctx[hw_cpu] = (struct thread_info *) -__va (memblock_alloc (THREAD_SIZE ,THREAD_SIZE )); +__va (memblock_phys_alloc (THREAD_SIZE ,THREAD_SIZE )); mcheckirq_ctx[hw_cpu] = (struct thread_info *) -__va (memblock_alloc (THREAD_SIZE ,THREAD_SIZE )); +__va (memblock_phys_alloc (THREAD_SIZE ,THREAD_SIZE ));#endif } }
arch/powerpc/mm/numa.c +1 -1
@@ -788,7 +788,7 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)void *nd;int tnid; - nd_pa =memblock_alloc_try_nid (nd_size,SMP_CACHE_BYTES , nid); + nd_pa =memblock_phys_alloc_try_nid (nd_size,SMP_CACHE_BYTES , nid); nd =__va (nd_pa);/* report and initialize */
arch/powerpc/mm/pgtable_32.c +1 -1
@@ -50,7 +50,7 @@ __ref pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)if (slab_is_available ()) { pte = (pte_t *)__get_free_page (GFP_KERNEL |__GFP_ZERO); }else { - pte =__va (memblock_alloc (PAGE_SIZE ,PAGE_SIZE )); + pte =__va (memblock_phys_alloc (PAGE_SIZE ,PAGE_SIZE ));if (pte)clear_page (pte); }
arch/powerpc/mm/ppc_mmu_32.c +1 -1
@@ -224,7 +224,7 @@ void __init MMU_init_hw(void)* Find some memory for the hash table. */ if ( ppc_md.progress ) ppc_md.progress ("hash:find piece" ,0x322 ); - Hash =__va (memblock_alloc (Hash_size, Hash_size)); + Hash =__va (memblock_phys_alloc (Hash_size, Hash_size));memset (Hash,0 , Hash_size); _SDR1 =__pa (Hash) |SDR1_LOW_BITS ;
arch/powerpc/platforms/pasemi/iommu.c +1 -1
@@ -213,7 +213,7 @@ static int __init iob_init(struct device_node *dn)pr_info ("IOBMAP L2 allocated at: %p\n" , iob_l2_base);/* Allocate a spare page to map all invalid IOTLB pages. */ - tmp =memblock_alloc (IOBMAP_PAGE_SIZE ,IOBMAP_PAGE_SIZE ); + tmp =memblock_phys_alloc (IOBMAP_PAGE_SIZE ,IOBMAP_PAGE_SIZE );if (!tmp)panic ("IOBMAP: Cannot allocate spare page!" );/* Empty l1 is marked invalid */
arch/powerpc/platforms/powernv/opal.c +1 -1
@@ -171,7 +171,7 @@ int __init early_init_dt_scan_recoverable_ranges(unsigned long node,/* * Allocate a buffer to hold the MC recoverable ranges. */ - mc_recoverable_range =__va (memblock_alloc (size, __alignof__(u64 ))); + mc_recoverable_range =__va (memblock_phys_alloc (size, __alignof__(u64 )));memset (mc_recoverable_range,0 , size);for (i =0 ; i < mc_recoverable_range_len; i++) {
arch/powerpc/sysdev/dart_iommu.c +1 -1
@@ -261,7 +261,7 @@ static void allocate_dart(void)* that to work around what looks like a problem with the HT bridge * prefetching into invalid pages and corrupting data */ - tmp =memblock_alloc (DART_PAGE_SIZE ,DART_PAGE_SIZE ); + tmp =memblock_phys_alloc (DART_PAGE_SIZE ,DART_PAGE_SIZE ); dart_emptyval =DARTMAP_VALID | ((tmp >>DART_PAGE_SHIFT ) &DARTMAP_RPNMASK );
arch/s390/kernel/crash_dump.c +1 -1
@@ -61,7 +61,7 @@ struct save_area * __init save_area_alloc(bool is_boot_cpu) {struct save_area *sa; - sa = (void *)memblock_alloc (sizeof (*sa),8 ); + sa = (void *)memblock_phys_alloc (sizeof (*sa),8 );if (is_boot_cpu)list_add (&sa->list, &dump_save_areas);else
arch/s390/kernel/setup.c +2 -1
@@ -843,7 +843,8 @@ static void __init setup_randomness(void) {struct sysinfo_3_2_2 *vmms; - vmms = (struct sysinfo_3_2_2 *)memblock_alloc (PAGE_SIZE ,PAGE_SIZE ); + vmms = (struct sysinfo_3_2_2 *)memblock_phys_alloc (PAGE_SIZE , +PAGE_SIZE );if (stsi (vmms,3 ,2 ,2 ) ==0 && vmms->count)add_device_randomness (&vmms->vm,sizeof (vmms->vm[0 ]) * vmms->count);memblock_free ((unsigned long ) vmms,PAGE_SIZE );
arch/s390/mm/vmem.c +2 -2
@@ -36,7 +36,7 @@ static void __ref *vmem_alloc_pages(unsigned int order)if (slab_is_available ())return (void *)__get_free_pages (GFP_KERNEL , order); -return (void *)memblock_alloc (size, size); +return (void *)memblock_phys_alloc (size, size); }void *vmem_crst_alloc (unsigned long val)
@@ -57,7 +57,7 @@ pte_t __ref *vmem_pte_alloc(void)if (slab_is_available ()) pte = (pte_t *)page_table_alloc (&init_mm);else - pte = (pte_t *)memblock_alloc (size, size); + pte = (pte_t *)memblock_phys_alloc (size, size);if (!pte)return NULL ;memset64 ((u64 *)pte, _PAGE_INVALID,PTRS_PER_PTE );
arch/s390/numa/numa.c +1 -1
@@ -64,7 +64,7 @@ static __init pg_data_t *alloc_node_data(void) {pg_data_t *res; - res = (pg_data_t *)memblock_alloc (sizeof (pg_data_t),8 ); + res = (pg_data_t *)memblock_phys_alloc (sizeof (pg_data_t),8 );memset (res,0 ,sizeof (pg_data_t));return res; }
arch/sparc/kernel/mdesc.c +1 -1
@@ -170,7 +170,7 @@ static struct mdesc_handle * __init mdesc_memblock_alloc(unsigned int mdesc_size mdesc_size); alloc_size =PAGE_ALIGN (handle_size); - paddr =memblock_alloc (alloc_size,PAGE_SIZE ); + paddr =memblock_phys_alloc (alloc_size,PAGE_SIZE ); hp =NULL ;if (paddr) {
arch/sparc/kernel/prom_64.c +1 -1
@@ -34,7 +34,7 @@void *__init prom_early_alloc (unsigned long size) { -unsigned long paddr =memblock_alloc (size,SMP_CACHE_BYTES ); +unsigned long paddr =memblock_phys_alloc (size,SMP_CACHE_BYTES );void *ret;if (!paddr) {
arch/sparc/mm/init_64.c +6 -5
@@ -1092,7 +1092,8 @@ static void __init allocate_node_data(int nid)#ifdef CONFIG_NEED_MULTIPLE_NODES unsigned long paddr; - paddr =memblock_alloc_try_nid (sizeof (struct pglist_data ),SMP_CACHE_BYTES , nid); + paddr =memblock_phys_alloc_try_nid (sizeof (struct pglist_data ), +SMP_CACHE_BYTES , nid);if (!paddr) {prom_printf ("Cannot allocate pglist_data for nid[%d]\n" , nid);prom_halt ();
@@ -1266,8 +1267,8 @@ static int __init grab_mlgroups(struct mdesc_handle *md)if (!count)return -ENOENT ; - paddr =memblock_alloc (count *sizeof (struct mdesc_mlgroup ), -SMP_CACHE_BYTES ); + paddr =memblock_phys_alloc (count *sizeof (struct mdesc_mlgroup ), +SMP_CACHE_BYTES );if (!paddr)return -ENOMEM ;
@@ -1307,8 +1308,8 @@ static int __init grab_mblocks(struct mdesc_handle *md)if (!count)return -ENOENT ; - paddr =memblock_alloc (count *sizeof (struct mdesc_mblock ), -SMP_CACHE_BYTES ); + paddr =memblock_phys_alloc (count *sizeof (struct mdesc_mblock ), +SMP_CACHE_BYTES );if (!paddr)return -ENOMEM ;
arch/unicore32/mm/mmu.c +1 -1
@@ -144,7 +144,7 @@ static void __init build_mem_type_table(void)static void __init *early_alloc (unsigned long sz) { -void *ptr =__va (memblock_alloc (sz, sz)); +void *ptr =__va (memblock_phys_alloc (sz, sz));memset (ptr,0 , sz);return ptr; }
arch/x86/mm/numa.c +1 -1
@@ -196,7 +196,7 @@ static void __init alloc_node_data(int nid)* Allocate node data. Try node-local memory and then any node. * Never allocate in DMA zone. */ - nd_pa =memblock_alloc_nid (nd_size,SMP_CACHE_BYTES , nid); + nd_pa =memblock_phys_alloc_nid (nd_size,SMP_CACHE_BYTES , nid);if (!nd_pa) { nd_pa =__memblock_alloc_base (nd_size,SMP_CACHE_BYTES ,MEMBLOCK_ALLOC_ACCESSIBLE );
drivers/firmware/efi/memmap.c +1 -1
@@ -15,7 +15,7 @@static phys_addr_t __init __efi_memmap_alloc_early (unsigned long size) { -return memblock_alloc (size,0 ); +return memblock_phys_alloc (size,0 ); }static phys_addr_t __init __efi_memmap_alloc_late (unsigned long size)
include/linux/memblock.h +3 -3
@@ -315,10 +315,10 @@ static inline int memblock_get_region_node(const struct memblock_region *r) }#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ -phys_addr_t memblock_alloc_nid (phys_addr_t size,phys_addr_t align,int nid); -phys_addr_t memblock_alloc_try_nid (phys_addr_t size,phys_addr_t align,int nid); +phys_addr_t memblock_phys_alloc_nid (phys_addr_t size,phys_addr_t align,int nid); +phys_addr_t memblock_phys_alloc_try_nid (phys_addr_t size,phys_addr_t align,int nid); -phys_addr_t memblock_alloc (phys_addr_t size,phys_addr_t align); +phys_addr_t memblock_phys_alloc (phys_addr_t size,phys_addr_t align);/* * Set the allocation direction to bottom-up or top-down.
mm/memblock.c +4 -4
@@ -1320,7 +1320,7 @@ phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,return memblock_alloc_range_nid (size, align,0 , max_addr, nid, flags); } -phys_addr_t __init memblock_alloc_nid (phys_addr_t size,phys_addr_t align,int nid) +phys_addr_t __init memblock_phys_alloc_nid (phys_addr_t size,phys_addr_t align,int nid) {enum memblock_flags flags =choose_memblock_flags ();phys_addr_t ret;
@@ -1355,14 +1355,14 @@ phys_addr_t __init memblock_alloc_base(phys_addr_t size, phys_addr_t align, physreturn alloc; } -phys_addr_t __init memblock_alloc (phys_addr_t size,phys_addr_t align) +phys_addr_t __init memblock_phys_alloc (phys_addr_t size,phys_addr_t align) {return memblock_alloc_base (size, align,MEMBLOCK_ALLOC_ACCESSIBLE ); } -phys_addr_t __init memblock_alloc_try_nid (phys_addr_t size,phys_addr_t align,int nid) +phys_addr_t __init memblock_phys_alloc_try_nid (phys_addr_t size,phys_addr_t align,int nid) { -phys_addr_t res =memblock_alloc_nid (size, align, nid); +phys_addr_t res =memblock_phys_alloc_nid (size, align, nid);if (res)return res;
Signature · 1 line
2.7.4
PATCH 7/30 memblock: remove _virt from APIs returning virtual address
In reply to Mike RapoportThe conversion is done using
sed -i 's@memblock_virt_alloc@memblock_alloc@g' \ $(git grep -l memblock_virt_alloc)
--- arch/arm/kernel/setup.c | 4 ++-- arch/arm/mach-omap2/omap_hwmod.c | 6 ++--- arch/arm64/mm/kasan_init.c | 2 +- arch/arm64/mm/numa.c | 2 +- arch/mips/kernel/setup.c | 2 +- arch/powerpc/kernel/pci_32.c | 2 +- arch/powerpc/lib/alloc.c | 2 +- arch/powerpc/mm/mmu_context_nohash.c | 6 ++--- arch/powerpc/platforms/powermac/nvram.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 6 ++--- arch/powerpc/platforms/ps3/setup.c | 2 +- arch/powerpc/sysdev/msi_bitmap.c | 2 +- arch/s390/kernel/setup.c | 12 +++++----- arch/s390/kernel/smp.c | 2 +- arch/s390/kernel/topology.c | 4 ++-- arch/s390/numa/mode_emu.c | 2 +- arch/s390/numa/toptree.c | 2 +- arch/x86/mm/kasan_init_64.c | 4 ++-- arch/xtensa/mm/kasan_init.c | 2 +- drivers/clk/ti/clk.c | 2 +- drivers/firmware/memmap.c | 2 +- drivers/of/fdt.c | 2 +- drivers/of/unittest.c | 2 +- include/linux/bootmem.h | 38 +++++++++++++++---------------- init/main.c | 6 ++--- kernel/dma/swiotlb.c | 8 +++---- kernel/power/snapshot.c | 2 +- kernel/printk/printk.c | 4 ++-- lib/cpumask.c | 2 +- mm/hugetlb.c | 2 +- mm/kasan/kasan_init.c | 2 +- mm/memblock.c | 26 ++++++++++----------- mm/page_alloc.c | 8 +++---- mm/page_ext.c | 2 +- mm/percpu.c | 28 +++++++++++------------ mm/sparse-vmemmap.c | 2 +- mm/sparse.c | 12 +++++----- 37 files changed, 108 insertions(+), 108 deletions(-)
arch/arm/kernel/setup.c +2 -2
@@ -857,7 +857,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)*/ boot_alias_start =phys_to_idmap (start);if (arm_has_idmap_alias () && boot_alias_start !=IDMAP_INVALID_ADDR ) { - res =memblock_virt_alloc (sizeof (*res),0 ); + res =memblock_alloc (sizeof (*res),0 ); res->name ="System RAM (boot alias)" ; res->start = boot_alias_start; res->end =phys_to_idmap (end);
@@ -865,7 +865,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)request_resource (&iomem_resource, res); } - res =memblock_virt_alloc (sizeof (*res),0 ); + res =memblock_alloc (sizeof (*res),0 ); res->name ="System RAM" ; res->start = start; res->end = end;
arch/arm/mach-omap2/omap_hwmod.c +3 -3
@@ -726,7 +726,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np)u64 size;int i; - provider =memblock_virt_alloc (sizeof (*provider),0 ); + provider =memblock_alloc (sizeof (*provider),0 );if (!provider)return -ENOMEM ;
@@ -736,12 +736,12 @@ static int __init _setup_clkctrl_provider(struct device_node *np)of_property_count_elems_of_size (np,"reg" ,sizeof (u32)) /2 ; provider->addr = -memblock_virt_alloc (sizeof (void *) * provider->num_addrs,0 ); +memblock_alloc (sizeof (void *) * provider->num_addrs,0 );if (!provider->addr)return -ENOMEM ; provider->size = -memblock_virt_alloc (sizeof (u32) * provider->num_addrs,0 ); +memblock_alloc (sizeof (u32) * provider->num_addrs,0 );if (!provider->size)return -ENOMEM ;
arch/arm64/mm/kasan_init.c +1 -1
@@ -38,7 +38,7 @@ static pgd_t tmp_pg_dir[PTRS_PER_PGD] __initdata __aligned(PGD_SIZE);static phys_addr_t __init kasan_alloc_zeroed_page (int node) { -void *p =memblock_virt_alloc_try_nid (PAGE_SIZE ,PAGE_SIZE , +void *p =memblock_alloc_try_nid (PAGE_SIZE ,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ),MEMBLOCK_ALLOC_ACCESSIBLE , node);return __pa (p);
arch/arm64/mm/numa.c +1 -1
@@ -168,7 +168,7 @@ static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, {int nid =early_cpu_to_node (cpu); -return memblock_virt_alloc_try_nid (size, align, +return memblock_alloc_try_nid (size, align,__pa (MAX_DMA_ADDRESS ),MEMBLOCK_ALLOC_ACCESSIBLE , nid); }
arch/mips/kernel/setup.c +1 -1
@@ -851,7 +851,7 @@ static void __init arch_mem_init(char **cmdline_p)* Prevent memblock from allocating high memory. * This cannot be done before max_low_pfn is detected, so up * to this point is possible to only reserve physical memory -* with memblock_reserve; memblock_virt_alloc* can be used +* with memblock_reserve; memblock_alloc* can be used * only after this point */ memblock_set_current_limit (PFN_PHYS (max_low_pfn));
arch/powerpc/kernel/pci_32.c +1 -1
@@ -204,7 +204,7 @@ pci_create_OF_bus_map(void)struct property * of_prop;struct device_node *dn; - of_prop =memblock_virt_alloc (sizeof (struct property ) +256 ,0 ); + of_prop =memblock_alloc (sizeof (struct property ) +256 ,0 ); dn =of_find_node_by_path ("/" );if (dn) {memset (of_prop,-1 ,sizeof (struct property ) +256 );
arch/powerpc/lib/alloc.c +1 -1
@@ -14,7 +14,7 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)if (slab_is_available ()) p =kzalloc (size, mask);else { - p =memblock_virt_alloc (size,0 ); + p =memblock_alloc (size,0 ); }return p; }
arch/powerpc/mm/mmu_context_nohash.c +3 -3
@@ -461,10 +461,10 @@ void __init mmu_context_init(void)/* * Allocate the maps used by context management */ - context_map =memblock_virt_alloc (CTX_MAP_SIZE ,0 ); - context_mm =memblock_virt_alloc (sizeof (void *) * (LAST_CONTEXT +1 ),0 ); + context_map =memblock_alloc (CTX_MAP_SIZE ,0 ); + context_mm =memblock_alloc (sizeof (void *) * (LAST_CONTEXT +1 ),0 );#ifdef CONFIG_SMP - stale_map[boot_cpuid] =memblock_virt_alloc (CTX_MAP_SIZE ,0 ); + stale_map[boot_cpuid] =memblock_alloc (CTX_MAP_SIZE ,0 ); cpuhp_setup_state_nocalls(CPUHP_POWERPC_MMU_CTX_PREPARE, "powerpc/mmu/ctx:prepare",
arch/powerpc/platforms/powermac/nvram.c +1 -1
@@ -513,7 +513,7 @@ static int __init core99_nvram_setup(struct device_node *dp, unsigned long addr)printk (KERN_ERR "nvram: no address\n" );return -EINVAL ; } - nvram_image =memblock_virt_alloc (NVRAM_SIZE ,0 ); + nvram_image =memblock_alloc (NVRAM_SIZE ,0 ); nvram_data =ioremap (addr,NVRAM_SIZE *2 ); nvram_naddrs =1 ;/* Make sure we get the correct case */
arch/powerpc/platforms/powernv/pci-ioda.c +3 -3
@@ -3770,7 +3770,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, phb_id =be64_to_cpup (prop64);pr_debug (" PHB-ID : 0x%016llx\n" , phb_id); - phb =memblock_virt_alloc (sizeof (*phb),0 ); + phb =memblock_alloc (sizeof (*phb),0 );/* Allocate PCI controller */ phb->hose = hose =pcibios_alloc_controller (np);
@@ -3816,7 +3816,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,else phb->diag_data_size =PNV_PCI_DIAG_BUF_SIZE ; - phb->diag_data =memblock_virt_alloc (phb->diag_data_size,0 ); + phb->diag_data =memblock_alloc (phb->diag_data_size,0 );/* Parse 32-bit and IO ranges (if any) */ pci_process_bridge_OF_ranges (hose, np, !hose->global_number);
@@ -3875,7 +3875,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, } pemap_off = size; size += phb->ioda.total_pe_num *sizeof (struct pnv_ioda_pe ); - aux =memblock_virt_alloc (size,0 ); + aux =memblock_alloc (size,0 ); phb->ioda.pe_alloc = aux; phb->ioda.m64_segmap = aux + m64map_off; phb->ioda.m32_segmap = aux + m32map_off;
arch/powerpc/platforms/ps3/setup.c +1 -1
@@ -126,7 +126,7 @@ static void __init prealloc(struct ps3_prealloc *p)if (!p->size)return ; - p->address =memblock_virt_alloc (p->size, p->align); + p->address =memblock_alloc (p->size, p->align);printk (KERN_INFO "%s: %lu bytes at %p\n" , p->name, p->size, p->address);
arch/powerpc/sysdev/msi_bitmap.c +1 -1
@@ -128,7 +128,7 @@ int __ref msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,if (bmp->bitmap_from_slab) bmp->bitmap =kzalloc (size,GFP_KERNEL );else { - bmp->bitmap =memblock_virt_alloc (size,0 ); + bmp->bitmap =memblock_alloc (size,0 );/* the bitmap won't be freed from memblock allocator */ kmemleak_not_leak (bmp->bitmap); }
arch/s390/kernel/setup.c +6 -6
@@ -311,7 +311,7 @@ static void __init setup_lowcore(void)* Setup lowcore for boot cpu */ BUILD_BUG_ON (sizeof (struct lowcore ) !=LC_PAGES *PAGE_SIZE ); - lc =memblock_virt_alloc_low (sizeof (*lc),sizeof (*lc)); + lc =memblock_alloc_low (sizeof (*lc),sizeof (*lc)); lc->restart_psw.mask =PSW_KERNEL_BITS ; lc->restart_psw.addr = (unsigned long ) restart_int_handler; lc->external_new_psw.mask = PSW_KERNEL_BITS |
@@ -332,10 +332,10 @@ static void __init setup_lowcore(void) lc->kernel_stack = ((unsigned long ) &init_thread_union) +THREAD_SIZE -STACK_FRAME_OVERHEAD -sizeof (struct pt_regs ); lc->async_stack = (unsigned long ) -memblock_virt_alloc (ASYNC_SIZE ,ASYNC_SIZE ) +memblock_alloc (ASYNC_SIZE ,ASYNC_SIZE ) +ASYNC_SIZE -STACK_FRAME_OVERHEAD -sizeof (struct pt_regs ); lc->panic_stack = (unsigned long ) -memblock_virt_alloc (PAGE_SIZE ,PAGE_SIZE ) +memblock_alloc (PAGE_SIZE ,PAGE_SIZE ) +PAGE_SIZE -STACK_FRAME_OVERHEAD -sizeof (struct pt_regs ); lc->current_task = (unsigned long )&init_task; lc->lpp =LPP_MAGIC ;
@@ -357,7 +357,7 @@ static void __init setup_lowcore(void) lc->last_update_timer = S390_lowcore.last_update_timer; lc->last_update_clock = S390_lowcore.last_update_clock; - restart_stack =memblock_virt_alloc (ASYNC_SIZE ,ASYNC_SIZE ); + restart_stack =memblock_alloc (ASYNC_SIZE ,ASYNC_SIZE ); restart_stack +=ASYNC_SIZE ;/*
@@ -423,7 +423,7 @@ static void __init setup_resources(void) bss_resource.end = (unsigned long ) __bss_stop -1 ;for_each_memblock (memory, reg) { - res =memblock_virt_alloc (sizeof (*res),8 ); + res =memblock_alloc (sizeof (*res),8 ); res->flags =IORESOURCE_BUSY |IORESOURCE_SYSTEM_RAM ; res->name ="System RAM" ;
@@ -437,7 +437,7 @@ static void __init setup_resources(void) std_res->start > res->end)continue ;if (std_res->end > res->end) { - sub_res =memblock_virt_alloc (sizeof (*sub_res),8 ); + sub_res =memblock_alloc (sizeof (*sub_res),8 ); *sub_res = *std_res; sub_res->end = res->end; std_res->start = res->end +1 ;
arch/s390/kernel/smp.c +1 -1
@@ -751,7 +751,7 @@ void __init smp_detect_cpus(void)u16 address;/* Get CPU information */ - info =memblock_virt_alloc (sizeof (*info),8 ); + info =memblock_alloc (sizeof (*info),8 );smp_get_core_info (info,1 );/* Find boot CPU type */ if (sclp.has_core_type) {
arch/s390/kernel/topology.c +2 -2
@@ -519,7 +519,7 @@ static void __init alloc_masks(struct sysinfo_15_1_x *info, nr_masks *= info->mag[TOPOLOGY_NR_MAG - offset -1 - i]; nr_masks =max (nr_masks,1 );for (i =0 ; i < nr_masks; i++) { - mask->next =memblock_virt_alloc (sizeof (*mask->next),8 ); + mask->next =memblock_alloc (sizeof (*mask->next),8 ); mask = mask->next; } }
@@ -537,7 +537,7 @@ void __init topology_init_early(void) }if (!MACHINE_HAS_TOPOLOGY ) goto out; - tl_info =memblock_virt_alloc (PAGE_SIZE ,PAGE_SIZE ); + tl_info =memblock_alloc (PAGE_SIZE ,PAGE_SIZE ); info = tl_info;store_topology (info); pr_info("The CPU configuration topology of the machine is: %d %d %d %d %d %d / %d\n",
arch/s390/numa/mode_emu.c +1 -1
@@ -313,7 +313,7 @@ static void __ref create_core_to_node_map(void) {int i; - emu_cores =memblock_virt_alloc (sizeof (*emu_cores),8 ); + emu_cores =memblock_alloc (sizeof (*emu_cores),8 );for (i =0 ; i <ARRAY_SIZE (emu_cores->to_node_id); i++) emu_cores->to_node_id[i] =NODE_ID_FREE ; }
arch/s390/numa/toptree.c +1 -1
@@ -34,7 +34,7 @@ struct toptree __ref *toptree_alloc(int level, int id)if (slab_is_available ()) res =kzalloc (sizeof (*res),GFP_KERNEL );else - res =memblock_virt_alloc (sizeof (*res),8 ); + res =memblock_alloc (sizeof (*res),8 );if (!res)return res;
arch/x86/mm/kasan_init_64.c +2 -2
@@ -28,10 +28,10 @@ static p4d_t tmp_p4d_table[MAX_PTRS_PER_P4D] __initdata __aligned(PAGE_SIZE);static __init void *early_alloc (size_t size,int nid,bool panic) {if (panic) -return memblock_virt_alloc_try_nid (size, size, +return memblock_alloc_try_nid (size, size,__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid);else -return memblock_virt_alloc_try_nid_nopanic (size, size, +return memblock_alloc_try_nid_nopanic (size, size,__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid); }
arch/xtensa/mm/kasan_init.c +1 -1
@@ -43,7 +43,7 @@ static void __init populate(void *start, void *end)unsigned long vaddr = (unsigned long )start;pgd_t *pgd =pgd_offset_k (vaddr);pmd_t *pmd =pmd_offset (pgd, vaddr); -pte_t *pte =memblock_virt_alloc (n_pages *sizeof (pte_t),PAGE_SIZE ); +pte_t *pte =memblock_alloc (n_pages *sizeof (pte_t),PAGE_SIZE );pr_debug ("%s: %p - %p\n" , __func__, start, end);
drivers/clk/ti/clk.c +1 -1
@@ -347,7 +347,7 @@ void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem) {struct clk_iomap *io; - io =memblock_virt_alloc (sizeof (*io),0 ); + io =memblock_alloc (sizeof (*io),0 ); io->mem = mem;
drivers/firmware/memmap.c +1 -1
@@ -333,7 +333,7 @@ int __init firmware_map_add_early(u64 start, u64 end, const char *type) {struct firmware_map_entry *entry; - entry =memblock_virt_alloc (sizeof (struct firmware_map_entry ),0 ); + entry =memblock_alloc (sizeof (struct firmware_map_entry ),0 );if (WARN_ON (!entry))return -ENOMEM ;
drivers/of/fdt.c +1 -1
@@ -1198,7 +1198,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,static void *__init early_init_dt_alloc_memory_arch (u64 size,u64 align) { -return memblock_virt_alloc (size, align); +return memblock_alloc (size, align); }bool __init early_init_dt_verify (void *params)
drivers/of/unittest.c +1 -1
@@ -2182,7 +2182,7 @@ static struct device_node *overlay_base_root;static void *__init dt_alloc_memory (u64 size,u64 align) { -return memblock_virt_alloc (size, align); +return memblock_alloc (size, align); }/*
include/linux/bootmem.h +19 -19
@@ -95,78 +95,78 @@ extern void *__alloc_bootmem_low(unsigned long size,#define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0)/* FIXME: Move to memblock.h at a point where we remove nobootmem.c */ -void *memblock_virt_alloc_try_nid_raw (phys_addr_t size,phys_addr_t align, +void *memblock_alloc_try_nid_raw (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr,phys_addr_t max_addr,int nid); -void *memblock_virt_alloc_try_nid_nopanic (phys_addr_t size, +void *memblock_alloc_try_nid_nopanic (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr,phys_addr_t max_addr,int nid); -void *memblock_virt_alloc_try_nid (phys_addr_t size,phys_addr_t align, +void *memblock_alloc_try_nid (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr,phys_addr_t max_addr,int nid);void __memblock_free_early (phys_addr_t base,phys_addr_t size);void __memblock_free_late (phys_addr_t base,phys_addr_t size); -static inline void *__init memblock_virt_alloc ( +static inline void *__init memblock_alloc (phys_addr_t size,phys_addr_t align) { -return memblock_virt_alloc_try_nid (size, align,BOOTMEM_LOW_LIMIT , +return memblock_alloc_try_nid (size, align,BOOTMEM_LOW_LIMIT ,BOOTMEM_ALLOC_ACCESSIBLE ,NUMA_NO_NODE ); } -static inline void *__init memblock_virt_alloc_raw ( +static inline void *__init memblock_alloc_raw (phys_addr_t size,phys_addr_t align) { -return memblock_virt_alloc_try_nid_raw (size, align,BOOTMEM_LOW_LIMIT , +return memblock_alloc_try_nid_raw (size, align,BOOTMEM_LOW_LIMIT ,BOOTMEM_ALLOC_ACCESSIBLE ,NUMA_NO_NODE ); } -static inline void *__init memblock_virt_alloc_nopanic ( +static inline void *__init memblock_alloc_nopanic (phys_addr_t size,phys_addr_t align) { -return memblock_virt_alloc_try_nid_nopanic (size, align, +return memblock_alloc_try_nid_nopanic (size, align,BOOTMEM_LOW_LIMIT ,BOOTMEM_ALLOC_ACCESSIBLE ,NUMA_NO_NODE ); } -static inline void *__init memblock_virt_alloc_low ( +static inline void *__init memblock_alloc_low (phys_addr_t size,phys_addr_t align) { -return memblock_virt_alloc_try_nid (size, align, +return memblock_alloc_try_nid (size, align,BOOTMEM_LOW_LIMIT ,ARCH_LOW_ADDRESS_LIMIT ,NUMA_NO_NODE ); } -static inline void *__init memblock_virt_alloc_low_nopanic ( +static inline void *__init memblock_alloc_low_nopanic (phys_addr_t size,phys_addr_t align) { -return memblock_virt_alloc_try_nid_nopanic (size, align, +return memblock_alloc_try_nid_nopanic (size, align,BOOTMEM_LOW_LIMIT ,ARCH_LOW_ADDRESS_LIMIT ,NUMA_NO_NODE ); } -static inline void *__init memblock_virt_alloc_from_nopanic ( +static inline void *__init memblock_alloc_from_nopanic (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr) { -return memblock_virt_alloc_try_nid_nopanic (size, align, min_addr, +return memblock_alloc_try_nid_nopanic (size, align, min_addr,BOOTMEM_ALLOC_ACCESSIBLE ,NUMA_NO_NODE ); } -static inline void *__init memblock_virt_alloc_node ( +static inline void *__init memblock_alloc_node (phys_addr_t size,int nid) { -return memblock_virt_alloc_try_nid (size,0 ,BOOTMEM_LOW_LIMIT , +return memblock_alloc_try_nid (size,0 ,BOOTMEM_LOW_LIMIT ,BOOTMEM_ALLOC_ACCESSIBLE , nid); } -static inline void *__init memblock_virt_alloc_node_nopanic ( +static inline void *__init memblock_alloc_node_nopanic (phys_addr_t size,int nid) { -return memblock_virt_alloc_try_nid_nopanic (size,0 ,BOOTMEM_LOW_LIMIT , +return memblock_alloc_try_nid_nopanic (size,0 ,BOOTMEM_LOW_LIMIT ,BOOTMEM_ALLOC_ACCESSIBLE , nid); }
init/main.c +3 -3
@@ -375,10 +375,10 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }static void __init setup_command_line (char *command_line) { saved_command_line = -memblock_virt_alloc (strlen (boot_command_line) +1 ,0 ); +memblock_alloc (strlen (boot_command_line) +1 ,0 ); initcall_command_line = -memblock_virt_alloc (strlen (boot_command_line) +1 ,0 ); - static_command_line =memblock_virt_alloc (strlen (command_line) +1 ,0 ); +memblock_alloc (strlen (boot_command_line) +1 ,0 ); + static_command_line =memblock_alloc (strlen (command_line) +1 ,0 );strcpy (saved_command_line, boot_command_line);strcpy (static_command_line, command_line); }
kernel/dma/swiotlb.c +4 -4
@@ -215,7 +215,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)/* * Get the overflow emergency buffer */ - v_overflow_buffer =memblock_virt_alloc_low_nopanic ( + v_overflow_buffer =memblock_alloc_low_nopanic (PAGE_ALIGN (io_tlb_overflow),PAGE_SIZE );if (!v_overflow_buffer)
@@ -228,10 +228,10 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)* to find contiguous free memory regions of size up to IO_TLB_SEGSIZE * between io_tlb_start and io_tlb_end. */ - io_tlb_list =memblock_virt_alloc ( + io_tlb_list =memblock_alloc (PAGE_ALIGN (io_tlb_nslabs *sizeof (int )),PAGE_SIZE ); - io_tlb_orig_addr =memblock_virt_alloc ( + io_tlb_orig_addr =memblock_alloc (PAGE_ALIGN (io_tlb_nslabs *sizeof (phys_addr_t)),PAGE_SIZE );for (i =0 ; i < io_tlb_nslabs; i++) {
@@ -266,7 +266,7 @@ swiotlb_init(int verbose) bytes = io_tlb_nslabs <<IO_TLB_SHIFT ;/* Get IO TLB memory from the low pages */ - vstart =memblock_virt_alloc_low_nopanic (PAGE_ALIGN (bytes),PAGE_SIZE ); + vstart =memblock_alloc_low_nopanic (PAGE_ALIGN (bytes),PAGE_SIZE );if (vstart && !swiotlb_init_with_tbl (vstart, io_tlb_nslabs, verbose))return ;
kernel/power/snapshot.c +1 -1
@@ -963,7 +963,7 @@ void __init __register_nosave_region(unsigned long start_pfn,BUG_ON (!region); }else {/* This allocation cannot fail */ - region =memblock_virt_alloc (sizeof (struct nosave_region ),0 ); + region =memblock_alloc (sizeof (struct nosave_region ),0 ); } region->start_pfn = start_pfn; region->end_pfn = end_pfn;
kernel/printk/printk.c +2 -2
@@ -1106,9 +1106,9 @@ void __init setup_log_buf(int early)if (early) { new_log_buf = -memblock_virt_alloc (new_log_buf_len,LOG_ALIGN ); +memblock_alloc (new_log_buf_len,LOG_ALIGN ); }else { - new_log_buf =memblock_virt_alloc_nopanic (new_log_buf_len, + new_log_buf =memblock_alloc_nopanic (new_log_buf_len,LOG_ALIGN ); }
lib/cpumask.c +1 -1
@@ -163,7 +163,7 @@ EXPORT_SYMBOL(zalloc_cpumask_var);*/ void __init alloc_bootmem_cpumask_var (cpumask_var_t *mask) { - *mask =memblock_virt_alloc (cpumask_size (),0 ); + *mask =memblock_alloc (cpumask_size (),0 ); }/**
mm/hugetlb.c +1 -1
@@ -2100,7 +2100,7 @@ int __alloc_bootmem_huge_page(struct hstate *h)for_each_node_mask_to_alloc (h, nr_nodes, node, &node_states[N_MEMORY ]) {void *addr; - addr =memblock_virt_alloc_try_nid_raw ( + addr =memblock_alloc_try_nid_raw (huge_page_size (h),huge_page_size (h),0 ,BOOTMEM_ALLOC_ACCESSIBLE , node);if (addr) {
mm/kasan/kasan_init.c +1 -1
@@ -83,7 +83,7 @@ static inline bool kasan_zero_page_entry(pte_t pte)static __init void *early_alloc (size_t size,int node) { -return memblock_virt_alloc_try_nid (size, size,__pa (MAX_DMA_ADDRESS ), +return memblock_alloc_try_nid (size, size,__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , node); }
mm/memblock.c +13 -13
@@ -1370,7 +1370,7 @@ phys_addr_t __init memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t ali }/** -* memblock_virt_alloc_internal - allocate boot memory block +* memblock_alloc_internal - allocate boot memory block * @size: size of memory block to be allocated in bytes * @align: alignment of the region and block's size * @min_addr: the lower bound of the memory region to allocate (phys address)
@@ -1396,7 +1396,7 @@ phys_addr_t __init memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t ali* Return: * Virtual address of allocated memory block on success, NULL on failure. */ -static void *__init memblock_virt_alloc_internal ( +static void *__init memblock_alloc_internal (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr,phys_addr_t max_addr,int nid)
@@ -1463,7 +1463,7 @@ static void * __init memblock_virt_alloc_internal( }/** -* memblock_virt_alloc_try_nid_raw - allocate boot memory block without zeroing +* memblock_alloc_try_nid_raw - allocate boot memory block without zeroing * memory and without panicking * @size: size of memory block to be allocated in bytes * @align: alignment of the region and block's size
@@ -1481,7 +1481,7 @@ static void * __init memblock_virt_alloc_internal(* Return: * Virtual address of allocated memory block on success, NULL on failure. */ -void *__init memblock_virt_alloc_try_nid_raw ( +void *__init memblock_alloc_try_nid_raw (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr,phys_addr_t max_addr,int nid)
@@ -1492,7 +1492,7 @@ void * __init memblock_virt_alloc_try_nid_raw( __func__, (u64 )size, (u64 )align, nid, &min_addr, &max_addr, (void *)_RET_IP_); - ptr =memblock_virt_alloc_internal (size, align, + ptr =memblock_alloc_internal (size, align, min_addr, max_addr, nid);#ifdef CONFIG_DEBUG_VM if (ptr && size >0 )
@@ -1502,7 +1502,7 @@ void * __init memblock_virt_alloc_try_nid_raw( }/** -* memblock_virt_alloc_try_nid_nopanic - allocate boot memory block +* memblock_alloc_try_nid_nopanic - allocate boot memory block * @size: size of memory block to be allocated in bytes * @align: alignment of the region and block's size * @min_addr: the lower bound of the memory region from where the allocation
@@ -1518,7 +1518,7 @@ void * __init memblock_virt_alloc_try_nid_raw(* Return: * Virtual address of allocated memory block on success, NULL on failure. */ -void *__init memblock_virt_alloc_try_nid_nopanic ( +void *__init memblock_alloc_try_nid_nopanic (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr,phys_addr_t max_addr,int nid)
@@ -1529,7 +1529,7 @@ void * __init memblock_virt_alloc_try_nid_nopanic( __func__, (u64 )size, (u64 )align, nid, &min_addr, &max_addr, (void *)_RET_IP_); - ptr =memblock_virt_alloc_internal (size, align, + ptr =memblock_alloc_internal (size, align, min_addr, max_addr, nid);if (ptr)memset (ptr,0 , size);
@@ -1537,7 +1537,7 @@ void * __init memblock_virt_alloc_try_nid_nopanic( }/** -* memblock_virt_alloc_try_nid - allocate boot memory block with panicking +* memblock_alloc_try_nid - allocate boot memory block with panicking * @size: size of memory block to be allocated in bytes * @align: alignment of the region and block's size * @min_addr: the lower bound of the memory region from where the allocation
@@ -1547,14 +1547,14 @@ void * __init memblock_virt_alloc_try_nid_nopanic(* allocate only from memory limited by memblock.current_limit value * @nid: nid of the free area to find, %NUMA_NO_NODE for any node * -* Public panicking version of memblock_virt_alloc_try_nid_nopanic() +* Public panicking version of memblock_alloc_try_nid_nopanic() * which provides debug information (including caller info), if enabled, * and panics if the request can not be satisfied. * * Return: * Virtual address of allocated memory block on success, NULL on failure. */ -void *__init memblock_virt_alloc_try_nid ( +void *__init memblock_alloc_try_nid (phys_addr_t size,phys_addr_t align,phys_addr_t min_addr,phys_addr_t max_addr,int nid)
@@ -1564,7 +1564,7 @@ void * __init memblock_virt_alloc_try_nid(memblock_dbg ("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pF\n" , __func__, (u64 )size, (u64 )align, nid, &min_addr, &max_addr, (void *)_RET_IP_); - ptr =memblock_virt_alloc_internal (size, align, + ptr =memblock_alloc_internal (size, align, min_addr, max_addr, nid);if (ptr) {memset (ptr,0 , size);
@@ -1581,7 +1581,7 @@ void * __init memblock_virt_alloc_try_nid(* @base: phys starting address of the boot memory block * @size: size of the boot memory block in bytes * -* Free boot memory block previously allocated by memblock_virt_alloc_xx() API. +* Free boot memory block previously allocated by memblock_alloc_xx() API. * The freeing memory will not be released to the buddy allocator. */ void __init __memblock_free_early (phys_addr_t base,phys_addr_t size)
mm/page_alloc.c +4 -4
@@ -6121,7 +6121,7 @@ static void __ref setup_usemap(struct pglist_data *pgdat, zone->pageblock_flags =NULL ;if (usemapsize) zone->pageblock_flags = -memblock_virt_alloc_node_nopanic (usemapsize, +memblock_alloc_node_nopanic (usemapsize, pgdat->node_id); }#else
@@ -6363,7 +6363,7 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat) end =pgdat_end_pfn (pgdat); end =ALIGN (end,MAX_ORDER_NR_PAGES ); size = (end - start) *sizeof (struct page ); - map =memblock_virt_alloc_node_nopanic (size, pgdat->node_id); + map =memblock_alloc_node_nopanic (size, pgdat->node_id); pgdat->node_mem_map = map + offset; } pr_debug("%s: node %d, pgdat %08lx, node_mem_map %08lx\n",
@@ -7616,9 +7616,9 @@ void *__init alloc_large_system_hash(const char *tablename, size = bucketsize << log2qty;if (flags &HASH_EARLY ) {if (flags &HASH_ZERO ) - table =memblock_virt_alloc_nopanic (size,0 ); + table =memblock_alloc_nopanic (size,0 );else - table =memblock_virt_alloc_raw (size,0 ); + table =memblock_alloc_raw (size,0 ); }else if (hashdist) { table =__vmalloc (size, gfp_flags,PAGE_KERNEL ); }else {
mm/page_ext.c +1 -1
@@ -161,7 +161,7 @@ static int __init alloc_node_page_ext(int nid) table_size =get_entry_size () * nr_pages; - base =memblock_virt_alloc_try_nid_nopanic ( + base =memblock_alloc_try_nid_nopanic ( table_size,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid);if (!base)
mm/percpu.c +14 -14
@@ -1101,7 +1101,7 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr, region_size =ALIGN (start_offset + map_size, lcm_align);/* allocate chunk */ - chunk =memblock_virt_alloc (sizeof (struct pcpu_chunk ) + + chunk =memblock_alloc (sizeof (struct pcpu_chunk ) +BITS_TO_LONGS (region_size >>PAGE_SHIFT ),0 );
@@ -1114,11 +1114,11 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr, chunk->nr_pages = region_size >>PAGE_SHIFT ; region_bits =pcpu_chunk_map_bits (chunk); - chunk->alloc_map =memblock_virt_alloc (BITS_TO_LONGS (region_bits) * + chunk->alloc_map =memblock_alloc (BITS_TO_LONGS (region_bits) *sizeof (chunk->alloc_map[0 ]),0 ); - chunk->bound_map =memblock_virt_alloc (BITS_TO_LONGS (region_bits +1 ) * + chunk->bound_map =memblock_alloc (BITS_TO_LONGS (region_bits +1 ) *sizeof (chunk->bound_map[0 ]),0 ); - chunk->md_blocks =memblock_virt_alloc (pcpu_chunk_nr_blocks (chunk) * + chunk->md_blocks =memblock_alloc (pcpu_chunk_nr_blocks (chunk) *sizeof (chunk->md_blocks[0 ]),0 );pcpu_init_md_blocks (chunk);
@@ -1887,7 +1887,7 @@ struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups, __alignof__(ai->groups[0].cpu_map[0])); ai_size = base_size + nr_units *sizeof (ai->groups[0 ].cpu_map[0 ]); - ptr =memblock_virt_alloc_nopanic (PFN_ALIGN (ai_size),PAGE_SIZE ); + ptr =memblock_alloc_nopanic (PFN_ALIGN (ai_size),PAGE_SIZE );if (!ptr)return NULL ; ai = ptr;
@@ -2074,12 +2074,12 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,PCPU_SETUP_BUG_ON (pcpu_verify_alloc_info (ai) <0 );/* process group information and build config tables accordingly */ - group_offsets =memblock_virt_alloc (ai->nr_groups * + group_offsets =memblock_alloc (ai->nr_groups *sizeof (group_offsets[0 ]),0 ); - group_sizes =memblock_virt_alloc (ai->nr_groups * + group_sizes =memblock_alloc (ai->nr_groups *sizeof (group_sizes[0 ]),0 ); - unit_map =memblock_virt_alloc (nr_cpu_ids *sizeof (unit_map[0 ]),0 ); - unit_off =memblock_virt_alloc (nr_cpu_ids *sizeof (unit_off[0 ]),0 ); + unit_map =memblock_alloc (nr_cpu_ids *sizeof (unit_map[0 ]),0 ); + unit_off =memblock_alloc (nr_cpu_ids *sizeof (unit_off[0 ]),0 );for (cpu =0 ; cpu < nr_cpu_ids; cpu++) unit_map[cpu] =UINT_MAX ;
@@ -2143,7 +2143,7 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,* empty chunks. */ pcpu_nr_slots =__pcpu_size_to_slot (pcpu_unit_size) +2 ; - pcpu_slot =memblock_virt_alloc ( + pcpu_slot =memblock_alloc ( pcpu_nr_slots *sizeof (pcpu_slot[0 ]),0 );for (i =0 ; i < pcpu_nr_slots; i++)INIT_LIST_HEAD (&pcpu_slot[i]);
@@ -2457,7 +2457,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, size_sum = ai->static_size + ai->reserved_size + ai->dyn_size; areas_size =PFN_ALIGN (ai->nr_groups *sizeof (void *)); - areas =memblock_virt_alloc_nopanic (areas_size,0 ); + areas =memblock_alloc_nopanic (areas_size,0 );if (!areas) { rc = -ENOMEM ; goto out_free;
@@ -2598,7 +2598,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,/* unaligned allocations can't be freed, round up to page size */ pages_size =PFN_ALIGN (unit_pages *num_possible_cpus () *sizeof (pages[0 ])); - pages =memblock_virt_alloc (pages_size,0 ); + pages =memblock_alloc (pages_size,0 );/* allocate pages */ j =0 ;
@@ -2687,7 +2687,7 @@ EXPORT_SYMBOL(__per_cpu_offset);static void *__init pcpu_dfl_fc_alloc (unsigned int cpu,size_t size,size_t align) { -return memblock_virt_alloc_from_nopanic ( +return memblock_alloc_from_nopanic ( size, align,__pa (MAX_DMA_ADDRESS )); }
@@ -2736,7 +2736,7 @@ void __init setup_per_cpu_areas(void)void *fc; ai =pcpu_alloc_alloc_info (1 ,1 ); - fc =memblock_virt_alloc_from_nopanic (unit_size, + fc =memblock_alloc_from_nopanic (unit_size,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ));if (!ai || !fc)
mm/sparse-vmemmap.c +1 -1
@@ -42,7 +42,7 @@ static void * __ref __earlyonly_bootmem_alloc(int node,unsigned long align, unsigned long goal) { - return memblock_virt_alloc_try_nid_raw(size, align, goal, + return memblock_alloc_try_nid_raw(size, align, goal,BOOTMEM_ALLOC_ACCESSIBLE ,node ); }
mm/sparse.c +6 -6
@@ -68,7 +68,7 @@ static noinline struct mem_section __ref *sparse_index_alloc(int nid)if (slab_is_available ()) section =kzalloc_node (array_size,GFP_KERNEL , nid);else - section =memblock_virt_alloc_node (array_size, nid); + section =memblock_alloc_node (array_size, nid);return section; }
@@ -216,7 +216,7 @@ void __init memory_present(int nid, unsigned long start, unsigned long end) size =sizeof (struct mem_section *) *NR_SECTION_ROOTS ; align =1 << (INTERNODE_CACHE_SHIFT ); - mem_section = memblock_virt_alloc(size, align); + mem_section = memblock_alloc(size, align); }#endif
@@ -306,7 +306,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, limit = goal + (1UL <<PA_SECTION_SHIFT ); nid =early_pfn_to_nid (goal >>PAGE_SHIFT ); again: - p =memblock_virt_alloc_try_nid_nopanic (size, + p =memblock_alloc_try_nid_nopanic (size,SMP_CACHE_BYTES , goal, limit, nid);if (!p && limit) {
@@ -362,7 +362,7 @@ static unsigned long * __init sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, unsigned long size) { -return memblock_virt_alloc_node_nopanic (size, pgdat->node_id); +return memblock_alloc_node_nopanic (size, pgdat->node_id); }static void __init check_usemap_section_nr (int nid,unsigned long *usemap)
@@ -391,7 +391,7 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid,if (map)return map; - map =memblock_virt_alloc_try_nid (size, + map =memblock_alloc_try_nid (size,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid);return map;
@@ -405,7 +405,7 @@ static void __init sparse_buffer_init(unsigned long size, int nid) {WARN_ON (sparsemap_buf);/* forgot to call sparse_buffer_fini()? */ sparsemap_buf = -memblock_virt_alloc_try_nid_raw (size,PAGE_SIZE , +memblock_alloc_try_nid_raw (size,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid); sparsemap_buf_end = sparsemap_buf + size;
Signature · 1 line
2.7.4
PATCH 8/30 memblock: replace alloc_bootmem_align with memblock_alloc
In reply to Mike RapoportThe functions are equivalent, just the later does not require nobootmem translation layer.
--- arch/x86/xen/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/p2m.c +1 -1
@@ -182,7 +182,7 @@ static void p2m_init_identity(unsigned long *p2m, unsigned long pfn)static void *__ref alloc_p2m_page (void ) {if (unlikely (!slab_is_available ())) -return alloc_bootmem_align (PAGE_SIZE ,PAGE_SIZE ); +return memblock_alloc (PAGE_SIZE ,PAGE_SIZE );return (void *)__get_free_page (GFP_KERNEL ); }
Signature · 1 line
2.7.4
PATCH 9/30 memblock: replace alloc_bootmem_low with memblock_alloc_low
In reply to Mike RapoportThe functions are equivalent, just the later does not require nobootmem translation layer.
--- arch/x86/kernel/tce_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/tce_64.c +1 -1
@@ -173,7 +173,7 @@ void * __init alloc_tce_table(void) size =table_size_to_number_of_entries (specified_table_size); size *=TCE_ENTRY_SIZE ; -return __alloc_bootmem_low (size, size,0 ); +return memblock_alloc_low (size, size); }void __init free_tce_table (void *tbl)
Signature · 1 line
2.7.4
PATCH 10/30 memblock: replace __alloc_bootmem_node_nopanic with memblock_alloc_try_nid_nopanic
In reply to Mike RapoportThe __alloc_bootmem_node_nopanic() attempts to allocate memory for a specified node. If the allocation fails it then retries to allocate memory from any node. Upon success, the allocated memory is set to 0.
The memblock_alloc_try_nid_nopanic() does exactly the same thing and can be used instead.
--- arch/x86/kernel/setup_percpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/x86/kernel/setup_percpu.c +4 -2
@@ -112,8 +112,10 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,pr_debug ("per cpu data for cpu%d %lu bytes at %016lx\n" , cpu, size,__pa (ptr)); }else { - ptr =__alloc_bootmem_node_nopanic (NODE_DATA (node), - size, align, goal); + ptr =memblock_alloc_try_nid_nopanic (size, align, goal, +BOOTMEM_ALLOC_ACCESSIBLE , + node); +pr_debug ("per cpu data for cpu%d %lu bytes on node%d at %016lx\n" , cpu, size, node,__pa (ptr)); }
Signature · 1 line
2.7.4
PATCH 11/30 memblock: replace alloc_bootmem_pages_nopanic with memblock_alloc_nopanic
In reply to Mike RapoportThe alloc_bootmem_pages_nopanic(size) is a shortcut for __alloc_bootmem_nopanic(size, PAGE_SIZE, BOOTMEM_LOW_LIMIT) which allocates PAGE_SIZE aligned memory. Since BOOTMEM_LOW_LIMIT is hardwired to 0 there is no restrictions on where the allocated memory should reside.
The memblock_alloc_nopanic(size, PAGE_SIZE) also allocates PAGE_SIZE aligned memory without any restrictions and thus can be used as a replacement for alloc_bootmem_pages_nopanic()
--- drivers/usb/early/xhci-dbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/early/xhci-dbc.c +1 -1
@@ -94,7 +94,7 @@ static void * __init xdbc_get_page(dma_addr_t *dma_addr) {void *virt; - virt =alloc_bootmem_pages_nopanic (PAGE_SIZE ); + virt =memblock_alloc_nopanic (PAGE_SIZE ,PAGE_SIZE );if (!virt)return NULL ;
Signature · 1 line
2.7.4
PATCH 12/30 memblock: replace alloc_bootmem_low with memblock_alloc_low
In reply to Mike RapoportThe alloc_bootmem_low(size) allocates low memory with default alignement and can be replcaed by memblock_alloc_low(size, 0)
--- arch/arm64/kernel/setup.c | 2 +- arch/unicore32/kernel/setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kernel/setup.c +1 -1
@@ -213,7 +213,7 @@ static void __init request_standard_resources(void) kernel_data.end =__pa_symbol (_end -1 );for_each_memblock (memory, region) { - res =alloc_bootmem_low (sizeof (*res)); + res =memblock_alloc_low (sizeof (*res),0 );if (memblock_is_nomap (region)) { res->name ="reserved" ; res->flags =IORESOURCE_MEM ;
arch/unicore32/kernel/setup.c +1 -1
@@ -207,7 +207,7 @@ request_standard_resources(struct meminfo *mi)if (mi->bank[i].size ==0 )continue ; - res =alloc_bootmem_low (sizeof (*res)); + res =memblock_alloc_low (sizeof (*res),0 ); res->name ="System RAM" ; res->start = mi->bank[i].start; res->end = mi->bank[i].start + mi->bank[i].size -1 ;
Signature · 1 line
2.7.4
PATCH 13/30 memblock: replace __alloc_bootmem_nopanic with memblock_alloc_from_nopanic
In reply to Mike RapoportWhen __alloc_bootmem_nopanic() is used with explicit lower limit for the allocation it attempts to allocate memory at or above that limit and falls back to allocation with no limit set.
The memblock_alloc_from_nopanic() does exactly the same thing and can be used as a replacement for __alloc_bootmem_nopanic() is such cases.
--- arch/arc/kernel/unwind.c | 4 ++-- arch/x86/kernel/setup_percpu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arc/kernel/unwind.c +2 -2
@@ -181,8 +181,8 @@ static void init_unwind_hdr(struct unwind_table *table,*/ static void *__init unw_hdr_alloc_early (unsigned long sz) { -return __alloc_bootmem_nopanic (sz,sizeof (unsigned int ), -MAX_DMA_ADDRESS ); +return memblock_alloc_from_nopanic (sz,sizeof (unsigned int ), +MAX_DMA_ADDRESS ); }static void *unw_hdr_alloc (unsigned long sz)
arch/x86/kernel/setup_percpu.c +2 -2
@@ -106,7 +106,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,void *ptr;if (!node_online (node) || !NODE_DATA (node)) { - ptr =__alloc_bootmem_nopanic (size, align, goal); + ptr =memblock_alloc_from_nopanic (size, align, goal);pr_info ("cpu %d has no node %d or node-local memory\n" , cpu, node); pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n",
@@ -121,7 +121,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, }return ptr;#else -return __alloc_bootmem_nopanic (size, align, goal); +return memblock_alloc_from_nopanic (size, align, goal);#endif }
Signature · 1 line
2.7.4
PATCH 14/30 memblock: add align parameter to memblock_alloc_node()
In reply to Mike RapoportWith the align parameter memblock_alloc_node() can be used as drop in replacement for alloc_bootmem_pages_node() and __alloc_bootmem_node(), which is done in the following patches.
--- include/linux/bootmem.h | 4 ++-- mm/sparse.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/bootmem.h +2 -2
@@ -157,9 +157,9 @@ static inline void * __init memblock_alloc_from_nopanic( }static inline void *__init memblock_alloc_node ( -phys_addr_t size,int nid) +phys_addr_t size,phys_addr_t align,int nid) { -return memblock_alloc_try_nid (size,0 ,BOOTMEM_LOW_LIMIT , +return memblock_alloc_try_nid (size, align,BOOTMEM_LOW_LIMIT ,BOOTMEM_ALLOC_ACCESSIBLE , nid); }
mm/sparse.c +1 -1
@@ -68,7 +68,7 @@ static noinline struct mem_section __ref *sparse_index_alloc(int nid)if (slab_is_available ()) section =kzalloc_node (array_size,GFP_KERNEL , nid);else - section =memblock_alloc_node (array_size, nid); + section =memblock_alloc_node (array_size,0 , nid);return section; }
Signature · 1 line
2.7.4
PATCH 15/30 memblock: replace alloc_bootmem_pages_node with memblock_alloc_node
In reply to Mike RapoportThe functions are equivalent, just the later does not require nobootmem translation layer.
--- arch/ia64/mm/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/ia64/mm/init.c +4 -4
@@ -447,19 +447,19 @@ int __init create_mem_map_page_table(u64 start, u64 end, void *arg)for (address = start_page; address < end_page; address +=PAGE_SIZE ) { pgd =pgd_offset_k (address);if (pgd_none (*pgd)) -pgd_populate (&init_mm, pgd,alloc_bootmem_pages_node (NODE_DATA (node),PAGE_SIZE )); +pgd_populate (&init_mm, pgd,memblock_alloc_node (PAGE_SIZE ,PAGE_SIZE , node)); pud =pud_offset (pgd, address);if (pud_none (*pud)) -pud_populate (&init_mm, pud,alloc_bootmem_pages_node (NODE_DATA (node),PAGE_SIZE )); +pud_populate (&init_mm, pud,memblock_alloc_node (PAGE_SIZE ,PAGE_SIZE , node)); pmd =pmd_offset (pud, address);if (pmd_none (*pmd)) -pmd_populate_kernel (&init_mm, pmd,alloc_bootmem_pages_node (NODE_DATA (node),PAGE_SIZE )); +pmd_populate_kernel (&init_mm, pmd,memblock_alloc_node (PAGE_SIZE ,PAGE_SIZE , node)); pte =pte_offset_kernel (pmd, address);if (pte_none (*pte)) -set_pte (pte,pfn_pte (__pa (alloc_bootmem_pages_node (NODE_DATA (node),PAGE_SIZE )) >>PAGE_SHIFT , +set_pte (pte,pfn_pte (__pa (memblock_alloc_node (PAGE_SIZE ,PAGE_SIZE , node)) >>PAGE_SHIFT ,PAGE_KERNEL )); }return 0 ;
Signature · 1 line
2.7.4
PATCH 16/30 memblock: replace __alloc_bootmem_node with appropriate memblock_ API
In reply to Mike RapoportUse memblock_alloc_try_nid whenever goal (i.e. minimal address is specified) and memblock_alloc_node otherwise.
--- arch/ia64/mm/discontig.c | 6 ++++-- arch/powerpc/kernel/setup_64.c | 6 ++++-- arch/sparc/kernel/setup_64.c | 10 ++++------ arch/sparc/kernel/smp_64.c | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-)
arch/ia64/mm/discontig.c +4 -2
@@ -451,8 +451,10 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)if (bestnode ==-1 ) bestnode = anynode; - ptr =__alloc_bootmem_node (pgdat_list[bestnode], pernodesize, -PERCPU_PAGE_SIZE ,__pa (MAX_DMA_ADDRESS )); + ptr =memblock_alloc_try_nid (pernodesize,PERCPU_PAGE_SIZE , +__pa (MAX_DMA_ADDRESS ), +BOOTMEM_ALLOC_ACCESSIBLE , + bestnode);return ptr; }
arch/powerpc/kernel/setup_64.c +4 -2
@@ -757,8 +757,10 @@ void __init emergency_stack_init(void)static void *__init pcpu_fc_alloc (unsigned int cpu,size_t size,size_t align) { -return __alloc_bootmem_node (NODE_DATA (early_cpu_to_node (cpu)), size, align, -__pa (MAX_DMA_ADDRESS )); +return memblock_alloc_try_nid (size, align,__pa (MAX_DMA_ADDRESS ), +BOOTMEM_ALLOC_ACCESSIBLE , +early_cpu_to_node (cpu)); + }static void __init pcpu_fc_free (void *ptr,size_t size)
arch/sparc/kernel/setup_64.c +4 -6
@@ -622,12 +622,10 @@ void __init alloc_irqstack_bootmem(void)for_each_possible_cpu (i) { node =cpu_to_node (i); - softirq_stack[i] =__alloc_bootmem_node (NODE_DATA (node), -THREAD_SIZE , -THREAD_SIZE ,0 ); - hardirq_stack[i] =__alloc_bootmem_node (NODE_DATA (node), -THREAD_SIZE , -THREAD_SIZE ,0 ); + softirq_stack[i] =memblock_alloc_node (THREAD_SIZE , +THREAD_SIZE , node); + hardirq_stack[i] =memblock_alloc_node (THREAD_SIZE , +THREAD_SIZE , node); } }
arch/sparc/kernel/smp_64.c +2 -2
@@ -1594,8 +1594,8 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size,pr_debug ("per cpu data for cpu%d %lu bytes at %016lx\n" , cpu, size,__pa (ptr)); }else { - ptr =__alloc_bootmem_node (NODE_DATA (node), - size, align, goal); + ptr =memblock_alloc_try_nid (size, align, goal, +BOOTMEM_ALLOC_ACCESSIBLE , node);pr_debug ("per cpu data for cpu%d %lu bytes on node%d at " "%016lx\n" , cpu, size, node,__pa (ptr)); }
Signature · 1 line
2.7.4
PATCH 17/30 memblock: replace alloc_bootmem_node with memblock_alloc_node
In reply to Mike RapoportBoth functions attempt to allocate memory with specified alignment from a particular node. If the allocation from that node fails, they both fall back to allocating from any node in the system.
Usage of native memblock API eliminates the nobootmem translation layer.
--- arch/alpha/kernel/pci_iommu.c | 4 ++-- arch/ia64/sn/kernel/io_common.c | 7 ++----- arch/ia64/sn/kernel/setup.c | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-)
arch/alpha/kernel/pci_iommu.c +2 -2
@@ -74,7 +74,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,#ifdef CONFIG_DISCONTIGMEM - arena =alloc_bootmem_node (NODE_DATA (nid),sizeof (*arena)); + arena =memblock_alloc_node (sizeof (*arena), align, nid);if (!NODE_DATA (nid) || !arena) { printk("%s: couldn't allocate arena from node %d\n" " falling back to system-wide allocation\n",
@@ -82,7 +82,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base, arena =alloc_bootmem (sizeof (*arena)); } - arena->ptes =__alloc_bootmem_node (NODE_DATA (nid), mem_size, align,0 ); + arena->ptes =memblock_alloc_node (sizeof (*arena), align, nid);if (!NODE_DATA (nid) || !arena->ptes) { printk("%s: couldn't allocate arena ptes from node %d\n" " falling back to system-wide allocation\n",
arch/ia64/sn/kernel/io_common.c +2 -5
@@ -385,16 +385,13 @@ void __init hubdev_init_node(nodepda_t * npda, cnodeid_t node) {struct hubdev_info *hubdev_info;int size; -pg_data_t *pg; size =sizeof (struct hubdev_info );if (node >=num_online_nodes ())/* Headless/memless IO nodes */ - pg =NODE_DATA (0 ); -else - pg =NODE_DATA (node); + node =0 ; - hubdev_info = (struct hubdev_info *)alloc_bootmem_node (pg, size); + hubdev_info = (struct hubdev_info *)memblock_alloc_node (size,0 , node); npda->pdinfo = (void *)hubdev_info; }
arch/ia64/sn/kernel/setup.c +2 -2
@@ -511,7 +511,7 @@ static void __init sn_init_pdas(char **cmdline_p)*/ for_each_online_node (cnode) { nodepdaindr[cnode] = -alloc_bootmem_node (NODE_DATA (cnode),sizeof (nodepda_t)); +memblock_alloc_node (sizeof (nodepda_t),0 , cnode);memset (nodepdaindr[cnode]->phys_cpuid,-1 ,sizeof (nodepdaindr[cnode]->phys_cpuid));spin_lock_init (&nodepdaindr[cnode]->ptc_lock);
@@ -522,7 +522,7 @@ static void __init sn_init_pdas(char **cmdline_p)*/ for (cnode =num_online_nodes (); cnode < num_cnodes; cnode++) nodepdaindr[cnode] = -alloc_bootmem_node (NODE_DATA (0 ),sizeof (nodepda_t)); +memblock_alloc_node (sizeof (nodepda_t),0 ,0 );/* * Now copy the array of nodepda pointers to each nodepda.
Signature · 1 line
2.7.4
PATCH 18/30 memblock: replace alloc_bootmem_low_pages with memblock_alloc_low
In reply to Mike RapoportThe alloc_bootmem_low_pages() function allocates PAGE_SIZE aligned regions from low memory. memblock_alloc_low() with alignment set to PAGE_SIZE does exactly the same thing.
The conversion is done using the following semantic patch:
@@
expression e;
@@
- alloc_bootmem_low_pages(e)
+ memblock_alloc_low(e, PAGE_SIZE)
--- arch/arc/mm/highmem.c | 2 +- arch/m68k/atari/stram.c | 3 ++- arch/m68k/mm/motorola.c | 5 +++-- arch/mips/cavium-octeon/dma-octeon.c | 2 +- arch/mips/mm/init.c | 3 ++- arch/um/kernel/mem.c | 10 ++++++---- arch/xtensa/mm/mmu.c | 2 +- 7 files changed, 16 insertions(+), 11 deletions(-)
arch/arc/mm/highmem.c +1 -1
@@ -123,7 +123,7 @@ static noinline pte_t * __init alloc_kmap_pgtable(unsigned long kvaddr) pud_k =pud_offset (pgd_k, kvaddr); pmd_k =pmd_offset (pud_k, kvaddr); - pte_k = (pte_t *)alloc_bootmem_low_pages (PAGE_SIZE ); + pte_k = (pte_t *)memblock_alloc_low (PAGE_SIZE ,PAGE_SIZE );pmd_populate_kernel (&init_mm, pmd_k, pte_k);return pte_k; }
arch/m68k/atari/stram.c +2 -1
@@ -95,7 +95,8 @@ void __init atari_stram_reserve_pages(void *start_mem) {if (kernel_in_stram) {pr_debug ("atari_stram pool: kernel in ST-RAM, using alloc_bootmem!\n" ); - stram_pool.start = (resource_size_t )alloc_bootmem_low_pages (pool_size); + stram_pool.start = (resource_size_t )memblock_alloc_low (pool_size, +PAGE_SIZE ); stram_pool.end = stram_pool.start + pool_size -1 ;request_resource (&iomem_resource, &stram_pool); stram_virt_offset =0 ;
arch/m68k/mm/motorola.c +3 -2
@@ -55,7 +55,7 @@ static pte_t * __init kernel_page_table(void) {pte_t *ptablep; - ptablep = (pte_t *)alloc_bootmem_low_pages (PAGE_SIZE ); + ptablep = (pte_t *)memblock_alloc_low (PAGE_SIZE ,PAGE_SIZE );clear_page (ptablep);__flush_page_to_ram (ptablep);
@@ -95,7 +95,8 @@ static pmd_t * __init kernel_ptr_table(void) last_pgtable +=PTRS_PER_PMD ;if (((unsigned long )last_pgtable & ~PAGE_MASK ) ==0 ) { - last_pgtable = (pmd_t *)alloc_bootmem_low_pages (PAGE_SIZE ); + last_pgtable = (pmd_t *)memblock_alloc_low (PAGE_SIZE , +PAGE_SIZE );clear_page (last_pgtable);__flush_page_to_ram (last_pgtable);
arch/mips/cavium-octeon/dma-octeon.c +1 -1
@@ -244,7 +244,7 @@ void __init plat_swiotlb_setup(void) swiotlb_nslabs =ALIGN (swiotlb_nslabs,IO_TLB_SEGSIZE ); swiotlbsize = swiotlb_nslabs <<IO_TLB_SHIFT ; - octeon_swiotlb =alloc_bootmem_low_pages (swiotlbsize); + octeon_swiotlb =memblock_alloc_low (swiotlbsize,PAGE_SIZE );if (swiotlb_init_with_tbl (octeon_swiotlb, swiotlb_nslabs,1 ) == -ENOMEM )panic ("Cannot allocate SWIOTLB buffer" );
arch/mips/mm/init.c +2 -1
@@ -244,7 +244,8 @@ 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 ((unsigned long )pte));BUG_ON (pte !=pte_offset_kernel (pmd,0 )); }
arch/um/kernel/mem.c +6 -4
@@ -64,7 +64,8 @@ void __init mem_init(void)static void __init one_page_table_init (pmd_t *pmd) {if (pmd_none (*pmd)) { -pte_t *pte = (pte_t *)alloc_bootmem_low_pages (PAGE_SIZE ); +pte_t *pte = (pte_t *)memblock_alloc_low (PAGE_SIZE , +PAGE_SIZE );set_pmd (pmd,__pmd (_KERNPG_TABLE + (unsigned long )__pa (pte)));if (pte !=pte_offset_kernel (pmd,0 ))
@@ -75,7 +76,7 @@ static void __init one_page_table_init(pmd_t *pmd)static void __init one_md_table_init (pud_t *pud) {#ifdef CONFIG_3_LEVEL_PGTABLES -pmd_t *pmd_table = (pmd_t *)alloc_bootmem_low_pages (PAGE_SIZE ); +pmd_t *pmd_table = (pmd_t *)memblock_alloc_low (PAGE_SIZE ,PAGE_SIZE );set_pud (pud,__pud (_KERNPG_TABLE + (unsigned long )__pa (pmd_table)));if (pmd_table !=pmd_offset (pud,0 ))BUG ();
@@ -124,7 +125,7 @@ static void __init fixaddr_user_init( void)return ;fixrange_init (FIXADDR_USER_START ,FIXADDR_USER_END , swapper_pg_dir); - v = (unsigned long )alloc_bootmem_low_pages (size); + v = (unsigned long )memblock_alloc_low (size,PAGE_SIZE );memcpy ((void *) v , (void *)FIXADDR_USER_START , size); p =__pa (v); for ( ; size > 0; size -= PAGE_SIZE, vaddr += PAGE_SIZE,
@@ -143,7 +144,8 @@ void __init paging_init(void)unsigned long zones_size[MAX_NR_ZONES ], vaddr;int i; - empty_zero_page = (unsigned long *)alloc_bootmem_low_pages (PAGE_SIZE ); + empty_zero_page = (unsigned long *)memblock_alloc_low (PAGE_SIZE , +PAGE_SIZE );for (i =0 ; i <ARRAY_SIZE (zones_size); i++) zones_size[i] =0 ;
arch/xtensa/mm/mmu.c +1 -1
@@ -31,7 +31,7 @@ static void * __init init_pmd(unsigned long vaddr, unsigned long n_pages)pr_debug ("%s: vaddr: 0x%08lx, n_pages: %ld\n" , __func__, vaddr, n_pages); - pte =alloc_bootmem_low_pages (n_pages *sizeof (pte_t)); + pte =memblock_alloc_low (n_pages *sizeof (pte_t),PAGE_SIZE );for (i =0 ; i < n_pages; ++i)pte_clear (NULL ,0 , pte + i);
Signature · 1 line
2.7.4
PATCH 19/30 memblock: replace alloc_bootmem_pages with memblock_alloc
In reply to Mike RapoportThe alloc_bootmem_pages() function allocates PAGE_SIZE aligned memory. memblock_alloc() with alignment set to PAGE_SIZE does exactly the same thing.
The conversion is done using the following semantic patch:
@@
expression e;
@@
- alloc_bootmem_pages(e)
+ memblock_alloc(e, PAGE_SIZE)
--- arch/c6x/mm/init.c | 3 ++- arch/h8300/mm/init.c | 2 +- arch/m68k/mm/init.c | 2 +- arch/m68k/mm/mcfmmu.c | 4 ++-- arch/m68k/mm/motorola.c | 2 +- arch/m68k/mm/sun3mmu.c | 4 ++-- arch/sh/mm/init.c | 4 ++-- arch/x86/kernel/apic/io_apic.c | 3 ++- arch/x86/mm/init_64.c | 2 +- drivers/xen/swiotlb-xen.c | 3 ++- 10 files changed, 16 insertions(+), 13 deletions(-)
arch/c6x/mm/init.c +2 -1
@@ -38,7 +38,8 @@ void __init paging_init(void)struct pglist_data *pgdat =NODE_DATA (0 );unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; - empty_zero_page = (unsigned long )alloc_bootmem_pages (PAGE_SIZE ); + empty_zero_page = (unsigned long )memblock_alloc (PAGE_SIZE , +PAGE_SIZE );memset ((void *)empty_zero_page,0 ,PAGE_SIZE );/*
arch/h8300/mm/init.c +1 -1
@@ -67,7 +67,7 @@ void __init paging_init(void)* Initialize the bad page table and bad page to point * to a couple of allocated pages. */ - empty_zero_page = (unsigned long )alloc_bootmem_pages (PAGE_SIZE ); + empty_zero_page = (unsigned long )memblock_alloc (PAGE_SIZE ,PAGE_SIZE );memset ((void *)empty_zero_page,0 ,PAGE_SIZE );/*
arch/m68k/mm/init.c +1 -1
@@ -93,7 +93,7 @@ void __init paging_init(void) high_memory = (void *) end_mem; - empty_zero_page =alloc_bootmem_pages (PAGE_SIZE ); + empty_zero_page =memblock_alloc (PAGE_SIZE ,PAGE_SIZE );/* * Set up SFC/DFC registers (user data space).
arch/m68k/mm/mcfmmu.c +2 -2
@@ -44,7 +44,7 @@ void __init paging_init(void)enum zone_type zone;int i; - empty_zero_page = (void *)alloc_bootmem_pages (PAGE_SIZE ); + empty_zero_page = (void *)memblock_alloc (PAGE_SIZE ,PAGE_SIZE );memset ((void *) empty_zero_page,0 ,PAGE_SIZE ); pg_dir = swapper_pg_dir;
@@ -52,7 +52,7 @@ void __init paging_init(void) size = num_pages *sizeof (pte_t); size = (size +PAGE_SIZE ) & ~(PAGE_SIZE -1 ); - next_pgtable = (unsigned long )alloc_bootmem_pages (size); + next_pgtable = (unsigned long )memblock_alloc (size,PAGE_SIZE ); bootmem_end = (next_pgtable + size +PAGE_SIZE ) &PAGE_MASK ; pg_dir +=PAGE_OFFSET >>PGDIR_SHIFT ;
arch/m68k/mm/motorola.c +1 -1
@@ -276,7 +276,7 @@ void __init paging_init(void)* initialize the bad page table and bad page to point * to a couple of allocated pages */ - empty_zero_page =alloc_bootmem_pages (PAGE_SIZE ); + empty_zero_page =memblock_alloc (PAGE_SIZE ,PAGE_SIZE );/* * Set up SFC/DFC registers
arch/m68k/mm/sun3mmu.c +2 -2
@@ -45,7 +45,7 @@ void __init paging_init(void)unsigned long zones_size[MAX_NR_ZONES ] = {0 , };unsigned long size; - empty_zero_page =alloc_bootmem_pages (PAGE_SIZE ); + empty_zero_page =memblock_alloc (PAGE_SIZE ,PAGE_SIZE ); address =PAGE_OFFSET ; pg_dir = swapper_pg_dir;
@@ -55,7 +55,7 @@ void __init paging_init(void) size = num_pages *sizeof (pte_t); size = (size +PAGE_SIZE ) & ~(PAGE_SIZE -1 ); - next_pgtable = (unsigned long )alloc_bootmem_pages (size); + next_pgtable = (unsigned long )memblock_alloc (size,PAGE_SIZE ); bootmem_end = (next_pgtable + size +PAGE_SIZE ) &PAGE_MASK ;/* Map whole memory from PAGE_OFFSET (0x0E000000) */
arch/sh/mm/init.c +2 -2
@@ -128,7 +128,7 @@ static pmd_t * __init one_md_table_init(pud_t *pud)if (pud_none (*pud)) {pmd_t *pmd; - pmd =alloc_bootmem_pages (PAGE_SIZE ); + pmd =memblock_alloc (PAGE_SIZE ,PAGE_SIZE );pud_populate (&init_mm, pud, pmd);BUG_ON (pmd !=pmd_offset (pud,0 )); }
@@ -141,7 +141,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)if (pmd_none (*pmd)) {pte_t *pte; - pte =alloc_bootmem_pages (PAGE_SIZE ); + pte =memblock_alloc (PAGE_SIZE ,PAGE_SIZE );pmd_populate_kernel (&init_mm, pmd, pte);BUG_ON (pte !=pte_offset_kernel (pmd,0 )); }
arch/x86/kernel/apic/io_apic.c +2 -1
@@ -2621,7 +2621,8 @@ void __init io_apic_init_mappings(void)#ifdef CONFIG_X86_32 fake_ioapic_page:#endif - ioapic_phys = (unsigned long )alloc_bootmem_pages (PAGE_SIZE ); + ioapic_phys = (unsigned long )memblock_alloc (PAGE_SIZE , +PAGE_SIZE ); ioapic_phys =__pa (ioapic_phys); }set_fixmap_nocache (idx, ioapic_phys);
arch/x86/mm/init_64.c +1 -1
@@ -197,7 +197,7 @@ static __ref void *spp_getpage(void)if (after_bootmem) ptr = (void *)get_zeroed_page (GFP_ATOMIC );else - ptr =alloc_bootmem_pages (PAGE_SIZE ); + ptr =memblock_alloc (PAGE_SIZE ,PAGE_SIZE );if (!ptr || ((unsigned long )ptr & ~PAGE_MASK )) { panic("set_pte_phys: cannot allocate page data %s\n",
drivers/xen/swiotlb-xen.c +2 -1
@@ -217,7 +217,8 @@ int __ref xen_swiotlb_init(int verbose, bool early)* Get IO TLB memory from any location. */ if (early) - xen_io_tlb_start =alloc_bootmem_pages (PAGE_ALIGN (bytes)); + xen_io_tlb_start =memblock_alloc (PAGE_ALIGN (bytes), +PAGE_SIZE );else {#define SLABS_PER_PAGE (1 << (PAGE_SHIFT - IO_TLB_SHIFT))#define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
Signature · 1 line
2.7.4
PATCH 20/30 memblock: replace __alloc_bootmem with memblock_alloc_from
In reply to Mike RapoportThe functions are equivalent, just the later does not require nobootmem translation layer.
The conversion is done using the following semantic patch:
@@
expression size, align, goal;
@@
- __alloc_bootmem(size, align, goal)
+ memblock_alloc_from(size, align, goal)
--- arch/alpha/kernel/core_cia.c | 2 +- arch/alpha/kernel/pci_iommu.c | 4 ++-- arch/alpha/kernel/setup.c | 2 +- arch/ia64/kernel/mca.c | 4 ++-- arch/ia64/mm/contig.c | 5 +++-- arch/mips/kernel/traps.c | 2 +- arch/sparc/kernel/prom_32.c | 2 +- arch/sparc/kernel/smp_64.c | 10 +++++----- arch/sparc/mm/init_32.c | 2 +- arch/sparc/mm/init_64.c | 9 ++++++--- arch/sparc/mm/srmmu.c | 10 +++++----- include/linux/bootmem.h | 8 ++++++++ 12 files changed, 36 insertions(+), 24 deletions(-)
arch/alpha/kernel/core_cia.c +1 -1
@@ -331,7 +331,7 @@ cia_prepare_tbia_workaround(int window)long i;/* Use minimal 1K map. */ - ppte =__alloc_bootmem (CIA_BROKEN_TBIA_SIZE ,32768 ,0 ); + ppte =memblock_alloc_from (CIA_BROKEN_TBIA_SIZE ,32768 ,0 ); pte = (virt_to_phys (ppte) >> (PAGE_SHIFT -1 )) |1 ;for (i =0 ; i <CIA_BROKEN_TBIA_SIZE /sizeof (unsigned long ); ++i)
arch/alpha/kernel/pci_iommu.c +2 -2
@@ -87,13 +87,13 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,printk ("%s: couldn't allocate arena ptes from node %d\n" " falling back to system-wide allocation\n" , __func__, nid); - arena->ptes = __alloc_bootmem(mem_size, align, 0); + arena->ptes = memblock_alloc_from(mem_size, align, 0); }#else /* CONFIG_DISCONTIGMEM */ arena =alloc_bootmem (sizeof (*arena)); - arena->ptes =__alloc_bootmem (mem_size, align,0 ); + arena->ptes =memblock_alloc_from (mem_size, align,0 );#endif /* CONFIG_DISCONTIGMEM */
arch/alpha/kernel/setup.c +1 -1
@@ -294,7 +294,7 @@ move_initrd(unsigned long mem_limit)unsigned long size; size = initrd_end - initrd_start; - start =__alloc_bootmem (PAGE_ALIGN (size),PAGE_SIZE ,0 ); + start =memblock_alloc_from (PAGE_ALIGN (size),PAGE_SIZE ,0 );if (!start ||__pa (start) + size > mem_limit) { initrd_start = initrd_end =0 ;return NULL ;
arch/ia64/kernel/mca.c +2 -2
@@ -1835,8 +1835,8 @@ format_mca_init_stack(void *mca_data, unsigned long offset,/* Caller prevents this from being called after init */ static void *__ref mca_bootmem (void ) { -return __alloc_bootmem (sizeof (struct ia64_mca_cpu ), -KERNEL_STACK_SIZE ,0 ); +return memblock_alloc_from (sizeof (struct ia64_mca_cpu ), +KERNEL_STACK_SIZE ,0 ); }/* Do per-CPU MCA-related initialization. */
arch/ia64/mm/contig.c +3 -2
@@ -85,8 +85,9 @@ void *per_cpu_init(void)static inline void alloc_per_cpu_data (void ) { - cpu_data =__alloc_bootmem (PERCPU_PAGE_SIZE *num_possible_cpus (), -PERCPU_PAGE_SIZE ,__pa (MAX_DMA_ADDRESS )); + cpu_data =memblock_alloc_from (PERCPU_PAGE_SIZE *num_possible_cpus (), +PERCPU_PAGE_SIZE , +__pa (MAX_DMA_ADDRESS )); }/**
arch/mips/kernel/traps.c +1 -1
@@ -2263,7 +2263,7 @@ void __init trap_init(void)memblock_set_bottom_up (true); ebase = (unsigned long ) -__alloc_bootmem (size,1 <<fls (size),0 ); +memblock_alloc_from (size,1 <<fls (size),0 );memblock_set_bottom_up (false);/*
arch/sparc/kernel/prom_32.c +1 -1
@@ -32,7 +32,7 @@ void * __init prom_early_alloc(unsigned long size) {void *ret; - ret =__alloc_bootmem (size,SMP_CACHE_BYTES ,0UL ); + ret =memblock_alloc_from (size,SMP_CACHE_BYTES ,0UL );if (ret !=NULL )memset (ret,0 , size);
arch/sparc/kernel/smp_64.c +5 -5
@@ -1588,7 +1588,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size,void *ptr;if (!node_online (node) || !NODE_DATA (node)) { - ptr =__alloc_bootmem (size, align, goal); + ptr =memblock_alloc_from (size, align, goal);pr_info ("cpu %d has no node %d or node-local memory\n" , cpu, node); pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n",
@@ -1601,7 +1601,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size, }return ptr;#else -return __alloc_bootmem (size, align, goal); +return memblock_alloc_from (size, align, goal);#endif }
@@ -1627,7 +1627,7 @@ static void __init pcpu_populate_pte(unsigned long addr)if (pgd_none (*pgd)) {pud_t *new; - new =__alloc_bootmem (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE ); + new =memblock_alloc_from (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE );pgd_populate (&init_mm, pgd, new); }
@@ -1635,7 +1635,7 @@ static void __init pcpu_populate_pte(unsigned long addr)if (pud_none (*pud)) {pmd_t *new; - new =__alloc_bootmem (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE ); + new =memblock_alloc_from (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE );pud_populate (&init_mm, pud, new); }
@@ -1643,7 +1643,7 @@ static void __init pcpu_populate_pte(unsigned long addr)if (!pmd_present (*pmd)) {pte_t *new; - new =__alloc_bootmem (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE ); + new =memblock_alloc_from (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE );pmd_populate_kernel (&init_mm, pmd, new); } }
arch/sparc/mm/init_32.c +1 -1
@@ -265,7 +265,7 @@ void __init mem_init(void) i = last_valid_pfn >> ((20 -PAGE_SHIFT ) +5 ); i +=1 ; sparc_valid_addr_bitmap = (unsigned long *) -__alloc_bootmem (i <<2 ,SMP_CACHE_BYTES ,0UL ); +memblock_alloc_from (i <<2 ,SMP_CACHE_BYTES ,0UL );if (sparc_valid_addr_bitmap ==NULL ) {prom_printf ("mem_init: Cannot alloc valid_addr_bitmap.\n" );
arch/sparc/mm/init_64.c +6 -3
@@ -1810,7 +1810,8 @@ static unsigned long __ref kernel_map_range(unsigned long pstart,if (pgd_none (*pgd)) {pud_t *new; - new =__alloc_bootmem (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE ); + new =memblock_alloc_from (PAGE_SIZE ,PAGE_SIZE , +PAGE_SIZE ); alloc_bytes +=PAGE_SIZE ;pgd_populate (&init_mm, pgd, new); }
@@ -1822,7 +1823,8 @@ static unsigned long __ref kernel_map_range(unsigned long pstart, vstart =kernel_map_hugepud (vstart, vend, pud);continue ; } - new =__alloc_bootmem (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE ); + new =memblock_alloc_from (PAGE_SIZE ,PAGE_SIZE , +PAGE_SIZE ); alloc_bytes +=PAGE_SIZE ;pud_populate (&init_mm, pud, new); }
@@ -1835,7 +1837,8 @@ static unsigned long __ref kernel_map_range(unsigned long pstart, vstart =kernel_map_hugepmd (vstart, vend, pmd);continue ; } - new =__alloc_bootmem (PAGE_SIZE ,PAGE_SIZE ,PAGE_SIZE ); + new =memblock_alloc_from (PAGE_SIZE ,PAGE_SIZE , +PAGE_SIZE ); alloc_bytes +=PAGE_SIZE ;pmd_populate_kernel (&init_mm, pmd, new); }
arch/sparc/mm/srmmu.c +5 -5
@@ -303,13 +303,13 @@ static void __init srmmu_nocache_init(void) bitmap_bits = srmmu_nocache_size >>SRMMU_NOCACHE_BITMAP_SHIFT ; - srmmu_nocache_pool =__alloc_bootmem (srmmu_nocache_size, -SRMMU_NOCACHE_ALIGN_MAX ,0UL ); + srmmu_nocache_pool =memblock_alloc_from (srmmu_nocache_size, +SRMMU_NOCACHE_ALIGN_MAX ,0UL );memset (srmmu_nocache_pool,0 , srmmu_nocache_size); srmmu_nocache_bitmap = -__alloc_bootmem (BITS_TO_LONGS (bitmap_bits) *sizeof (long ), -SMP_CACHE_BYTES ,0UL ); +memblock_alloc_from (BITS_TO_LONGS (bitmap_bits) *sizeof (long ), +SMP_CACHE_BYTES ,0UL );bit_map_init (&srmmu_nocache_map, srmmu_nocache_bitmap, bitmap_bits); srmmu_swapper_pg_dir =__srmmu_get_nocache (SRMMU_PGD_TABLE_SIZE ,SRMMU_PGD_TABLE_SIZE );
@@ -467,7 +467,7 @@ static void __init sparc_context_init(int numctx)unsigned long size; size = numctx *sizeof (struct ctx_list ); - ctx_list_pool =__alloc_bootmem (size,SMP_CACHE_BYTES ,0UL ); + ctx_list_pool =memblock_alloc_from (size,SMP_CACHE_BYTES ,0UL );for (ctx =0 ; ctx < numctx; ctx++) {struct ctx_list *clist;
include/linux/bootmem.h +8 -0
@@ -122,6 +122,14 @@ static inline void * __init memblock_alloc_raw( NUMA_NO_NODE); } +static inline void *__init memblock_alloc_from ( +phys_addr_t size,phys_addr_t align,phys_addr_t min_addr) +{ +return memblock_alloc_try_nid (size, align, min_addr, +BOOTMEM_ALLOC_ACCESSIBLE , +NUMA_NO_NODE ); +} +static inline void *__init memblock_alloc_nopanic (phys_addr_t size,phys_addr_t align) {
Signature · 1 line
2.7.4
PATCH 21/30 memblock: replace alloc_bootmem with memblock_alloc
In reply to Mike RapoportThe alloc_bootmem(size) is a shortcut for allocation of SMP_CACHE_BYTES aligned memory. When the align parameter of memblock_alloc() is 0, the alignment is implicitly set to SMP_CACHE_BYTES and thus alloc_bootmem(size) and memblock_alloc(size, 0) are equivalent.
The conversion is done using the following semantic patch:
@@
expression size;
@@
- alloc_bootmem(size)
+ memblock_alloc(size, 0)
--- arch/alpha/kernel/core_marvel.c | 4 ++-- arch/alpha/kernel/pci-noop.c | 4 ++-- arch/alpha/kernel/pci.c | 4 ++-- arch/alpha/kernel/pci_iommu.c | 4 ++-- arch/ia64/kernel/mca.c | 4 ++-- arch/ia64/mm/tlb.c | 4 ++-- arch/m68k/sun3/sun3dvma.c | 3 ++- arch/microblaze/mm/init.c | 2 +- arch/mips/kernel/setup.c | 2 +- arch/um/drivers/net_kern.c | 2 +- arch/um/drivers/vector_kern.c | 2 +- arch/um/kernel/initrd.c | 2 +- arch/x86/kernel/acpi/boot.c | 3 ++- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/e820.c | 2 +- arch/x86/platform/olpc/olpc_dt.c | 2 +- arch/xtensa/platforms/iss/network.c | 2 +- drivers/macintosh/smu.c | 2 +- init/main.c | 4 ++-- 19 files changed, 28 insertions(+), 26 deletions(-)
arch/alpha/kernel/core_marvel.c +2 -2
@@ -82,7 +82,7 @@ mk_resource_name(int pe, int port, char *str)char *name;sprintf (tmp,"PCI %s PE %d PORT %d" , str, pe, port); - name =alloc_bootmem (strlen (tmp) +1 ); + name =memblock_alloc (strlen (tmp) +1 ,0 );strcpy (name, tmp);return name;
@@ -117,7 +117,7 @@ alloc_io7(unsigned int pe)return NULL ; } - io7 =alloc_bootmem (sizeof (*io7)); + io7 =memblock_alloc (sizeof (*io7),0 ); io7->pe = pe;raw_spin_lock_init (&io7->irq_lock);
arch/alpha/kernel/pci-noop.c +2 -2
@@ -33,7 +33,7 @@ alloc_pci_controller(void) {struct pci_controller *hose; - hose =alloc_bootmem (sizeof (*hose)); + hose =memblock_alloc (sizeof (*hose),0 ); *hose_tail = hose; hose_tail = &hose->next;
@@ -44,7 +44,7 @@ alloc_pci_controller(void)struct resource *__init alloc_resource (void ) { -return alloc_bootmem (sizeof (struct resource )); +return memblock_alloc (sizeof (struct resource ),0 ); } SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus,
arch/alpha/kernel/pci.c +2 -2
@@ -392,7 +392,7 @@ alloc_pci_controller(void) {struct pci_controller *hose; - hose =alloc_bootmem (sizeof (*hose)); + hose =memblock_alloc (sizeof (*hose),0 ); *hose_tail = hose; hose_tail = &hose->next;
@@ -403,7 +403,7 @@ alloc_pci_controller(void)struct resource *__init alloc_resource (void ) { -return alloc_bootmem (sizeof (struct resource )); +return memblock_alloc (sizeof (struct resource ),0 ); }
arch/alpha/kernel/pci_iommu.c +2 -2
@@ -79,7 +79,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,printk ("%s: couldn't allocate arena from node %d\n" " falling back to system-wide allocation\n" , __func__, nid); - arena =alloc_bootmem (sizeof (*arena)); + arena =memblock_alloc (sizeof (*arena),0 ); } arena->ptes =memblock_alloc_node (sizeof (*arena), align, nid);
@@ -92,7 +92,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,#else /* CONFIG_DISCONTIGMEM */ - arena =alloc_bootmem (sizeof (*arena)); + arena =memblock_alloc (sizeof (*arena),0 ); arena->ptes =memblock_alloc_from (mem_size, align,0 );#endif /* CONFIG_DISCONTIGMEM */
arch/ia64/kernel/mca.c +2 -2
@@ -361,9 +361,9 @@ static ia64_state_log_t ia64_state_log[IA64_MAX_LOG_TYPES];#define IA64_LOG_ALLOCATE (it, size) \ {ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)] = \ - (ia64_err_rec_t *)alloc_bootmem(size); \ + (ia64_err_rec_t *)memblock_alloc(size, 0); \ ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)] = \ - (ia64_err_rec_t *)alloc_bootmem(size);} + (ia64_err_rec_t *)memblock_alloc(size, 0);}#define IA64_LOG_LOCK_INIT (it) spin_lock_init(&ia64_state_log[it].isl_lock)#define IA64_LOG_LOCK (it) spin_lock_irqsave(&ia64_state_log[it].isl_lock, s)#define IA64_LOG_UNLOCK (it) spin_unlock_irqrestore(&ia64_state_log[it].isl_lock,s)
arch/ia64/mm/tlb.c +2 -2
@@ -59,8 +59,8 @@ struct ia64_tr_entry *ia64_idtrs[NR_CPUS];void __init mmu_context_init (void ) { - ia64_ctx.bitmap =alloc_bootmem ((ia64_ctx.max_ctx+1 )>>3 ); - ia64_ctx.flushmap =alloc_bootmem ((ia64_ctx.max_ctx+1 )>>3 ); + ia64_ctx.bitmap =memblock_alloc ((ia64_ctx.max_ctx +1 ) >>3 ,0 ); + ia64_ctx.flushmap =memblock_alloc ((ia64_ctx.max_ctx +1 ) >>3 ,0 ); }/*
arch/m68k/sun3/sun3dvma.c +2 -1
@@ -267,7 +267,8 @@ void __init dvma_init(void)list_add (&(hole->list), &hole_list); - iommu_use =alloc_bootmem (IOMMU_TOTAL_ENTRIES *sizeof (unsigned long )); + iommu_use =memblock_alloc (IOMMU_TOTAL_ENTRIES *sizeof (unsigned long ), +0 );dvma_unmap_iommu (DVMA_START ,DVMA_SIZE );
arch/microblaze/mm/init.c +1 -1
@@ -377,7 +377,7 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)if (mem_init_done) p =kzalloc (size, mask);else { - p =alloc_bootmem (size); + p =memblock_alloc (size,0 );if (p)memset (p,0 , size); }
arch/mips/kernel/setup.c +1 -1
@@ -909,7 +909,7 @@ static void __init resource_init(void)if (end >=HIGHMEM_START ) end =HIGHMEM_START -1 ; - res =alloc_bootmem (sizeof (struct resource )); + res =memblock_alloc (sizeof (struct resource ),0 ); res->start = start; res->end = end;
arch/um/drivers/net_kern.c +1 -1
@@ -650,7 +650,7 @@ static int __init eth_setup(char *str)return 1 ; } - new =alloc_bootmem (sizeof (*new)); + new =memblock_alloc (sizeof (*new),0 );INIT_LIST_HEAD (&new->list); new->index = n;
arch/um/drivers/vector_kern.c +1 -1
@@ -1575,7 +1575,7 @@ static int __init vector_setup(char *str) str, error);return 1 ; } - new =alloc_bootmem (sizeof (*new)); + new =memblock_alloc (sizeof (*new),0 );INIT_LIST_HEAD (&new->list); new->unit = n; new->arguments = str;
arch/um/kernel/initrd.c +1 -1
@@ -36,7 +36,7 @@ int __init read_initrd(void)return 0 ; } - area =alloc_bootmem (size); + area =memblock_alloc (size,0 );if (load_initrd (initrd, area, size) ==-1 )return 0 ;
arch/x86/kernel/acpi/boot.c +2 -1
@@ -932,7 +932,8 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)* the resource tree during the lateinit timeframe. */ #define HPET_RESOURCE_NAME_SIZE 9 - hpet_res =alloc_bootmem (sizeof (*hpet_res) +HPET_RESOURCE_NAME_SIZE ); + hpet_res =memblock_alloc (sizeof (*hpet_res) +HPET_RESOURCE_NAME_SIZE , +0 ); hpet_res->name = (void *)&hpet_res[1 ]; hpet_res->flags =IORESOURCE_MEM ;
arch/x86/kernel/apic/io_apic.c +1 -1
@@ -2578,7 +2578,7 @@ static struct resource * __init ioapic_setup_resources(void) n =IOAPIC_RESOURCE_NAME_SIZE +sizeof (struct resource ); n *= nr_ioapics; - mem =alloc_bootmem (n); + mem =memblock_alloc (n,0 ); res = (void *)mem; mem +=sizeof (struct resource ) * nr_ioapics;
arch/x86/kernel/e820.c +1 -1
@@ -1094,7 +1094,7 @@ void __init e820__reserve_resources(void)struct resource *res;u64 end; - res =alloc_bootmem (sizeof (*res) * e820_table->nr_entries); + res =memblock_alloc (sizeof (*res) * e820_table->nr_entries,0 ); e820_res = res;for (i =0 ; i < e820_table->nr_entries; i++) {
arch/x86/platform/olpc/olpc_dt.c +1 -1
@@ -141,7 +141,7 @@ void * __init prom_early_alloc(unsigned long size)* fast enough on the platforms we care about while minimizing * wasted bootmem) and hand off chunks of it to callers. */ - res =alloc_bootmem (chunk_size); + res =memblock_alloc (chunk_size,0 );BUG_ON (!res); prom_early_allocated += chunk_size;memset (res,0 , chunk_size);
arch/xtensa/platforms/iss/network.c +1 -1
@@ -646,7 +646,7 @@ static int __init iss_net_setup(char *str)return 1 ; } - new =alloc_bootmem (sizeof (*new)); + new =memblock_alloc (sizeof (*new),0 );if (new ==NULL ) {pr_err ("Alloc_bootmem failed\n" );return 1 ;
drivers/macintosh/smu.c +1 -1
@@ -493,7 +493,7 @@ int __init smu_init (void) goto fail_np; } - smu =alloc_bootmem (sizeof (struct smu_device )); + smu =memblock_alloc (sizeof (struct smu_device ),0 );spin_lock_init (&smu->lock);INIT_LIST_HEAD (&smu->cmd_list);
init/main.c +2 -2
@@ -768,8 +768,8 @@ static int __init initcall_blacklist(char *str) str_entry =strsep (&str,"," );if (str_entry) {pr_debug ("blacklisting initcall %s\n" , str_entry); - entry =alloc_bootmem (sizeof (*entry)); - entry->buf =alloc_bootmem (strlen (str_entry) +1 ); + entry =memblock_alloc (sizeof (*entry),0 ); + entry->buf =memblock_alloc (strlen (str_entry) +1 ,0 );strcpy (entry->buf, str_entry);list_add (&entry->next, &blacklisted_initcalls); }
Signature · 1 line
2.7.4
PATCH 22/30 mm: nobootmem: remove bootmem allocation APIs
In reply to Mike RapoportThe bootmem compatibility APIs are not used and can be removed.
--- include/linux/bootmem.h | 47 ---------- mm/nobootmem.c | 224 ------------------------------------------------ 2 files changed, 271 deletions(-)
include/linux/bootmem.h +0 -47
@@ -36,33 +36,6 @@ extern void free_bootmem_node(pg_data_t *pgdat,extern void free_bootmem (unsigned long physaddr,unsigned long size);extern void free_bootmem_late (unsigned long physaddr,unsigned long size); -extern void *__alloc_bootmem (unsigned long size, -unsigned long align, -unsigned long goal); -extern void *__alloc_bootmem_nopanic (unsigned long size, -unsigned long align, -unsigned long goal) __malloc; -extern void *__alloc_bootmem_node (pg_data_t *pgdat, -unsigned long size, -unsigned long align, -unsigned long goal) __malloc; -void *__alloc_bootmem_node_high (pg_data_t *pgdat, -unsigned long size, -unsigned long align, -unsigned long goal) __malloc; -extern void *__alloc_bootmem_node_nopanic (pg_data_t *pgdat, -unsigned long size, -unsigned long align, -unsigned long goal) __malloc; -void *___alloc_bootmem_node_nopanic (pg_data_t *pgdat, -unsigned long size, -unsigned long align, -unsigned long goal, -unsigned long limit) __malloc; -extern void *__alloc_bootmem_low (unsigned long size, -unsigned long align, -unsigned long goal) __malloc; -/* We are using top down, so it is safe to use 0 here */ #define BOOTMEM_LOW_LIMIT 0
@@ -70,26 +43,6 @@ extern void *__alloc_bootmem_low(unsigned long size,#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL#endif -#define alloc_bootmem (x) \ - __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_align (x, align) \ - __alloc_bootmem(x, align, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_pages (x) \ - __alloc_bootmem(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_pages_nopanic (x) \ - __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_node (pgdat, x) \ - __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_node_nopanic (pgdat, x) \ - __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) -#define alloc_bootmem_pages_node (pgdat, x) \ - __alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) - -#define alloc_bootmem_low (x) \ - __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) -#define alloc_bootmem_low_pages (x) \ - __alloc_bootmem_low(x, PAGE_SIZE, 0) -/* FIXME: use MEMBLOCK_ALLOC_* variants here */ #define BOOTMEM_ALLOC_ACCESSIBLE 0#define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0)
mm/nobootmem.c +0 -224
233 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 23/30 memblock: replace free_bootmem{_node} with memblock_free
In reply to Mike RapoportThe free_bootmem and free_bootmem_node are merely wrappers for memblock_free. Replace their usage with a call to memblock_free using the following semantic patch:
@@
expression e1, e2, e3;
@@
(
- free_bootmem(e1, e2)
+ memblock_free(e1, e2)
|
- free_bootmem_node(e1, e2, e3)
+ memblock_free(e2, e3)
)
--- arch/alpha/kernel/core_irongate.c | 3 +-- arch/arm64/mm/init.c | 2 +- arch/mips/kernel/setup.c | 2 +- arch/powerpc/kernel/setup_64.c | 2 +- arch/sparc/kernel/smp_64.c | 2 +- arch/um/kernel/mem.c | 3 ++- arch/unicore32/mm/init.c | 2 +- arch/x86/kernel/setup_percpu.c | 3 ++- arch/x86/kernel/tce_64.c | 3 ++- arch/x86/xen/p2m.c | 3 ++- drivers/macintosh/smu.c | 2 +- drivers/usb/early/xhci-dbc.c | 11 ++++++----- drivers/xen/swiotlb-xen.c | 4 +++- include/linux/bootmem.h | 4 ---- mm/nobootmem.c | 30 ------------------------------ 15 files changed, 24 insertions(+), 52 deletions(-)
arch/alpha/kernel/core_irongate.c +1 -2
@@ -234,8 +234,7 @@ albacore_init_arch(void)unsigned long size; size = initrd_end - initrd_start; -free_bootmem_node (NODE_DATA (0 ),__pa (initrd_start), -PAGE_ALIGN (size)); +memblock_free (__pa (initrd_start),PAGE_ALIGN (size));if (!move_initrd (pci_mem)) printk("irongate_init_arch: initrd too big " "(%ldK)\ndisabling initrd\n",
arch/arm64/mm/init.c +1 -1
@@ -538,7 +538,7 @@ static inline void free_memmap(unsigned long start_pfn, unsigned long end_pfn)* memmap array. */ if (pg < pgend) -free_bootmem (pg, pgend - pg); +memblock_free (pg, pgend - pg); }/*
arch/mips/kernel/setup.c +1 -1
@@ -561,7 +561,7 @@ static void __init bootmem_init(void)extern void show_kernel_relocation (const char *level); offset =__pa_symbol (_text) -__pa_symbol (VMLINUX_LOAD_ADDRESS ); -free_bootmem (__pa_symbol (VMLINUX_LOAD_ADDRESS ), offset); +memblock_free (__pa_symbol (VMLINUX_LOAD_ADDRESS ), offset);#if defined(CONFIG_DEBUG_KERNEL ) && defined(CONFIG_DEBUG_INFO )/*
arch/powerpc/kernel/setup_64.c +1 -1
@@ -765,7 +765,7 @@ static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)static void __init pcpu_fc_free (void *ptr,size_t size) { -free_bootmem (__pa (ptr), size); +memblock_free (__pa (ptr), size); }static int pcpu_cpu_distance (unsigned int from,unsigned int to)
arch/sparc/kernel/smp_64.c +1 -1
@@ -1607,7 +1607,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size,static void __init pcpu_free_bootmem (void *ptr,size_t size) { -free_bootmem (__pa (ptr), size); +memblock_free (__pa (ptr), size); }static int __init pcpu_cpu_distance (unsigned int from,unsigned int to)
arch/um/kernel/mem.c +2 -1
@@ -6,6 +6,7 @@#include <linux/stddef.h> #include <linux/module.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <linux/mm.h> #include <linux/swap.h>
@@ -46,7 +47,7 @@ void __init mem_init(void)*/ brk_end = (unsigned long )UML_ROUND_UP (sbrk (0 ));map_memory (brk_end,__pa (brk_end), uml_reserved - brk_end,1 ,1 ,0 ); -free_bootmem (__pa (brk_end), uml_reserved - brk_end); +memblock_free (__pa (brk_end), uml_reserved - brk_end); uml_reserved = brk_end;/* this will put all low memory onto the freelists */
arch/unicore32/mm/init.c +1 -1
@@ -241,7 +241,7 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn)* free the section of the memmap array. */ if (pg < pgend) -free_bootmem (pg, pgend - pg); +memblock_free (pg, pgend - pg); }/*
arch/x86/kernel/setup_percpu.c +2 -1
@@ -5,6 +5,7 @@#include <linux/export.h> #include <linux/init.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/percpu.h> #include <linux/kexec.h> #include <linux/crash_dump.h>
@@ -135,7 +136,7 @@ static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)static void __init pcpu_fc_free (void *ptr,size_t size) { -free_bootmem (__pa (ptr), size); +memblock_free (__pa (ptr), size); }static int __init pcpu_cpu_distance (unsigned int from,unsigned int to)
arch/x86/kernel/tce_64.c +2 -1
@@ -31,6 +31,7 @@#include <linux/pci.h> #include <linux/dma-mapping.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/tce.h> #include <asm/calgary.h> #include <asm/proto.h>
@@ -186,5 +187,5 @@ void __init free_tce_table(void *tbl) size =table_size_to_number_of_entries (specified_table_size); size *=TCE_ENTRY_SIZE ; -free_bootmem (__pa (tbl), size); +memblock_free (__pa (tbl), size); }
arch/x86/xen/p2m.c +2 -1
@@ -68,6 +68,7 @@#include <linux/sched.h> #include <linux/seq_file.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/slab.h> #include <linux/vmalloc.h>
@@ -190,7 +191,7 @@ static void * __ref alloc_p2m_page(void)static void __ref free_p2m_page (void *p) {if (unlikely (!slab_is_available ())) { -free_bootmem ((unsigned long )p,PAGE_SIZE ); +memblock_free ((unsigned long )p,PAGE_SIZE );return ; }
drivers/macintosh/smu.c +1 -1
@@ -569,7 +569,7 @@ int __init smu_init (void) fail_db_node:of_node_put (smu->db_node); fail_bootmem: -free_bootmem (__pa (smu),sizeof (struct smu_device )); +memblock_free (__pa (smu),sizeof (struct smu_device )); smu =NULL ; fail_np:of_node_put (np);
drivers/usb/early/xhci-dbc.c +6 -5
@@ -13,6 +13,7 @@#include <linux/pci_regs.h> #include <linux/pci_ids.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/io.h> #include <asm/pci-direct.h> #include <asm/fixmap.h>
@@ -191,7 +192,7 @@ static void __init xdbc_free_ring(struct xdbc_ring *ring)if (!seg)return ; -free_bootmem (seg->dma,PAGE_SIZE ); +memblock_free (seg->dma,PAGE_SIZE ); ring->segment =NULL ; }
@@ -675,10 +676,10 @@ int __init early_xdbc_setup_hardware(void)xdbc_free_ring (&xdbc.in_ring);if (xdbc.table_dma) -free_bootmem (xdbc.table_dma,PAGE_SIZE ); +memblock_free (xdbc.table_dma,PAGE_SIZE );if (xdbc.out_dma) -free_bootmem (xdbc.out_dma,PAGE_SIZE ); +memblock_free (xdbc.out_dma,PAGE_SIZE ); xdbc.table_base =NULL ; xdbc.out_buf =NULL ;
@@ -1000,8 +1001,8 @@ static int __init xdbc_init(void)xdbc_free_ring (&xdbc.evt_ring);xdbc_free_ring (&xdbc.out_ring);xdbc_free_ring (&xdbc.in_ring); -free_bootmem (xdbc.table_dma,PAGE_SIZE ); -free_bootmem (xdbc.out_dma,PAGE_SIZE ); +memblock_free (xdbc.table_dma,PAGE_SIZE ); +memblock_free (xdbc.out_dma,PAGE_SIZE );writel (0 , &xdbc.xdbc_reg->control);early_iounmap (xdbc.xhci_base, xdbc.xhci_length);
drivers/xen/swiotlb-xen.c +3 -1
@@ -36,6 +36,7 @@#define pr_fmt (fmt) "xen:" KBUILD_MODNAME ": " fmt#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/dma-direct.h> #include <linux/export.h> #include <xen/swiotlb-xen.h>
@@ -248,7 +249,8 @@ int __ref xen_swiotlb_init(int verbose, bool early) xen_io_tlb_nslabs);if (rc) {if (early) -free_bootmem (__pa (xen_io_tlb_start),PAGE_ALIGN (bytes)); +memblock_free (__pa (xen_io_tlb_start), +PAGE_ALIGN (bytes));else {free_pages ((unsigned long )xen_io_tlb_start, order); xen_io_tlb_start =NULL ;
include/linux/bootmem.h +0 -4
@@ -30,10 +30,6 @@ extern unsigned long free_all_bootmem(void);extern void reset_node_managed_pages (pg_data_t *pgdat);extern void reset_all_zones_managed_pages (void ); -extern void free_bootmem_node (pg_data_t *pgdat, -unsigned long addr, -unsigned long size); -extern void free_bootmem (unsigned long physaddr,unsigned long size);extern void free_bootmem_late (unsigned long physaddr,unsigned long size);/* We are using top down, so it is safe to use 0 here */
mm/nobootmem.c +0 -30
@@ -150,33 +150,3 @@ unsigned long __init free_all_bootmem(void)return pages; } - -/** -* free_bootmem_node - mark a page range as usable -* @pgdat: node the range resides on -* @physaddr: starting physical address of the range -* @size: size of the range in bytes -* -* Partial pages will be considered reserved and left as they are. -* -* The range must reside completely on the specified node. -*/ -void __init free_bootmem_node (pg_data_t *pgdat,unsigned long physaddr, -unsigned long size) -{ -memblock_free (physaddr, size); -} - -/** -* free_bootmem - mark a page range as usable -* @addr: starting physical address of the range -* @size: size of the range in bytes -* -* Partial pages will be considered reserved and left as they are. -* -* The range must be contiguous but may span node boundaries. -*/ -void __init free_bootmem (unsigned long addr,unsigned long size) -{ -memblock_free (addr, size); -}
Signature · 1 line
2.7.4
PATCH 24/30 memblock: replace free_bootmem_late with memblock_free_late
In reply to Mike RapoportThe free_bootmem_late and memblock_free_late do exactly the same thing:
they iterate over a range and give pages to the page allocator.
Replace calls to free_bootmem_late with calls to memblock_free_late and remove the bootmem variant.
--- arch/sparc/kernel/mdesc.c | 3 ++- arch/x86/platform/efi/quirks.c | 6 +++--- drivers/firmware/efi/apple-properties.c | 2 +- include/linux/bootmem.h | 2 -- mm/nobootmem.c | 24 ------------------------ 5 files changed, 6 insertions(+), 31 deletions(-)
arch/sparc/kernel/mdesc.c +2 -1
@@ -12,6 +12,7 @@#include <linux/mm.h> #include <linux/miscdevice.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/refcount.h>
@@ -190,7 +191,7 @@ static void __init mdesc_memblock_free(struct mdesc_handle *hp) alloc_size =PAGE_ALIGN (hp->handle_size); start =__pa (hp); -free_bootmem_late (start, alloc_size); +memblock_free_late (start, alloc_size); }static struct mdesc_mem_ops memblock_mdesc_ops = {
arch/x86/platform/efi/quirks.c +3 -3
@@ -332,7 +332,7 @@ void __init efi_reserve_boot_services(void)/* * Because the following memblock_reserve() is paired -* with free_bootmem_late() for this region in +* with memblock_free_late() for this region in * efi_free_boot_services(), we must be extremely * careful not to reserve, and subsequently free, * critical regions of memory (like the kernel image) or
@@ -363,7 +363,7 @@ void __init efi_reserve_boot_services(void)* doesn't make sense as far as the firmware is * concerned, but it does provide us with a way to tag * those regions that must not be paired with -* free_bootmem_late(). +* memblock_free_late(). */ md->attribute |=EFI_MEMORY_RUNTIME ; }
@@ -413,7 +413,7 @@ void __init efi_free_boot_services(void) size -= rm_size; } -free_bootmem_late (start, size); +memblock_free_late (start, size); }if (!num_entries)
drivers/firmware/efi/apple-properties.c +1 -1
@@ -235,7 +235,7 @@ static int __init map_properties(void)*/ data->len =0 ;memunmap (data); -free_bootmem_late (pa_data +sizeof (*data), data_len); +memblock_free_late (pa_data +sizeof (*data), data_len);return ret; }
include/linux/bootmem.h +0 -2
@@ -30,8 +30,6 @@ extern unsigned long free_all_bootmem(void);extern void reset_node_managed_pages (pg_data_t *pgdat);extern void reset_all_zones_managed_pages (void ); -extern void free_bootmem_late (unsigned long physaddr,unsigned long size); -/* We are using top down, so it is safe to use 0 here */ #define BOOTMEM_LOW_LIMIT 0
mm/nobootmem.c +0 -24
@@ -33,30 +33,6 @@ unsigned long min_low_pfn;unsigned long max_pfn;unsigned long long max_possible_pfn; -/** -* free_bootmem_late - free bootmem pages directly to page allocator -* @addr: starting address of the range -* @size: size of the range in bytes -* -* This is only useful when the bootmem allocator has already been torn -* down, but we are still initializing the system. Pages are given directly -* to the page allocator, no bootmem metadata is updated because it is gone. -*/ -void __init free_bootmem_late (unsigned long addr,unsigned long size) -{ -unsigned long cursor, end; - -kmemleak_free_part_phys (addr, size); - - cursor =PFN_UP (addr); - end =PFN_DOWN (addr + size); - -for (; cursor < end; cursor++) { -__free_pages_bootmem (pfn_to_page (cursor), cursor,0 ); - totalram_pages++; - } -} -static void __init __free_pages_memory (unsigned long start,unsigned long end) {int order;
Signature · 1 line
2.7.4
PATCH 25/30 memblock: rename free_all_bootmem to memblock_free_all
In reply to Mike RapoportThe conversion is done using
sed -i 's@free_all_bootmem@memblock_free_all@' \
$(git grep -l free_all_bootmem)--- arch/alpha/mm/init.c | 2 +- arch/arc/mm/init.c | 2 +- arch/arm/mm/init.c | 2 +- arch/arm64/mm/init.c | 2 +- arch/c6x/mm/init.c | 2 +- arch/h8300/mm/init.c | 2 +- arch/hexagon/mm/init.c | 2 +- arch/ia64/mm/init.c | 2 +- arch/m68k/mm/init.c | 2 +- arch/microblaze/mm/init.c | 2 +- arch/mips/loongson64/loongson-3/numa.c | 2 +- arch/mips/mm/init.c | 2 +- arch/mips/sgi-ip27/ip27-memory.c | 2 +- arch/nds32/mm/init.c | 2 +- arch/nios2/mm/init.c | 2 +- arch/openrisc/mm/init.c | 2 +- arch/parisc/mm/init.c | 2 +- arch/powerpc/mm/mem.c | 2 +- arch/riscv/mm/init.c | 2 +- arch/s390/mm/init.c | 2 +- arch/sh/mm/init.c | 2 +- arch/sparc/mm/init_32.c | 2 +- arch/sparc/mm/init_64.c | 4 ++-- arch/um/kernel/mem.c | 2 +- arch/unicore32/mm/init.c | 2 +- arch/x86/mm/highmem_32.c | 2 +- arch/x86/mm/init_32.c | 4 ++-- arch/x86/mm/init_64.c | 4 ++-- arch/x86/xen/mmu_pv.c | 2 +- arch/xtensa/mm/init.c | 2 +- include/linux/bootmem.h | 2 +- mm/memblock.c | 2 +- mm/nobootmem.c | 4 ++-- mm/page_alloc.c | 2 +- mm/page_poison.c | 2 +- 35 files changed, 39 insertions(+), 39 deletions(-)
arch/alpha/mm/init.c +1 -1
@@ -282,7 +282,7 @@ mem_init(void) {set_max_mapnr (max_low_pfn); high_memory = (void *)__va (max_low_pfn *PAGE_SIZE ); -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); }
arch/arc/mm/init.c +1 -1
@@ -218,7 +218,7 @@ void __init mem_init(void)free_highmem_page (pfn_to_page (tmp));#endif -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); }
arch/arm/mm/init.c +1 -1
@@ -508,7 +508,7 @@ void __init mem_init(void)/* this will put all unused low memory onto the freelists */ free_unused_memmap (); -free_all_bootmem (); +memblock_free_all ();#ifdef CONFIG_SA1111 /* now that our DMA memory is actually so designated, we can free it */
arch/arm64/mm/init.c +1 -1
@@ -601,7 +601,7 @@ void __init mem_init(void)free_unused_memmap ();#endif /* this will put all unused low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();kexec_reserve_crashkres_pages ();
arch/c6x/mm/init.c +1 -1
@@ -62,7 +62,7 @@ void __init mem_init(void) high_memory = (void *)(memory_end &PAGE_MASK );/* this will put all memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); }
arch/h8300/mm/init.c +1 -1
@@ -96,7 +96,7 @@ void __init mem_init(void) max_mapnr =MAP_NR (high_memory);/* this will put all low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); }
arch/hexagon/mm/init.c +1 -1
@@ -68,7 +68,7 @@ unsigned long long kmap_generation;void __init mem_init (void ) {/* No idea where this is actually declared. Seems to evade LXR. */ -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL );/*
arch/ia64/mm/init.c +1 -1
@@ -627,7 +627,7 @@ mem_init (void)set_max_mapnr (max_low_pfn); high_memory =__va (max_low_pfn *PAGE_SIZE ); -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL );/*
arch/m68k/mm/init.c +1 -1
@@ -140,7 +140,7 @@ static inline void init_pointer_tables(void)void __init mem_init (void ) {/* this will put all memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();init_pointer_tables ();mem_init_print_info (NULL ); }
arch/microblaze/mm/init.c +1 -1
@@ -204,7 +204,7 @@ void __init mem_init(void) high_memory = (void *)__va (memory_start + lowmem_size -1 );/* this will put all memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();#ifdef CONFIG_HIGHMEM highmem_setup ();#endif
arch/mips/loongson64/loongson-3/numa.c +1 -1
@@ -272,7 +272,7 @@ void __init paging_init(void)void __init mem_init (void ) { high_memory = (void *)__va (get_num_physpages () <<PAGE_SHIFT ); -free_all_bootmem (); +memblock_free_all ();setup_zero_pages ();/* This comes from node 0 */ mem_init_print_info (NULL ); }
arch/mips/mm/init.c +1 -1
@@ -464,7 +464,7 @@ void __init mem_init(void) high_memory = (void *)__va (max_low_pfn <<PAGE_SHIFT );maar_init (); -free_all_bootmem (); +memblock_free_all ();setup_zero_pages ();/* Setup zeroed pages. */ mem_init_free_highmem ();mem_init_print_info (NULL );
arch/mips/sgi-ip27/ip27-memory.c +1 -1
@@ -475,7 +475,7 @@ void __init paging_init(void)void __init mem_init (void ) { high_memory = (void *)__va (get_num_physpages () <<PAGE_SHIFT ); -free_all_bootmem (); +memblock_free_all ();setup_zero_pages ();/* This comes from node 0 */ mem_init_print_info (NULL ); }
arch/nds32/mm/init.c +1 -1
@@ -192,7 +192,7 @@ void __init mem_init(void)free_highmem ();/* this will put all low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); pr_info("virtual kernel memory layout:\n"
arch/nios2/mm/init.c +1 -1
@@ -73,7 +73,7 @@ void __init mem_init(void) high_memory =__va (end_mem);/* this will put all memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); }
arch/openrisc/mm/init.c +1 -1
@@ -213,7 +213,7 @@ void __init mem_init(void)memset ((void *)empty_zero_page,0 ,PAGE_SIZE );/* this will put all low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL );
arch/parisc/mm/init.c +1 -1
@@ -612,7 +612,7 @@ void __init mem_init(void) high_memory =__va ((max_pfn <<PAGE_SHIFT ));set_max_mapnr (page_to_pfn (virt_to_page (high_memory -1 )) +1 ); -free_all_bootmem (); +memblock_free_all ();#ifdef CONFIG_PA11 if (boot_cpu_data.cpu_type == pcxl2 || boot_cpu_data.cpu_type == pcxl) {
arch/powerpc/mm/mem.c +1 -1
@@ -348,7 +348,7 @@ void __init mem_init(void) high_memory = (void *)__va (max_low_pfn *PAGE_SIZE );set_max_mapnr (max_pfn); -free_all_bootmem (); +memblock_free_all ();#ifdef CONFIG_HIGHMEM {
arch/riscv/mm/init.c +1 -1
@@ -55,7 +55,7 @@ void __init mem_init(void)#endif /* CONFIG_FLATMEM */ high_memory = (void *)(__va (PFN_PHYS (max_low_pfn))); -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); }
arch/s390/mm/init.c +1 -1
@@ -136,7 +136,7 @@ void __init mem_init(void)cmma_init ();/* this will put all low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();setup_zero_pages ();/* Setup zeroed pages. */ cmma_init_nodat ();
arch/sh/mm/init.c +1 -1
@@ -350,7 +350,7 @@ void __init mem_init(void) high_memory = max_t(void *, high_memory,__va (pgdat_end_pfn (pgdat) <<PAGE_SHIFT )); -free_all_bootmem (); +memblock_free_all ();/* Set this up early, so we can take care of the zero page */ cpu_cache_init ();
arch/sparc/mm/init_32.c +1 -1
@@ -277,7 +277,7 @@ void __init mem_init(void) max_mapnr = last_valid_pfn - pfn_base; high_memory =__va (max_low_pfn <<PAGE_SHIFT ); -free_all_bootmem (); +memblock_free_all ();for (i =0 ; sp_banks[i].num_bytes !=0 ; i++) {unsigned long start_pfn = sp_banks[i].base_addr >>PAGE_SHIFT ;
arch/sparc/mm/init_64.c +2 -2
@@ -2544,12 +2544,12 @@ void __init mem_init(void) { high_memory =__va (last_valid_pfn <<PAGE_SHIFT ); -free_all_bootmem (); +memblock_free_all ();/* * Must be done after boot memory is put on freelist, because here we * might set fields in deferred struct pages that have not yet been -* initialized, and free_all_bootmem() initializes all the reserved +* initialized, and memblock_free_all() initializes all the reserved * deferred pages for us. */ register_page_bootmem_info ();
arch/um/kernel/mem.c +1 -1
@@ -51,7 +51,7 @@ void __init mem_init(void) uml_reserved = brk_end;/* this will put all low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all (); max_low_pfn = totalram_pages; max_pfn = totalram_pages;mem_init_print_info (NULL );
arch/unicore32/mm/init.c +1 -1
@@ -289,7 +289,7 @@ void __init mem_init(void)free_unused_memmap (&meminfo);/* this will put all unused low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); printk(KERN_NOTICE "Virtual kernel memory layout:\n"
arch/x86/mm/highmem_32.c +1 -1
@@ -111,7 +111,7 @@ void __init set_highmem_pages_init(void)/* * Explicitly reset zone->managed_pages because set_highmem_pages_init() -* is invoked before free_all_bootmem() +* is invoked before memblock_free_all() */ reset_all_zones_managed_pages ();for_each_zone (zone) {
arch/x86/mm/init_32.c +2 -2
@@ -771,7 +771,7 @@ void __init mem_init(void)#endif /* * With CONFIG_DEBUG_PAGEALLOC initialization of highmem pages has to -* be done before free_all_bootmem(). Memblock use free low memory for +* be done before memblock_free_all(). Memblock use free low memory for * temporary data (see find_range_array()) and for this purpose can use * pages that was already passed to the buddy allocator, hence marked as * not accessible in the page tables when compiled with
@@ -781,7 +781,7 @@ void __init mem_init(void)set_highmem_pages_init ();/* this will put all low memory onto the freelists */ -free_all_bootmem (); +memblock_free_all (); after_bootmem =1 ; x86_init.hyper.init_after_bootmem ();
arch/x86/mm/init_64.c +2 -2
@@ -1188,14 +1188,14 @@ void __init mem_init(void)/* clear_bss() already clear the empty_zero_page */ /* this will put all memory onto the freelists */ -free_all_bootmem (); +memblock_free_all (); after_bootmem =1 ; x86_init.hyper.init_after_bootmem ();/* * Must be done after boot memory is put on freelist, because here we * might set fields in deferred struct pages that have not yet been -* initialized, and free_all_bootmem() initializes all the reserved +* initialized, and memblock_free_all() initializes all the reserved * deferred pages for us. */ register_page_bootmem_info ();
arch/x86/xen/mmu_pv.c +1 -1
@@ -864,7 +864,7 @@ static int __init xen_mark_pinned(struct mm_struct *mm, struct page *page,* The init_mm pagetable is really pinned as soon as its created, but * that's before we have page structures to store the bits. So do all * the book-keeping now once struct pages for allocated pages are -* initialized. This happens only after free_all_bootmem() is called. +* initialized. This happens only after memblock_free_all() is called. */ static void __init xen_after_bootmem (void ) {
arch/xtensa/mm/init.c +1 -1
@@ -152,7 +152,7 @@ void __init mem_init(void) max_mapnr = max_pfn -ARCH_PFN_OFFSET ; high_memory = (void *)__va (max_low_pfn <<PAGE_SHIFT ); -free_all_bootmem (); +memblock_free_all ();mem_init_print_info (NULL ); pr_info("virtual kernel memory layout:\n"
include/linux/bootmem.h +1 -1
@@ -26,7 +26,7 @@ extern unsigned long max_pfn;*/ extern unsigned long long max_possible_pfn; -extern unsigned long free_all_bootmem (void ); +extern unsigned long memblock_free_all (void );extern void reset_node_managed_pages (pg_data_t *pgdat);extern void reset_all_zones_managed_pages (void );
mm/memblock.c +1 -1
@@ -1411,7 +1411,7 @@ static void * __init memblock_alloc_internal(/* * Detect any accidental use of these APIs after slab is ready, as at * this moment memblock may be deinitialized already and its -* internal data may be destroyed (after execution of free_all_bootmem) +* internal data may be destroyed (after execution of memblock_free_all) */ if (WARN_ON_ONCE (slab_is_available ()))return kzalloc_node (size,GFP_NOWAIT , nid);
mm/nobootmem.c +2 -2
@@ -111,11 +111,11 @@ void __init reset_all_zones_managed_pages(void) }/** -* free_all_bootmem - release free pages to the buddy allocator +* memblock_free_all - release free pages to the buddy allocator * * Return: the number of pages actually released. */ -unsigned long __init free_all_bootmem (void ) +unsigned long __init memblock_free_all (void ) {unsigned long pages;
mm/page_alloc.c +1 -1
@@ -5472,7 +5472,7 @@ overlap_memmap_init(unsigned long zone, unsigned long *pfn)/* * Initially all pages are reserved - free ones are freed -* up by free_all_bootmem() once the early boot process is +* up by memblock_free_all() once the early boot process is * done. Non-atomic initialization, single-pass. */ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
mm/page_poison.c +1 -1
@@ -21,7 +21,7 @@ bool page_poisoning_enabled(void) {/* * Assumes that debug_pagealloc_enabled is set before -* free_all_bootmem. +* memblock_free_all. * Page poisoning is debug page alloc for some arches. If * either of those options are enabled, enable poisoning. */
Signature · 1 line
2.7.4
PATCH 26/30 memblock: rename __free_pages_bootmem to memblock_free_pages
In reply to Mike RapoportThe conversion is done using
sed -i 's@__free_pages_bootmem@memblock_free_pages@' \
$(git grep -l __free_pages_bootmem)--- mm/internal.h | 2 +- mm/memblock.c | 2 +- mm/nobootmem.c | 2 +- mm/page_alloc.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
mm/internal.h +1 -1
@@ -161,7 +161,7 @@ static inline struct page *pageblock_pfn_to_page(unsigned long start_pfn, }extern int __isolate_free_page (struct page *page,unsigned int order); -extern void __free_pages_bootmem (struct page *page,unsigned long pfn, +extern void memblock_free_pages (struct page *page,unsigned long pfn,unsigned int order);extern void prep_compound_page (struct page *page,unsigned int order); extern void post_alloc_hook(struct page *page, unsigned int order,
mm/memblock.c +1 -1
@@ -1615,7 +1615,7 @@ void __init __memblock_free_late(phys_addr_t base, phys_addr_t size) end =PFN_DOWN (base + size);for (; cursor < end; cursor++) { -__free_pages_bootmem (pfn_to_page (cursor), cursor,0 ); +memblock_free_pages (pfn_to_page (cursor), cursor,0 ); totalram_pages++; } }
mm/nobootmem.c +1 -1
@@ -43,7 +43,7 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end)while (start + (1UL << order) > end) order--; -__free_pages_bootmem (pfn_to_page (start), start, order); +memblock_free_pages (pfn_to_page (start), start, order); start += (1UL << order); }
mm/page_alloc.c +1 -1
@@ -1334,7 +1334,7 @@ meminit_pfn_in_nid(unsigned long pfn, int node,#endif -void __init __free_pages_bootmem (struct page *page,unsigned long pfn, +void __init memblock_free_pages (struct page *page,unsigned long pfn,unsigned int order) {if (early_page_uninitialised (pfn))
Signature · 1 line
2.7.4
PATCH 27/30 mm: remove nobootmem
In reply to Mike RapoportMove a few remaining functions from nobootmem.c to memblock.c and remove nobootmem
--- mm/Makefile | 1 - mm/memblock.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++ mm/nobootmem.c | 128 --------------------------------------------------------- 3 files changed, 104 insertions(+), 129 deletions(-) delete mode 100644 mm/nobootmem.c
mm/Makefile +0 -1
@@ -42,7 +42,6 @@ obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ debug.o $(mmu-y) obj-y += init-mm.o -obj-y += nobootmem.o obj-y += memblock.o ifdef CONFIG_MMU
mm/memblock.c +104 -0
116 lines not on this page · raw message
mm/nobootmem.c deleted +0 -128
128 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 28/30 memblock: replace BOOTMEM_ALLOC_* with MEMBLOCK variants
In reply to Mike RapoportDrop BOOTMEM_ALLOC_ACCESSIBLE and BOOTMEM_ALLOC_ANYWHERE in favor of identical MEMBLOCK definitions.
--- arch/ia64/mm/discontig.c | 2 +- arch/powerpc/kernel/setup_64.c | 2 +- arch/sparc/kernel/smp_64.c | 2 +- arch/x86/kernel/setup_percpu.c | 2 +- arch/x86/mm/kasan_init_64.c | 4 ++-- mm/hugetlb.c | 3 ++- mm/kasan/kasan_init.c | 2 +- mm/memblock.c | 8 ++++---- mm/page_ext.c | 2 +- mm/sparse-vmemmap.c | 3 ++- mm/sparse.c | 5 +++-- 11 files changed, 19 insertions(+), 16 deletions(-)
arch/ia64/mm/discontig.c +1 -1
@@ -453,7 +453,7 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize) ptr =memblock_alloc_try_nid (pernodesize,PERCPU_PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ), -BOOTMEM_ALLOC_ACCESSIBLE , +MEMBLOCK_ALLOC_ACCESSIBLE , bestnode);return ptr;
arch/powerpc/kernel/setup_64.c +1 -1
@@ -758,7 +758,7 @@ void __init emergency_stack_init(void)static void *__init pcpu_fc_alloc (unsigned int cpu,size_t size,size_t align) {return memblock_alloc_try_nid (size, align,__pa (MAX_DMA_ADDRESS ), -BOOTMEM_ALLOC_ACCESSIBLE , +MEMBLOCK_ALLOC_ACCESSIBLE ,early_cpu_to_node (cpu)); }
arch/sparc/kernel/smp_64.c +1 -1
@@ -1595,7 +1595,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size, cpu, size, __pa(ptr)); }else { ptr =memblock_alloc_try_nid (size, align, goal, -BOOTMEM_ALLOC_ACCESSIBLE , node); +MEMBLOCK_ALLOC_ACCESSIBLE , node);pr_debug ("per cpu data for cpu%d %lu bytes on node%d at " "%016lx\n" , cpu, size, node,__pa (ptr)); }
arch/x86/kernel/setup_percpu.c +1 -1
@@ -114,7 +114,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, cpu, size, __pa(ptr)); }else { ptr =memblock_alloc_try_nid_nopanic (size, align, goal, -BOOTMEM_ALLOC_ACCESSIBLE , +MEMBLOCK_ALLOC_ACCESSIBLE , node); pr_debug("per cpu data for cpu%d %lu bytes on node%d at %016lx\n",
arch/x86/mm/kasan_init_64.c +2 -2
@@ -29,10 +29,10 @@ static __init void *early_alloc(size_t size, int nid, bool panic) {if (panic)return memblock_alloc_try_nid (size, size, -__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid); +__pa (MAX_DMA_ADDRESS ),MEMBLOCK_ALLOC_ACCESSIBLE , nid);else return memblock_alloc_try_nid_nopanic (size, size, -__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid); +__pa (MAX_DMA_ADDRESS ),MEMBLOCK_ALLOC_ACCESSIBLE , nid); } static void __init kasan_populate_pmd(pmd_t *pmd, unsigned long addr,
mm/hugetlb.c +2 -1
@@ -16,6 +16,7 @@#include <linux/cpuset.h> #include <linux/mutex.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/sysfs.h> #include <linux/slab.h> #include <linux/mmdebug.h>
@@ -2102,7 +2103,7 @@ int __alloc_bootmem_huge_page(struct hstate *h) addr =memblock_alloc_try_nid_raw (huge_page_size (h),huge_page_size (h), -0 ,BOOTMEM_ALLOC_ACCESSIBLE , node); +0 ,MEMBLOCK_ALLOC_ACCESSIBLE , node);if (addr) {/* * Use the beginning of the huge page to store the
mm/kasan/kasan_init.c +1 -1
@@ -84,7 +84,7 @@ static inline bool kasan_zero_page_entry(pte_t pte)static __init void *early_alloc (size_t size,int node) {return memblock_alloc_try_nid (size, size,__pa (MAX_DMA_ADDRESS ), -BOOTMEM_ALLOC_ACCESSIBLE , node); +MEMBLOCK_ALLOC_ACCESSIBLE , node); } static void __ref zero_pte_populate(pmd_t *pmd, unsigned long addr,
mm/memblock.c +4 -4
@@ -1393,7 +1393,7 @@ phys_addr_t __init memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t ali* hold the requested memory. * * The allocation is performed from memory region limited by -* memblock.current_limit if @max_addr == %BOOTMEM_ALLOC_ACCESSIBLE. +* memblock.current_limit if @max_addr == %MEMBLOCK_ALLOC_ACCESSIBLE. * * The memory block is aligned on %SMP_CACHE_BYTES if @align == 0. *
@@ -1480,7 +1480,7 @@ static void * __init memblock_alloc_internal(* @min_addr: the lower bound of the memory region from where the allocation * is preferred (phys address) * @max_addr: the upper bound of the memory region from where the allocation -* is preferred (phys address), or %BOOTMEM_ALLOC_ACCESSIBLE to +* is preferred (phys address), or %MEMBLOCK_ALLOC_ACCESSIBLE to * allocate only from memory limited by memblock.current_limit value * @nid: nid of the free area to find, %NUMA_NO_NODE for any node *
@@ -1518,7 +1518,7 @@ void * __init memblock_alloc_try_nid_raw(* @min_addr: the lower bound of the memory region from where the allocation * is preferred (phys address) * @max_addr: the upper bound of the memory region from where the allocation -* is preferred (phys address), or %BOOTMEM_ALLOC_ACCESSIBLE to +* is preferred (phys address), or %MEMBLOCK_ALLOC_ACCESSIBLE to * allocate only from memory limited by memblock.current_limit value * @nid: nid of the free area to find, %NUMA_NO_NODE for any node *
@@ -1553,7 +1553,7 @@ void * __init memblock_alloc_try_nid_nopanic(* @min_addr: the lower bound of the memory region from where the allocation * is preferred (phys address) * @max_addr: the upper bound of the memory region from where the allocation -* is preferred (phys address), or %BOOTMEM_ALLOC_ACCESSIBLE to +* is preferred (phys address), or %MEMBLOCK_ALLOC_ACCESSIBLE to * allocate only from memory limited by memblock.current_limit value * @nid: nid of the free area to find, %NUMA_NO_NODE for any node *
mm/page_ext.c +1 -1
@@ -163,7 +163,7 @@ static int __init alloc_node_page_ext(int nid) base =memblock_alloc_try_nid_nopanic ( table_size,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ), -BOOTMEM_ALLOC_ACCESSIBLE , nid); +MEMBLOCK_ALLOC_ACCESSIBLE , nid);if (!base)return -ENOMEM ;NODE_DATA (nid)->node_page_ext = base;
mm/sparse-vmemmap.c +2 -1
@@ -21,6 +21,7 @@#include <linux/mm.h> #include <linux/mmzone.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/memremap.h> #include <linux/highmem.h> #include <linux/slab.h>
@@ -43,7 +44,7 @@ static void * __ref __earlyonly_bootmem_alloc(int node, unsigned long goal) {return memblock_alloc_try_nid_raw (size, align, goal, -BOOTMEM_ALLOC_ACCESSIBLE , node); +MEMBLOCK_ALLOC_ACCESSIBLE , node); }void *__meminit vmemmap_alloc_block (unsigned long size,int node)
mm/sparse.c +3 -2
@@ -6,6 +6,7 @@#include <linux/slab.h> #include <linux/mmzone.h> #include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/compiler.h> #include <linux/highmem.h> #include <linux/export.h>
@@ -393,7 +394,7 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid, map =memblock_alloc_try_nid (size,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ), -BOOTMEM_ALLOC_ACCESSIBLE , nid); +MEMBLOCK_ALLOC_ACCESSIBLE , nid); return map; }#endif /* !CONFIG_SPARSEMEM_VMEMMAP */
@@ -407,7 +408,7 @@ static void __init sparse_buffer_init(unsigned long size, int nid) sparsemap_buf =memblock_alloc_try_nid_raw (size,PAGE_SIZE ,__pa (MAX_DMA_ADDRESS ), -BOOTMEM_ALLOC_ACCESSIBLE , nid); +MEMBLOCK_ALLOC_ACCESSIBLE , nid); sparsemap_buf_end = sparsemap_buf + size; }
Signature · 1 line
2.7.4
PATCH 29/30 mm: remove include/linux/bootmem.h
In reply to Mike RapoportMove remaining definitions and declarations from include/linux/bootmem.h into include/linux/memblock.h and remove the redundant header.
The includes were replaced with the semantic patch below and then semi-automated removal of duplicated '#include <linux/memblock.h>
@@
@@
- #include <linux/bootmem.h>
+ #include <linux/memblock.h>
--- arch/alpha/kernel/core_cia.c | 2 +- arch/alpha/kernel/core_irongate.c | 1 - arch/alpha/kernel/core_marvel.c | 2 +- arch/alpha/kernel/core_titan.c | 2 +- arch/alpha/kernel/core_tsunami.c | 2 +- arch/alpha/kernel/pci-noop.c | 2 +- arch/alpha/kernel/pci.c | 2 +- arch/alpha/kernel/pci_iommu.c | 2 +- arch/alpha/kernel/setup.c | 1 - arch/alpha/kernel/sys_nautilus.c | 2 +- arch/alpha/mm/init.c | 2 +- arch/alpha/mm/numa.c | 1 - arch/arc/kernel/unwind.c | 2 +- arch/arc/mm/highmem.c | 2 +- arch/arc/mm/init.c | 1 - arch/arm/kernel/devtree.c | 1 - arch/arm/kernel/setup.c | 1 - arch/arm/mach-omap2/omap_hwmod.c | 2 +- arch/arm/mm/dma-mapping.c | 1 - arch/arm/mm/init.c | 1 - arch/arm/xen/mm.c | 1 - arch/arm/xen/p2m.c | 2 +- arch/arm64/kernel/acpi.c | 1 - arch/arm64/kernel/acpi_numa.c | 1 - arch/arm64/kernel/setup.c | 1 - arch/arm64/mm/dma-mapping.c | 2 +- arch/arm64/mm/init.c | 1 - arch/arm64/mm/kasan_init.c | 1 - arch/arm64/mm/numa.c | 1 - arch/c6x/kernel/setup.c | 1 - arch/c6x/mm/init.c | 2 +- arch/h8300/kernel/setup.c | 1 - arch/h8300/mm/init.c | 2 +- arch/hexagon/kernel/dma.c | 2 +- arch/hexagon/kernel/setup.c | 2 +- arch/hexagon/mm/init.c | 1 - arch/ia64/kernel/crash.c | 2 +- arch/ia64/kernel/efi.c | 2 +- arch/ia64/kernel/ia64_ksyms.c | 2 +- arch/ia64/kernel/iosapic.c | 2 +- arch/ia64/kernel/mca.c | 2 +- arch/ia64/kernel/mca_drv.c | 2 +- arch/ia64/kernel/setup.c | 1 - arch/ia64/kernel/smpboot.c | 2 +- arch/ia64/kernel/topology.c | 2 +- arch/ia64/kernel/unwind.c | 2 +- arch/ia64/mm/contig.c | 1 - arch/ia64/mm/discontig.c | 1 - arch/ia64/mm/init.c | 1 - arch/ia64/mm/numa.c | 2 +- arch/ia64/mm/tlb.c | 2 +- arch/ia64/pci/pci.c | 2 +- arch/ia64/sn/kernel/bte.c | 2 +- arch/ia64/sn/kernel/io_common.c | 2 +- arch/ia64/sn/kernel/setup.c | 2 +- arch/m68k/atari/stram.c | 2 +- arch/m68k/coldfire/m54xx.c | 2 +- arch/m68k/kernel/setup_mm.c | 1 - arch/m68k/kernel/setup_no.c | 1 - arch/m68k/kernel/uboot.c | 2 +- arch/m68k/mm/init.c | 2 +- arch/m68k/mm/mcfmmu.c | 1 - arch/m68k/mm/motorola.c | 1 - arch/m68k/mm/sun3mmu.c | 2 +- arch/m68k/sun3/config.c | 2 +- arch/m68k/sun3/dvma.c | 2 +- arch/m68k/sun3/mmu_emu.c | 2 +- arch/m68k/sun3/sun3dvma.c | 2 +- arch/m68k/sun3x/dvma.c | 2 +- arch/microblaze/mm/consistent.c | 2 +- arch/microblaze/mm/init.c | 3 +- arch/microblaze/pci/pci-common.c | 2 +- arch/mips/ar7/memory.c | 2 +- arch/mips/ath79/setup.c | 2 +- arch/mips/bcm63xx/prom.c | 2 +- arch/mips/bcm63xx/setup.c | 2 +- arch/mips/bmips/setup.c | 2 +- arch/mips/cavium-octeon/dma-octeon.c | 2 +- arch/mips/dec/prom/memory.c | 2 +- arch/mips/emma/common/prom.c | 2 +- arch/mips/fw/arc/memory.c | 2 +- arch/mips/jazz/jazzdma.c | 2 +- arch/mips/kernel/crash.c | 2 +- arch/mips/kernel/crash_dump.c | 2 +- arch/mips/kernel/prom.c | 2 +- arch/mips/kernel/setup.c | 1 - arch/mips/kernel/traps.c | 1 - arch/mips/kernel/vpe.c | 2 +- arch/mips/kvm/commpage.c | 2 +- arch/mips/kvm/dyntrans.c | 2 +- arch/mips/kvm/emulate.c | 2 +- arch/mips/kvm/interrupt.c | 2 +- arch/mips/kvm/mips.c | 2 +- arch/mips/lantiq/prom.c | 2 +- arch/mips/lasat/prom.c | 2 +- arch/mips/loongson64/common/init.c | 2 +- arch/mips/loongson64/loongson-3/numa.c | 1 - arch/mips/mm/init.c | 2 +- arch/mips/mm/pgtable-32.c | 2 +- arch/mips/mti-malta/malta-memory.c | 2 +- arch/mips/netlogic/xlp/dt.c | 2 +- arch/mips/pci/pci-legacy.c | 2 +- arch/mips/pci/pci.c | 2 +- arch/mips/ralink/of.c | 2 +- arch/mips/rb532/prom.c | 2 +- arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/mips/sibyte/common/cfe.c | 2 +- arch/mips/sibyte/swarm/setup.c | 2 +- arch/mips/txx9/rbtx4938/prom.c | 2 +- arch/nds32/kernel/setup.c | 3 +- arch/nds32/mm/highmem.c | 2 +- arch/nds32/mm/init.c | 3 +- arch/nios2/kernel/prom.c | 2 +- arch/nios2/kernel/setup.c | 1 - arch/nios2/mm/init.c | 2 +- arch/openrisc/kernel/setup.c | 3 +- arch/openrisc/mm/init.c | 3 +- arch/parisc/mm/init.c | 1 - arch/powerpc/kernel/pci_32.c | 2 +- arch/powerpc/kernel/setup_64.c | 3 +- arch/powerpc/lib/alloc.c | 2 +- arch/powerpc/mm/hugetlbpage.c | 1 - arch/powerpc/mm/mem.c | 3 +- arch/powerpc/mm/mmu_context_nohash.c | 2 +- arch/powerpc/mm/numa.c | 3 +- arch/powerpc/platforms/powermac/nvram.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 3 +- arch/powerpc/platforms/ps3/setup.c | 2 +- arch/powerpc/sysdev/msi_bitmap.c | 2 +- arch/riscv/mm/init.c | 3 +- arch/s390/kernel/crash_dump.c | 3 +- arch/s390/kernel/setup.c | 1 - arch/s390/kernel/smp.c | 3 +- arch/s390/kernel/topology.c | 2 +- arch/s390/kernel/vdso.c | 2 +- arch/s390/mm/extmem.c | 2 +- arch/s390/mm/init.c | 3 +- arch/s390/mm/vmem.c | 3 +- arch/s390/numa/mode_emu.c | 1 - arch/s390/numa/numa.c | 1 - arch/s390/numa/toptree.c | 2 +- arch/sh/mm/init.c | 3 +- arch/sh/mm/ioremap_fixed.c | 2 +- arch/sparc/kernel/mdesc.c | 2 - arch/sparc/kernel/prom_32.c | 2 +- arch/sparc/kernel/setup_64.c | 2 +- arch/sparc/kernel/smp_64.c | 2 +- arch/sparc/mm/init_32.c | 1 - arch/sparc/mm/init_64.c | 3 +- arch/sparc/mm/srmmu.c | 2 +- arch/um/drivers/net_kern.c | 2 +- arch/um/drivers/vector_kern.c | 2 +- arch/um/kernel/initrd.c | 2 +- arch/um/kernel/mem.c | 1 - arch/um/kernel/physmem.c | 1 - arch/unicore32/kernel/hibernate.c | 2 +- arch/unicore32/kernel/setup.c | 3 +- arch/unicore32/mm/init.c | 3 +- arch/unicore32/mm/mmu.c | 1 - arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/acpi/sleep.c | 1 - arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/e820.c | 3 +- arch/x86/kernel/mpparse.c | 1 - arch/x86/kernel/pci-dma.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/kernel/pvclock.c | 2 +- arch/x86/kernel/setup.c | 1 - arch/x86/kernel/setup_percpu.c | 1 - arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/tce_64.c | 1 - arch/x86/mm/amdtopology.c | 1 - arch/x86/mm/fault.c | 2 +- arch/x86/mm/highmem_32.c | 2 +- arch/x86/mm/init.c | 1 - arch/x86/mm/init_32.c | 1 - arch/x86/mm/init_64.c | 1 - arch/x86/mm/ioremap.c | 2 +- arch/x86/mm/kasan_init_64.c | 3 +- arch/x86/mm/numa.c | 1 - arch/x86/mm/numa_32.c | 1 - arch/x86/mm/numa_64.c | 2 +- arch/x86/mm/numa_emulation.c | 1 - arch/x86/mm/pageattr-test.c | 2 +- arch/x86/mm/pageattr.c | 2 +- arch/x86/mm/pat.c | 2 +- arch/x86/mm/physaddr.c | 2 +- arch/x86/pci/i386.c | 2 +- arch/x86/platform/efi/efi.c | 3 +- arch/x86/platform/efi/efi_64.c | 2 +- arch/x86/platform/efi/quirks.c | 1 - arch/x86/platform/olpc/olpc_dt.c | 2 +- arch/x86/power/hibernate_32.c | 2 +- arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/enlighten_pv.c | 3 +- arch/x86/xen/p2m.c | 1 - arch/xtensa/kernel/pci.c | 2 +- arch/xtensa/mm/cache.c | 2 +- arch/xtensa/mm/init.c | 2 +- arch/xtensa/mm/kasan_init.c | 3 +- arch/xtensa/mm/mmu.c | 2 +- arch/xtensa/platforms/iss/network.c | 2 +- arch/xtensa/platforms/iss/setup.c | 2 +- block/blk-settings.c | 2 +- block/bounce.c | 2 +- drivers/acpi/numa.c | 1 - drivers/acpi/tables.c | 3 +- drivers/base/platform.c | 2 +- drivers/clk/ti/clk.c | 2 +- drivers/firmware/dmi_scan.c | 2 +- drivers/firmware/efi/apple-properties.c | 2 +- drivers/firmware/iscsi_ibft_find.c | 2 +- drivers/firmware/memmap.c | 2 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- drivers/macintosh/smu.c | 3 +- drivers/mtd/ar7part.c | 2 +- drivers/net/arcnet/arc-rimi.c | 2 +- drivers/net/arcnet/com20020-isa.c | 2 +- drivers/net/arcnet/com90io.c | 2 +- drivers/of/fdt.c | 1 - drivers/of/unittest.c | 2 +- drivers/s390/char/fs3270.c | 2 +- drivers/s390/char/tty3270.c | 2 +- drivers/s390/cio/cmf.c | 2 +- drivers/s390/virtio/virtio_ccw.c | 2 +- drivers/sfi/sfi_core.c | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- drivers/usb/early/xhci-dbc.c | 1 - drivers/xen/balloon.c | 2 +- drivers/xen/events/events_base.c | 2 +- drivers/xen/grant-table.c | 2 +- drivers/xen/swiotlb-xen.c | 1 - drivers/xen/xen-selfballoon.c | 2 +- fs/dcache.c | 2 +- fs/inode.c | 2 +- fs/namespace.c | 2 +- fs/proc/kcore.c | 2 +- fs/proc/page.c | 2 +- fs/proc/vmcore.c | 2 +- include/linux/bootmem.h | 173 ---------------------------- include/linux/memblock.h | 151 +++++++++++++++++++++++- init/main.c | 2 +- kernel/dma/swiotlb.c | 2 +- kernel/futex.c | 2 +- kernel/locking/qspinlock_paravirt.h | 2 +- kernel/pid.c | 2 +- kernel/power/snapshot.c | 2 +- kernel/printk/printk.c | 1 - kernel/profile.c | 2 +- lib/cpumask.c | 2 +- mm/hugetlb.c | 1 - mm/kasan/kasan_init.c | 3 +- mm/kmemleak.c | 2 +- mm/memblock.c | 1 - mm/memory_hotplug.c | 1 - mm/page_alloc.c | 1 - mm/page_ext.c | 2 +- mm/page_idle.c | 2 +- mm/page_owner.c | 2 +- mm/percpu.c | 2 +- mm/sparse-vmemmap.c | 1 - mm/sparse.c | 1 - net/ipv4/inet_hashtables.c | 2 +- net/ipv4/tcp.c | 2 +- net/ipv4/udp.c | 2 +- net/sctp/protocol.c | 2 +- net/xfrm/xfrm_hash.c | 2 +- 272 files changed, 351 insertions(+), 474 deletions(-) delete mode 100644 include/linux/bootmem.h
arch/alpha/kernel/core_cia.c +1 -1
@@ -21,7 +21,7 @@#include <linux/pci.h> #include <linux/sched.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/ptrace.h> #include <asm/mce.h>
arch/alpha/kernel/core_irongate.c +0 -1
@@ -20,7 +20,6 @@#include <linux/sched.h> #include <linux/init.h> #include <linux/initrd.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <asm/ptrace.h>
arch/alpha/kernel/core_marvel.c +1 -1
@@ -18,7 +18,7 @@#include <linux/mc146818rtc.h> #include <linux/rtc.h> #include <linux/module.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/ptrace.h> #include <asm/smp.h>
arch/alpha/kernel/core_titan.c +1 -1
@@ -16,7 +16,7 @@#include <linux/sched.h> #include <linux/init.h> #include <linux/vmalloc.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/ptrace.h> #include <asm/smp.h>
arch/alpha/kernel/core_tsunami.c +1 -1
@@ -17,7 +17,7 @@#include <linux/pci.h> #include <linux/sched.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/ptrace.h> #include <asm/smp.h>
arch/alpha/kernel/pci-noop.c +1 -1
@@ -7,7 +7,7 @@#include <linux/pci.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/gfp.h> #include <linux/capability.h> #include <linux/mm.h>
arch/alpha/kernel/pci.c +1 -1
@@ -18,7 +18,7 @@#include <linux/init.h> #include <linux/ioport.h> #include <linux/kernel.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/module.h> #include <linux/cache.h> #include <linux/slab.h>
arch/alpha/kernel/pci_iommu.c +1 -1
@@ -7,7 +7,7 @@#include <linux/mm.h> #include <linux/pci.h> #include <linux/gfp.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/scatterlist.h> #include <linux/log2.h>
arch/alpha/kernel/setup.c +0 -1
@@ -29,7 +29,6 @@#include <linux/string.h> #include <linux/ioport.h> #include <linux/platform_device.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/pci.h> #include <linux/seq_file.h>
arch/alpha/kernel/sys_nautilus.c +1 -1
@@ -32,7 +32,7 @@#include <linux/pci.h> #include <linux/init.h> #include <linux/reboot.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/bitops.h> #include <asm/ptrace.h>
arch/alpha/mm/init.c +1 -1
@@ -19,7 +19,7 @@#include <linux/mm.h> #include <linux/swap.h> #include <linux/init.h> -#include <linux/bootmem.h> /* max_low_pfn */ +#include <linux/memblock.h> /* max_low_pfn */ #include <linux/vmalloc.h> #include <linux/gfp.h>
arch/alpha/mm/numa.c +0 -1
@@ -10,7 +10,6 @@#include <linux/types.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/swap.h> #include <linux/initrd.h>
arch/arc/kernel/unwind.c +1 -1
@@ -15,7 +15,7 @@#include <linux/sched.h> #include <linux/module.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/sort.h> #include <linux/slab.h> #include <linux/stop_machine.h>
arch/arc/mm/highmem.c +1 -1
@@ -7,7 +7,7 @@* */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/highmem.h> #include <asm/processor.h>
arch/arc/mm/init.c +0 -1
@@ -8,7 +8,6 @@#include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #ifdef CONFIG_BLK_DEV_INITRD #include <linux/initrd.h>
arch/arm/kernel/devtree.c +0 -1
@@ -12,7 +12,6 @@#include <linux/export.h> #include <linux/errno.h> #include <linux/types.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/of.h> #include <linux/of_fdt.h>
arch/arm/kernel/setup.c +0 -1
@@ -16,7 +16,6 @@#include <linux/utsname.h> #include <linux/initrd.h> #include <linux/console.h> -#include <linux/bootmem.h> #include <linux/seq_file.h> #include <linux/screen_info.h> #include <linux/of_platform.h>
arch/arm/mach-omap2/omap_hwmod.c +1 -1
@@ -141,7 +141,7 @@#include <linux/cpu.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/platform_data/ti-sysc.h>
arch/arm/mm/dma-mapping.c +0 -1
@@ -9,7 +9,6 @@* * DMA uncached mapping support. */ -#include <linux/bootmem.h> #include <linux/module.h> #include <linux/mm.h> #include <linux/genalloc.h>
arch/arm/mm/init.c +0 -1
@@ -11,7 +11,6 @@#include <linux/errno.h> #include <linux/swap.h> #include <linux/init.h> -#include <linux/bootmem.h> #include <linux/mman.h> #include <linux/sched/signal.h> #include <linux/sched/task.h>
arch/arm/xen/mm.c +0 -1
@@ -1,6 +1,5 @@#include <linux/cpu.h> #include <linux/dma-mapping.h> -#include <linux/bootmem.h> #include <linux/gfp.h> #include <linux/highmem.h> #include <linux/export.h>
arch/arm/xen/p2m.c +1 -1
@@ -1,4 +1,4 @@ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/gfp.h> #include <linux/export.h> #include <linux/spinlock.h>
arch/arm64/kernel/acpi.c +0 -1
@@ -16,7 +16,6 @@#define pr_fmt (fmt) "ACPI: " fmt#include <linux/acpi.h> -#include <linux/bootmem.h> #include <linux/cpumask.h> #include <linux/efi.h> #include <linux/efi-bgrt.h>
arch/arm64/kernel/acpi_numa.c +0 -1
@@ -18,7 +18,6 @@#include <linux/acpi.h> #include <linux/bitmap.h> -#include <linux/bootmem.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/memblock.h>
arch/arm64/kernel/setup.c +0 -1
@@ -26,7 +26,6 @@#include <linux/initrd.h> #include <linux/console.h> #include <linux/cache.h> -#include <linux/bootmem.h> #include <linux/screen_info.h> #include <linux/init.h> #include <linux/kexec.h>
arch/arm64/mm/dma-mapping.c +1 -1
@@ -19,7 +19,7 @@#include <linux/gfp.h> #include <linux/acpi.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/cache.h> #include <linux/export.h> #include <linux/slab.h>
arch/arm64/mm/init.c +0 -1
@@ -22,7 +22,6 @@#include <linux/errno.h> #include <linux/swap.h> #include <linux/init.h> -#include <linux/bootmem.h> #include <linux/cache.h> #include <linux/mman.h> #include <linux/nodemask.h>
arch/arm64/mm/kasan_init.c +0 -1
@@ -11,7 +11,6 @@*/ #define pr_fmt (fmt) "kasan: " fmt -#include <linux/bootmem.h> #include <linux/kasan.h> #include <linux/kernel.h> #include <linux/sched/task.h>
arch/arm64/mm/numa.c +0 -1
@@ -20,7 +20,6 @@#define pr_fmt (fmt) "NUMA: " fmt#include <linux/acpi.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/module.h> #include <linux/of.h>
arch/c6x/kernel/setup.c +0 -1
@@ -11,7 +11,6 @@#include <linux/dma-mapping.h> #include <linux/memblock.h> #include <linux/seq_file.h> -#include <linux/bootmem.h> #include <linux/clkdev.h> #include <linux/initrd.h> #include <linux/kernel.h>
arch/c6x/mm/init.c +1 -1
@@ -11,7 +11,7 @@#include <linux/mm.h> #include <linux/swap.h> #include <linux/module.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #ifdef CONFIG_BLK_DEV_RAM #include <linux/blkdev.h> #endif
arch/h8300/kernel/setup.c +0 -1
@@ -18,7 +18,6 @@#include <linux/console.h> #include <linux/errno.h> #include <linux/string.h> -#include <linux/bootmem.h> #include <linux/seq_file.h> #include <linux/init.h> #include <linux/of.h>
arch/h8300/mm/init.c +1 -1
@@ -30,7 +30,7 @@#include <linux/init.h> #include <linux/highmem.h> #include <linux/pagemap.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/gfp.h> #include <asm/setup.h>
arch/hexagon/kernel/dma.c +1 -1
@@ -19,7 +19,7 @@*/ #include <linux/dma-noncoherent.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/genalloc.h> #include <linux/module.h> #include <asm/page.h>
arch/hexagon/kernel/setup.c +1 -1
@@ -20,7 +20,7 @@#include <linux/init.h> #include <linux/delay.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mmzone.h> #include <linux/mm.h> #include <linux/seq_file.h>
arch/hexagon/mm/init.c +0 -1
@@ -20,7 +20,6 @@#include <linux/init.h> #include <linux/mm.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <asm/atomic.h> #include <linux/highmem.h>
arch/ia64/kernel/crash.c +1 -1
@@ -12,7 +12,7 @@#include <linux/smp.h> #include <linux/delay.h> #include <linux/crash_dump.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/kexec.h> #include <linux/elfcore.h> #include <linux/sysctl.h>
arch/ia64/kernel/efi.c +1 -1
@@ -23,7 +23,7 @@* Skip non-WB memory and ignore empty memory ranges. */ #include <linux/module.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/crash_dump.h> #include <linux/kernel.h> #include <linux/init.h>
arch/ia64/kernel/ia64_ksyms.c +1 -1
@@ -6,7 +6,7 @@#ifdef CONFIG_VIRTUAL_MEM_MAP #include <linux/compiler.h> #include <linux/export.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> EXPORT_SYMBOL (min_low_pfn);/* defined by bootmem.c, but not exported by generic code */ EXPORT_SYMBOL (max_low_pfn);/* defined by bootmem.c, but not exported by generic code */ #endif
arch/ia64/kernel/iosapic.c +1 -1
@@ -90,7 +90,7 @@#include <linux/slab.h> #include <linux/smp.h> #include <linux/string.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/delay.h> #include <asm/hw_irq.h>
arch/ia64/kernel/mca.c +1 -1
@@ -77,7 +77,7 @@#include <linux/sched/task.h> #include <linux/interrupt.h> #include <linux/irq.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/acpi.h> #include <linux/timer.h> #include <linux/module.h>
arch/ia64/kernel/mca_drv.c +1 -1
@@ -14,7 +14,7 @@#include <linux/interrupt.h> #include <linux/irq.h> #include <linux/kallsyms.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/acpi.h> #include <linux/timer.h> #include <linux/module.h>
arch/ia64/kernel/setup.c +0 -1
@@ -27,7 +27,6 @@#include <linux/init.h> #include <linux/acpi.h> -#include <linux/bootmem.h> #include <linux/console.h> #include <linux/delay.h> #include <linux/cpu.h>
arch/ia64/kernel/smpboot.c +1 -1
@@ -24,7 +24,7 @@#include <linux/module.h> #include <linux/acpi.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/cpu.h> #include <linux/delay.h> #include <linux/init.h>
arch/ia64/kernel/topology.c +1 -1
@@ -19,7 +19,7 @@#include <linux/node.h> #include <linux/slab.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/nodemask.h> #include <linux/notifier.h> #include <linux/export.h>
arch/ia64/kernel/unwind.c +1 -1
@@ -28,7 +28,7 @@* acquired, then the read-write lock must be acquired first. */ #include <linux/module.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/elf.h> #include <linux/kernel.h> #include <linux/sched.h>
arch/ia64/mm/contig.c +0 -1
@@ -14,7 +14,6 @@* Routines used by ia64 machines with contiguous (or virtually contiguous) * memory. */ -#include <linux/bootmem.h> #include <linux/efi.h> #include <linux/memblock.h> #include <linux/mm.h>
arch/ia64/mm/discontig.c +0 -1
@@ -19,7 +19,6 @@#include <linux/mm.h> #include <linux/nmi.h> #include <linux/swap.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/acpi.h> #include <linux/efi.h>
arch/ia64/mm/init.c +0 -1
@@ -8,7 +8,6 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/bootmem.h> #include <linux/efi.h> #include <linux/elf.h> #include <linux/memblock.h>
arch/ia64/mm/numa.c +1 -1
@@ -15,7 +15,7 @@#include <linux/mm.h> #include <linux/node.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/module.h> #include <asm/mmzone.h> #include <asm/numa.h>
arch/ia64/mm/tlb.c +1 -1
@@ -21,7 +21,7 @@#include <linux/sched.h> #include <linux/smp.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/slab.h> #include <asm/delay.h>
arch/ia64/pci/pci.c +1 -1
@@ -20,7 +20,7 @@#include <linux/ioport.h> #include <linux/slab.h> #include <linux/spinlock.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <asm/machvec.h>
arch/ia64/sn/kernel/bte.c +1 -1
@@ -16,7 +16,7 @@#include <asm/nodedata.h> #include <asm/delay.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/string.h> #include <linux/sched.h> #include <linux/slab.h>
arch/ia64/sn/kernel/io_common.c +1 -1
@@ -6,7 +6,7 @@* Copyright (C) 2006 Silicon Graphics, Inc. All rights reserved. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/slab.h> #include <asm/sn/types.h>
arch/ia64/sn/kernel/setup.c +1 -1
@@ -20,7 +20,7 @@#include <linux/mm.h> #include <linux/serial.h> #include <linux/irq.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mmzone.h> #include <linux/interrupt.h> #include <linux/acpi.h>
arch/m68k/atari/stram.c +1 -1
@@ -17,7 +17,7 @@#include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/pagemap.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mount.h> #include <linux/blkdev.h> #include <linux/module.h>
arch/m68k/coldfire/m54xx.c +1 -1
@@ -16,7 +16,7 @@#include <linux/io.h> #include <linux/mm.h> #include <linux/clk.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/pgalloc.h> #include <asm/machdep.h> #include <asm/coldfire.h>
arch/m68k/kernel/setup_mm.c +0 -1
@@ -20,7 +20,6 @@#include <linux/errno.h> #include <linux/string.h> #include <linux/init.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/proc_fs.h> #include <linux/seq_file.h>
arch/m68k/kernel/setup_no.c +0 -1
@@ -27,7 +27,6 @@#include <linux/console.h> #include <linux/errno.h> #include <linux/string.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/init.h>
arch/m68k/kernel/uboot.c +1 -1
@@ -16,7 +16,7 @@#include <linux/console.h> #include <linux/errno.h> #include <linux/string.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/init.h> #include <linux/initrd.h>
arch/m68k/mm/init.c +1 -1
@@ -17,7 +17,7 @@#include <linux/string.h> #include <linux/types.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/gfp.h> #include <asm/setup.h>
arch/m68k/mm/mcfmmu.c +0 -1
@@ -13,7 +13,6 @@#include <linux/mm.h> #include <linux/init.h> #include <linux/string.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <asm/setup.h>
arch/m68k/mm/motorola.c +0 -1
@@ -18,7 +18,6 @@#include <linux/string.h> #include <linux/types.h> #include <linux/init.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/gfp.h>
arch/m68k/mm/sun3mmu.c +1 -1
@@ -16,7 +16,7 @@#include <linux/string.h> #include <linux/types.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/setup.h> #include <linux/uaccess.h>
arch/m68k/sun3/config.c +1 -1
@@ -15,7 +15,7 @@#include <linux/tty.h> #include <linux/console.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/platform_device.h> #include <asm/oplib.h>
arch/m68k/sun3/dvma.c +1 -1
@@ -11,7 +11,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/list.h> #include <asm/page.h> #include <asm/pgtable.h>
arch/m68k/sun3/mmu_emu.c +1 -1
@@ -13,7 +13,7 @@#include <linux/kernel.h> #include <linux/ptrace.h> #include <linux/delay.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/bitops.h> #include <linux/module.h> #include <linux/sched/mm.h>
arch/m68k/sun3/sun3dvma.c +1 -1
@@ -7,7 +7,7 @@* Contains common routines for sun3/sun3x DVMA management. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h>
arch/m68k/sun3x/dvma.c +1 -1
@@ -15,7 +15,7 @@#include <linux/init.h> #include <linux/bitops.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/vmalloc.h> #include <asm/sun3x.h>
arch/microblaze/mm/consistent.c +1 -1
@@ -28,7 +28,7 @@#include <linux/vmalloc.h> #include <linux/init.h> #include <linux/delay.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <linux/pci.h> #include <linux/interrupt.h>
arch/microblaze/mm/init.c +1 -2
@@ -7,10 +7,9 @@* for more details. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/kernel.h> -#include <linux/memblock.h> #include <linux/mm.h> /* mem_init */ #include <linux/initrd.h> #include <linux/pagemap.h>
arch/microblaze/pci/pci-common.c +1 -1
@@ -20,7 +20,7 @@#include <linux/pci.h> #include <linux/string.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mm.h> #include <linux/shmem_fs.h> #include <linux/list.h>
arch/mips/ar7/memory.c +1 -1
@@ -16,7 +16,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/pfn.h>
arch/mips/ath79/setup.c +1 -1
@@ -14,7 +14,7 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/err.h> #include <linux/clk.h> #include <linux/clk-provider.h>
arch/mips/bcm63xx/prom.c +1 -1
@@ -7,7 +7,7 @@*/ #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/smp.h> #include <asm/bootinfo.h> #include <asm/bmips.h>
arch/mips/bcm63xx/setup.c +1 -1
@@ -9,7 +9,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/delay.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ioport.h> #include <linux/pm.h> #include <asm/bootinfo.h>
arch/mips/bmips/setup.c +1 -1
@@ -9,7 +9,7 @@#include <linux/init.h> #include <linux/bitops.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/clk-provider.h> #include <linux/ioport.h> #include <linux/kernel.h>
arch/mips/cavium-octeon/dma-octeon.c +1 -1
@@ -11,7 +11,7 @@* Copyright (C) 2010 Cavium Networks, Inc. */ #include <linux/dma-direct.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/swiotlb.h> #include <linux/types.h> #include <linux/init.h>
arch/mips/dec/prom/memory.c +1 -1
@@ -8,7 +8,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/types.h> #include <asm/addrspace.h>
arch/mips/emma/common/prom.c +1 -1
@@ -22,7 +22,7 @@#include <linux/init.h> #include <linux/mm.h> #include <linux/sched.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/addrspace.h> #include <asm/bootinfo.h>
arch/mips/fw/arc/memory.c +1 -1
@@ -17,7 +17,7 @@#include <linux/types.h> #include <linux/sched.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/swap.h> #include <asm/sgialib.h>
arch/mips/jazz/jazzdma.c +1 -1
@@ -13,7 +13,7 @@#include <linux/export.h> #include <linux/errno.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/spinlock.h> #include <linux/gfp.h> #include <linux/dma-direct.h>
arch/mips/kernel/crash.c +1 -1
@@ -3,7 +3,7 @@#include <linux/smp.h> #include <linux/reboot.h> #include <linux/kexec.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/crash_dump.h> #include <linux/delay.h> #include <linux/irq.h>
arch/mips/kernel/crash_dump.c +1 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/highmem.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/crash_dump.h> #include <linux/uaccess.h> #include <linux/slab.h>
arch/mips/kernel/prom.c +1 -1
@@ -12,7 +12,7 @@#include <linux/export.h> #include <linux/errno.h> #include <linux/types.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/debugfs.h> #include <linux/of.h> #include <linux/of_fdt.h>
arch/mips/kernel/setup.c +0 -1
@@ -15,7 +15,6 @@#include <linux/export.h> #include <linux/screen_info.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <linux/initrd.h> #include <linux/root_dev.h> #include <linux/highmem.h>
arch/mips/kernel/traps.c +0 -1
@@ -28,7 +28,6 @@#include <linux/smp.h> #include <linux/spinlock.h> #include <linux/kallsyms.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/interrupt.h> #include <linux/ptrace.h>
arch/mips/kernel/vpe.c +1 -1
@@ -26,7 +26,7 @@#include <linux/moduleloader.h> #include <linux/interrupt.h> #include <linux/poll.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/mipsregs.h> #include <asm/mipsmtregs.h> #include <asm/cacheflush.h>
arch/mips/kvm/commpage.c +1 -1
@@ -14,7 +14,7 @@#include <linux/err.h> #include <linux/vmalloc.h> #include <linux/fs.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/page.h> #include <asm/cacheflush.h> #include <asm/mmu_context.h>
arch/mips/kvm/dyntrans.c +1 -1
@@ -16,7 +16,7 @@#include <linux/uaccess.h> #include <linux/vmalloc.h> #include <linux/fs.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/cacheflush.h> #include "commpage.h"
arch/mips/kvm/emulate.c +1 -1
@@ -15,7 +15,7 @@#include <linux/kvm_host.h> #include <linux/vmalloc.h> #include <linux/fs.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/random.h> #include <asm/page.h> #include <asm/cacheflush.h>
arch/mips/kvm/interrupt.c +1 -1
@@ -13,7 +13,7 @@#include <linux/err.h> #include <linux/vmalloc.h> #include <linux/fs.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/page.h> #include <asm/cacheflush.h>
arch/mips/kvm/mips.c +1 -1
@@ -18,7 +18,7 @@#include <linux/vmalloc.h> #include <linux/sched/signal.h> #include <linux/fs.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/fpu.h> #include <asm/page.h>
arch/mips/lantiq/prom.c +1 -1
@@ -8,7 +8,7 @@#include <linux/export.h> #include <linux/clk.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/of_fdt.h> #include <asm/bootinfo.h>
arch/mips/lasat/prom.c +1 -1
@@ -8,7 +8,7 @@#include <linux/ctype.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ioport.h> #include <asm/bootinfo.h> #include <asm/lasat/lasat.h>
arch/mips/loongson64/common/init.c +1 -1
@@ -8,7 +8,7 @@* option) any later version. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/bootinfo.h> #include <asm/traps.h> #include <asm/smp-ops.h>
arch/mips/loongson64/loongson-3/numa.c +0 -1
@@ -18,7 +18,6 @@#include <linux/nodemask.h> #include <linux/swap.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <linux/pfn.h> #include <linux/highmem.h> #include <asm/page.h>
arch/mips/mm/init.c +1 -1
@@ -22,7 +22,7 @@#include <linux/ptrace.h> #include <linux/mman.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <linux/swap.h> #include <linux/proc_fs.h>
arch/mips/mm/pgtable-32.c +1 -1
@@ -7,7 +7,7 @@*/ #include <linux/init.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <asm/fixmap.h> #include <asm/pgtable.h>
arch/mips/mti-malta/malta-memory.c +1 -1
@@ -12,7 +12,7 @@* Steven J. Hill <[email protected]> */ #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/string.h> #include <asm/bootinfo.h>
arch/mips/netlogic/xlp/dt.c +1 -1
@@ -33,7 +33,7 @@*/ #include <linux/kernel.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/of_fdt.h> #include <linux/of_platform.h>
arch/mips/pci/pci-legacy.c +1 -1
@@ -11,7 +11,7 @@#include <linux/bug.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/init.h> #include <linux/types.h>
arch/mips/pci/pci.c +1 -1
@@ -11,7 +11,7 @@#include <linux/bug.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/init.h> #include <linux/types.h>
arch/mips/ralink/of.c +1 -1
@@ -14,7 +14,7 @@#include <linux/sizes.h> #include <linux/of_fdt.h> #include <linux/kernel.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/of_platform.h> #include <linux/of_address.h>
arch/mips/rb532/prom.c +1 -1
@@ -29,7 +29,7 @@#include <linux/export.h> #include <linux/string.h> #include <linux/console.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ioport.h> #include <linux/blkdev.h>
arch/mips/sgi-ip27/ip27-memory.c +0 -1
@@ -18,7 +18,6 @@#include <linux/export.h> #include <linux/nodemask.h> #include <linux/swap.h> -#include <linux/bootmem.h> #include <linux/pfn.h> #include <linux/highmem.h> #include <asm/page.h>
arch/mips/sibyte/common/cfe.c +1 -1
@@ -21,7 +21,7 @@#include <linux/linkage.h> #include <linux/mm.h> #include <linux/blkdev.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/pm.h> #include <linux/smp.h>
arch/mips/sibyte/swarm/setup.c +1 -1
@@ -23,7 +23,7 @@#include <linux/spinlock.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/blkdev.h> #include <linux/init.h> #include <linux/kernel.h>
arch/mips/txx9/rbtx4938/prom.c +1 -1
@@ -11,7 +11,7 @@*/ #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/bootinfo.h> #include <asm/txx9/generic.h> #include <asm/txx9/rbtx4938.h>
arch/nds32/kernel/setup.c +1 -2
@@ -2,9 +2,8 @@// Copyright (C) 2005-2017 Andes Technology Corporation #include <linux/cpu.h> -#include <linux/bootmem.h> -#include <linux/seq_file.h> #include <linux/memblock.h> +#include <linux/seq_file.h> #include <linux/console.h> #include <linux/screen_info.h> #include <linux/delay.h>
arch/nds32/mm/highmem.c +1 -1
@@ -6,7 +6,7 @@#include <linux/sched.h> #include <linux/smp.h> #include <linux/interrupt.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/fixmap.h> #include <asm/tlbflush.h>
arch/nds32/mm/init.c +1 -2
@@ -7,12 +7,11 @@#include <linux/errno.h> #include <linux/swap.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mman.h> #include <linux/nodemask.h> #include <linux/initrd.h> #include <linux/highmem.h> -#include <linux/memblock.h> #include <asm/sections.h> #include <asm/setup.h>
arch/nios2/kernel/prom.c +1 -1
@@ -25,7 +25,7 @@#include <linux/init.h> #include <linux/types.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/of.h> #include <linux/of_fdt.h> #include <linux/io.h>
arch/nios2/kernel/setup.c +0 -1
@@ -16,7 +16,6 @@#include <linux/sched.h> #include <linux/sched/task.h> #include <linux/console.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/initrd.h> #include <linux/of_fdt.h>
arch/nios2/mm/init.c +1 -1
@@ -23,7 +23,7 @@#include <linux/mm.h> #include <linux/init.h> #include <linux/pagemap.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/slab.h> #include <linux/binfmts.h>
arch/openrisc/kernel/setup.c +1 -2
@@ -30,13 +30,12 @@#include <linux/delay.h> #include <linux/console.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/serial.h> #include <linux/initrd.h> #include <linux/of_fdt.h> #include <linux/of.h> -#include <linux/memblock.h> #include <linux/device.h> #include <asm/sections.h>
arch/openrisc/mm/init.c +1 -2
@@ -26,12 +26,11 @@#include <linux/mm.h> #include <linux/swap.h> #include <linux/smp.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/blkdev.h> /* for initrd_* */ #include <linux/pagemap.h> -#include <linux/memblock.h> #include <asm/segment.h> #include <asm/pgalloc.h>
arch/parisc/mm/init.c +0 -1
@@ -14,7 +14,6 @@#include <linux/module.h> #include <linux/mm.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/gfp.h> #include <linux/delay.h>
arch/powerpc/kernel/pci_32.c +1 -1
@@ -10,7 +10,7 @@#include <linux/capability.h> #include <linux/sched.h> #include <linux/errno.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/syscalls.h> #include <linux/irq.h> #include <linux/list.h>
arch/powerpc/kernel/setup_64.c +1 -2
@@ -29,10 +29,9 @@#include <linux/unistd.h> #include <linux/serial.h> #include <linux/serial_8250.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/pci.h> #include <linux/lockdep.h> -#include <linux/memblock.h> #include <linux/memory.h> #include <linux/nmi.h>
arch/powerpc/lib/alloc.c +1 -1
@@ -2,7 +2,7 @@#include <linux/types.h> #include <linux/init.h> #include <linux/slab.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/string.h> #include <asm/setup.h>
arch/powerpc/mm/hugetlbpage.c +0 -1
@@ -15,7 +15,6 @@#include <linux/export.h> #include <linux/of_fdt.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <linux/moduleparam.h> #include <linux/swap.h> #include <linux/swapops.h>
arch/powerpc/mm/mem.c +1 -2
@@ -27,12 +27,11 @@#include <linux/mm.h> #include <linux/stddef.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <linux/initrd.h> #include <linux/pagemap.h> #include <linux/suspend.h> -#include <linux/memblock.h> #include <linux/hugetlb.h> #include <linux/slab.h> #include <linux/vmalloc.h>
arch/powerpc/mm/mmu_context_nohash.c +1 -1
@@ -44,7 +44,7 @@#include <linux/mm.h> #include <linux/init.h> #include <linux/spinlock.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/notifier.h> #include <linux/cpu.h> #include <linux/slab.h>
arch/powerpc/mm/numa.c +1 -2
@@ -11,7 +11,7 @@#define pr_fmt (fmt) "numa: " fmt#include <linux/threads.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/mmzone.h>
@@ -19,7 +19,6 @@#include <linux/nodemask.h> #include <linux/cpu.h> #include <linux/notifier.h> -#include <linux/memblock.h> #include <linux/of.h> #include <linux/pfn.h> #include <linux/cpuset.h>
arch/powerpc/platforms/powermac/nvram.c +1 -1
@@ -18,7 +18,7 @@#include <linux/errno.h> #include <linux/adb.h> #include <linux/pmu.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/completion.h> #include <linux/spinlock.h> #include <asm/sections.h>
arch/powerpc/platforms/powernv/pci-ioda.c +1 -2
@@ -17,11 +17,10 @@#include <linux/delay.h> #include <linux/string.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/irq.h> #include <linux/io.h> #include <linux/msi.h> -#include <linux/memblock.h> #include <linux/iommu.h> #include <linux/rculist.h> #include <linux/sizes.h>
arch/powerpc/platforms/ps3/setup.c +1 -1
@@ -24,7 +24,7 @@#include <linux/root_dev.h> #include <linux/console.h> #include <linux/export.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/machdep.h> #include <asm/firmware.h>
arch/powerpc/sysdev/msi_bitmap.c +1 -1
@@ -12,7 +12,7 @@#include <linux/kernel.h> #include <linux/kmemleak.h> #include <linux/bitmap.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/msi_bitmap.h> #include <asm/setup.h>
arch/riscv/mm/init.c +1 -2
@@ -13,9 +13,8 @@#include <linux/init.h> #include <linux/mm.h> -#include <linux/bootmem.h> -#include <linux/initrd.h> #include <linux/memblock.h> +#include <linux/initrd.h> #include <linux/swap.h> #include <linux/sizes.h>
arch/s390/kernel/crash_dump.c +1 -2
@@ -13,10 +13,9 @@#include <linux/mm.h> #include <linux/gfp.h> #include <linux/slab.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/elf.h> #include <asm/asm-offsets.h> -#include <linux/memblock.h> #include <asm/os_info.h> #include <asm/elf.h> #include <asm/ipl.h>
arch/s390/kernel/setup.c +0 -1
@@ -34,7 +34,6 @@#include <linux/delay.h> #include <linux/init.h> #include <linux/initrd.h> -#include <linux/bootmem.h> #include <linux/root_dev.h> #include <linux/console.h> #include <linux/kernel_stat.h>
arch/s390/kernel/smp.c +1 -2
@@ -20,7 +20,7 @@#define pr_fmt (fmt) KMSG_COMPONENT ": " fmt#include <linux/workqueue.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/init.h> #include <linux/mm.h>
@@ -35,7 +35,6 @@#include <linux/sched/hotplug.h> #include <linux/sched/task_stack.h> #include <linux/crash_dump.h> -#include <linux/memblock.h> #include <linux/kprobes.h> #include <asm/asm-offsets.h> #include <asm/diag.h>
arch/s390/kernel/topology.c +1 -1
@@ -8,7 +8,7 @@#define pr_fmt (fmt) KMSG_COMPONENT ": " fmt#include <linux/workqueue.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/uaccess.h> #include <linux/sysctl.h> #include <linux/cpuset.h>
arch/s390/kernel/vdso.c +1 -1
@@ -18,7 +18,7 @@#include <linux/user.h> #include <linux/elf.h> #include <linux/security.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/compat.h> #include <asm/asm-offsets.h> #include <asm/pgtable.h>
arch/s390/mm/extmem.c +1 -1
@@ -16,7 +16,7 @@#include <linux/list.h> #include <linux/slab.h> #include <linux/export.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ctype.h> #include <linux/ioport.h> #include <asm/diag.h>
arch/s390/mm/init.c +1 -2
@@ -21,7 +21,7 @@#include <linux/smp.h> #include <linux/init.h> #include <linux/pagemap.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/memory.h> #include <linux/pfn.h> #include <linux/poison.h>
@@ -29,7 +29,6 @@#include <linux/export.h> #include <linux/cma.h> #include <linux/gfp.h> -#include <linux/memblock.h> #include <asm/processor.h> #include <linux/uaccess.h> #include <asm/pgtable.h>
arch/s390/mm/vmem.c +1 -2
@@ -4,14 +4,13 @@* Author(s): Heiko Carstens <[email protected]> */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/pfn.h> #include <linux/mm.h> #include <linux/init.h> #include <linux/list.h> #include <linux/hugetlb.h> #include <linux/slab.h> -#include <linux/memblock.h> #include <asm/cacheflush.h> #include <asm/pgalloc.h> #include <asm/pgtable.h>
arch/s390/numa/mode_emu.c +0 -1
@@ -22,7 +22,6 @@#include <linux/kernel.h> #include <linux/cpumask.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <linux/node.h> #include <linux/memory.h> #include <linux/slab.h>
arch/s390/numa/numa.c +0 -1
@@ -13,7 +13,6 @@#include <linux/kernel.h> #include <linux/mmzone.h> #include <linux/cpumask.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/slab.h> #include <linux/node.h>
arch/s390/numa/toptree.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/kernel.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/cpumask.h> #include <linux/list.h> #include <linux/list_sort.h>
arch/sh/mm/init.c +1 -2
@@ -11,12 +11,11 @@#include <linux/swap.h> #include <linux/init.h> #include <linux/gfp.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/proc_fs.h> #include <linux/pagemap.h> #include <linux/percpu.h> #include <linux/io.h> -#include <linux/memblock.h> #include <linux/dma-mapping.h> #include <linux/export.h> #include <asm/mmu_context.h>
arch/sh/mm/ioremap_fixed.c +1 -1
@@ -14,7 +14,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/io.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/proc_fs.h> #include <asm/fixmap.h> #include <asm/page.h>
arch/sparc/kernel/mdesc.c +0 -2
@@ -5,13 +5,11 @@*/ #include <linux/kernel.h> #include <linux/types.h> -#include <linux/memblock.h> #include <linux/log2.h> #include <linux/list.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/miscdevice.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/export.h> #include <linux/refcount.h>
arch/sparc/kernel/prom_32.c +1 -1
@@ -19,7 +19,7 @@#include <linux/types.h> #include <linux/string.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/prom.h> #include <asm/oplib.h>
arch/sparc/kernel/setup_64.c +1 -1
@@ -32,7 +32,7 @@#include <linux/initrd.h> #include <linux/module.h> #include <linux/start_kernel.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <uapi/linux/mount.h> #include <asm/io.h>
arch/sparc/kernel/smp_64.c +1 -1
@@ -22,7 +22,7 @@#include <linux/cache.h> #include <linux/jiffies.h> #include <linux/profile.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/vmalloc.h> #include <linux/ftrace.h> #include <linux/cpu.h>
arch/sparc/mm/init_32.c +0 -1
@@ -22,7 +22,6 @@#include <linux/initrd.h> #include <linux/init.h> #include <linux/highmem.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/pagemap.h> #include <linux/poison.h>
arch/sparc/mm/init_64.c +1 -2
@@ -11,7 +11,7 @@#include <linux/sched.h> #include <linux/string.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mm.h> #include <linux/hugetlb.h> #include <linux/initrd.h>
@@ -25,7 +25,6 @@#include <linux/sort.h> #include <linux/ioport.h> #include <linux/percpu.h> -#include <linux/memblock.h> #include <linux/mmzone.h> #include <linux/gfp.h>
arch/sparc/mm/srmmu.c +1 -1
@@ -11,7 +11,7 @@#include <linux/seq_file.h> #include <linux/spinlock.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/pagemap.h> #include <linux/vmalloc.h> #include <linux/kdebug.h>
arch/um/drivers/net_kern.c +1 -1
@@ -6,7 +6,7 @@* Licensed under the GPL. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> #include <linux/inetdevice.h>
arch/um/drivers/vector_kern.c +1 -1
@@ -9,7 +9,7 @@*/ #include <linux/version.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> #include <linux/inetdevice.h>
arch/um/kernel/initrd.c +1 -1
@@ -4,7 +4,7 @@*/ #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/initrd.h> #include <asm/types.h> #include <init.h>
arch/um/kernel/mem.c +0 -1
@@ -5,7 +5,6 @@#include <linux/stddef.h> #include <linux/module.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/highmem.h> #include <linux/mm.h>
arch/um/kernel/physmem.c +0 -1
@@ -4,7 +4,6 @@*/ #include <linux/module.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/mm.h> #include <linux/pfn.h>
arch/unicore32/kernel/hibernate.c +1 -1
@@ -13,7 +13,7 @@#include <linux/gfp.h> #include <linux/suspend.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/page.h> #include <asm/pgtable.h>
arch/unicore32/kernel/setup.c +1 -2
@@ -17,7 +17,7 @@#include <linux/utsname.h> #include <linux/initrd.h> #include <linux/console.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/screen_info.h> #include <linux/init.h>
@@ -27,7 +27,6 @@#include <linux/smp.h> #include <linux/fs.h> #include <linux/proc_fs.h> -#include <linux/memblock.h> #include <linux/elf.h> #include <linux/io.h>
arch/unicore32/mm/init.c +1 -2
@@ -11,13 +11,12 @@#include <linux/errno.h> #include <linux/swap.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mman.h> #include <linux/nodemask.h> #include <linux/initrd.h> #include <linux/highmem.h> #include <linux/gfp.h> -#include <linux/memblock.h> #include <linux/sort.h> #include <linux/dma-mapping.h> #include <linux/export.h>
arch/unicore32/mm/mmu.c +0 -1
@@ -17,7 +17,6 @@#include <linux/nodemask.h> #include <linux/memblock.h> #include <linux/fs.h> -#include <linux/bootmem.h> #include <linux/io.h> #include <asm/cputype.h>
arch/x86/kernel/acpi/boot.c +1 -1
@@ -32,7 +32,7 @@#include <linux/dmi.h> #include <linux/irq.h> #include <linux/slab.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ioport.h> #include <linux/pci.h> #include <linux/efi-bgrt.h>
arch/x86/kernel/acpi/sleep.c +0 -1
@@ -7,7 +7,6 @@*/ #include <linux/acpi.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/dmi.h> #include <linux/cpumask.h>
arch/x86/kernel/apic/apic.c +1 -1
@@ -20,7 +20,7 @@#include <linux/acpi_pmtmr.h> #include <linux/clockchips.h> #include <linux/interrupt.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ftrace.h> #include <linux/ioport.h> #include <linux/export.h>
arch/x86/kernel/apic/io_apic.c +1 -1
@@ -47,7 +47,7 @@#include <linux/kthread.h> #include <linux/jiffies.h> /* time_after() */ #include <linux/slab.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/irqdomain.h> #include <asm/io.h>
arch/x86/kernel/cpu/common.c +1 -1
@@ -1,7 +1,7 @@/* cpu_feature_enabled() cannot be used this early */ #define USE_EARLY_PGTABLE_L5 -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/linkage.h> #include <linux/bitops.h> #include <linux/kernel.h>
arch/x86/kernel/e820.c +1 -2
@@ -9,11 +9,10 @@* allocation code routines via a platform independent interface (memblock, etc.). */ #include <linux/crash_dump.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/suspend.h> #include <linux/acpi.h> #include <linux/firmware-map.h> -#include <linux/memblock.h> #include <linux/sort.h> #include <asm/e820/api.h>
arch/x86/kernel/mpparse.c +0 -1
@@ -11,7 +11,6 @@#include <linux/mm.h> #include <linux/init.h> #include <linux/delay.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/kernel_stat.h> #include <linux/mc146818rtc.h>
arch/x86/kernel/pci-dma.c +1 -1
@@ -3,7 +3,7 @@#include <linux/dma-debug.h> #include <linux/dmar.h> #include <linux/export.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/gfp.h> #include <linux/pci.h>
arch/x86/kernel/pci-swiotlb.c +1 -1
@@ -5,7 +5,7 @@#include <linux/cache.h> #include <linux/init.h> #include <linux/swiotlb.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/dma-direct.h> #include <linux/mem_encrypt.h>
arch/x86/kernel/pvclock.c +1 -1
@@ -20,7 +20,7 @@#include <linux/notifier.h> #include <linux/sched.h> #include <linux/gfp.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/nmi.h> #include <asm/fixmap.h>
arch/x86/kernel/setup.c +0 -1
@@ -30,7 +30,6 @@#include <linux/sfi.h> #include <linux/apm_bios.h> #include <linux/initrd.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/console.h>
arch/x86/kernel/setup_percpu.c +0 -1
@@ -4,7 +4,6 @@#include <linux/kernel.h> #include <linux/export.h> #include <linux/init.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/percpu.h> #include <linux/kexec.h>
arch/x86/kernel/smpboot.c +1 -1
@@ -49,7 +49,7 @@#include <linux/sched/hotplug.h> #include <linux/sched/task_stack.h> #include <linux/percpu.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/err.h> #include <linux/nmi.h> #include <linux/tboot.h>
arch/x86/kernel/tce_64.c +0 -1
@@ -30,7 +30,6 @@#include <linux/string.h> #include <linux/pci.h> #include <linux/dma-mapping.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <asm/tce.h> #include <asm/calgary.h>
arch/x86/mm/amdtopology.c +0 -1
@@ -12,7 +12,6 @@#include <linux/string.h> #include <linux/nodemask.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <asm/io.h> #include <linux/pci_ids.h>
arch/x86/mm/fault.c +1 -1
@@ -8,7 +8,7 @@#include <linux/sched/task_stack.h> /* task_stack_*(), ... */ #include <linux/kdebug.h> /* oops_begin/end, ... */ #include <linux/extable.h> /* search_exception_tables */ -#include <linux/bootmem.h> /* max_low_pfn */ +#include <linux/memblock.h> /* max_low_pfn */ #include <linux/kprobes.h> /* NOKPROBE_SYMBOL, ... */ #include <linux/mmiotrace.h> /* kmmio_handler, ... */ #include <linux/perf_event.h> /* perf_sw_event */
arch/x86/mm/highmem_32.c +1 -1
@@ -1,7 +1,7 @@#include <linux/highmem.h> #include <linux/export.h> #include <linux/swap.h> /* for totalram_pages */ -#include <linux/bootmem.h> +#include <linux/memblock.h> void *kmap (struct page *page) {
arch/x86/mm/init.c +0 -1
@@ -3,7 +3,6 @@#include <linux/ioport.h> #include <linux/swap.h> #include <linux/memblock.h> -#include <linux/bootmem.h> /* for max_low_pfn */ #include <linux/swapfile.h> #include <linux/swapops.h>
arch/x86/mm/init_32.c +0 -1
@@ -23,7 +23,6 @@#include <linux/pci.h> #include <linux/pfn.h> #include <linux/poison.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/proc_fs.h> #include <linux/memory_hotplug.h>
arch/x86/mm/init_64.c +0 -1
@@ -20,7 +20,6 @@#include <linux/init.h> #include <linux/initrd.h> #include <linux/pagemap.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/proc_fs.h> #include <linux/pci.h>
arch/x86/mm/ioremap.c +1 -1
@@ -6,7 +6,7 @@* (C) Copyright 1995 1996 Linus Torvalds */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/io.h> #include <linux/ioport.h>
arch/x86/mm/kasan_init_64.c +1 -2
@@ -5,10 +5,9 @@/* cpu_feature_enabled() cannot be used this early */ #define USE_EARLY_PGTABLE_L5 -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/kasan.h> #include <linux/kdebug.h> -#include <linux/memblock.h> #include <linux/mm.h> #include <linux/sched.h> #include <linux/sched/task.h>
arch/x86/mm/numa.c +0 -1
@@ -4,7 +4,6 @@#include <linux/mm.h> #include <linux/string.h> #include <linux/init.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/mmzone.h> #include <linux/ctype.h>
arch/x86/mm/numa_32.c +0 -1
@@ -22,7 +22,6 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/init.h>
arch/x86/mm/numa_64.c +1 -1
@@ -3,7 +3,7 @@* Generic VM initialization for x86-64 NUMA setups. * Copyright 2002,2003 Andi Kleen, SuSE Labs. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include "numa_internal.h"
arch/x86/mm/numa_emulation.c +0 -1
@@ -6,7 +6,6 @@#include <linux/errno.h> #include <linux/topology.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <asm/dma.h> #include "numa_internal.h"
arch/x86/mm/pageattr-test.c +1 -1
@@ -5,7 +5,7 @@* Clears the a test pte bit on random pages in the direct mapping, * then reverts and compares page tables forwards and afterwards. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/kthread.h> #include <linux/random.h> #include <linux/kernel.h>
arch/x86/mm/pageattr.c +1 -1
@@ -3,7 +3,7 @@* Thanks to Ben LaHaise for precious feedback. */ #include <linux/highmem.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/interrupt.h>
arch/x86/mm/pat.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/seq_file.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/debugfs.h> #include <linux/ioport.h> #include <linux/kernel.h>
arch/x86/mm/physaddr.c +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0 -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/mmdebug.h> #include <linux/export.h> #include <linux/mm.h>
arch/x86/pci/i386.c +1 -1
@@ -32,7 +32,7 @@#include <linux/init.h> #include <linux/ioport.h> #include <linux/errno.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/pat.h> #include <asm/e820/api.h>
arch/x86/platform/efi/efi.c +1 -2
@@ -36,9 +36,8 @@#include <linux/efi.h> #include <linux/efi-bgrt.h> #include <linux/export.h> -#include <linux/bootmem.h> -#include <linux/slab.h> #include <linux/memblock.h> +#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/uaccess.h> #include <linux/time.h>
arch/x86/platform/efi/efi_64.c +1 -1
@@ -23,7 +23,7 @@#include <linux/mm.h> #include <linux/types.h> #include <linux/spinlock.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ioport.h> #include <linux/mc146818rtc.h> #include <linux/efi.h>
arch/x86/platform/efi/quirks.c +0 -1
@@ -8,7 +8,6 @@#include <linux/efi.h> #include <linux/slab.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <linux/acpi.h> #include <linux/dmi.h>
arch/x86/platform/olpc/olpc_dt.c +1 -1
@@ -17,7 +17,7 @@*/ #include <linux/kernel.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/of.h> #include <linux/of_platform.h> #include <linux/of_pdt.h>
arch/x86/power/hibernate_32.c +1 -1
@@ -8,7 +8,7 @@#include <linux/gfp.h> #include <linux/suspend.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/page.h> #include <asm/pgtable.h>
arch/x86/xen/enlighten.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG -#include <linux/bootmem.h> +#include <linux/memblock.h> #endif #include <linux/cpu.h> #include <linux/kexec.h>
arch/x86/xen/enlighten_pv.c +1 -2
@@ -23,7 +23,7 @@#include <linux/start_kernel.h> #include <linux/sched.h> #include <linux/kprobes.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/export.h> #include <linux/mm.h> #include <linux/page-flags.h>
@@ -31,7 +31,6 @@#include <linux/console.h> #include <linux/pci.h> #include <linux/gfp.h> -#include <linux/memblock.h> #include <linux/edd.h> #include <linux/frame.h>
arch/x86/xen/p2m.c +0 -1
@@ -67,7 +67,6 @@#include <linux/hash.h> #include <linux/sched.h> #include <linux/seq_file.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/slab.h> #include <linux/vmalloc.h>
arch/xtensa/kernel/pci.c +1 -1
@@ -24,7 +24,7 @@#include <linux/init.h> #include <linux/sched.h> #include <linux/errno.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <asm/pci-bridge.h> #include <asm/platform.h>
arch/xtensa/mm/cache.c +1 -1
@@ -21,7 +21,7 @@#include <linux/string.h> #include <linux/types.h> #include <linux/ptrace.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/swap.h> #include <linux/pagemap.h>
arch/xtensa/mm/init.c +1 -1
@@ -18,7 +18,7 @@#include <linux/kernel.h> #include <linux/errno.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/gfp.h> #include <linux/highmem.h> #include <linux/swap.h>
arch/xtensa/mm/kasan_init.c +1 -2
@@ -8,11 +8,10 @@* Copyright (C) 2017 Cadence Design Systems Inc. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init_task.h> #include <linux/kasan.h> #include <linux/kernel.h> -#include <linux/memblock.h> #include <asm/initialize_mmu.h> #include <asm/tlbflush.h> #include <asm/traps.h>
arch/xtensa/mm/mmu.c +1 -1
@@ -4,7 +4,7 @@* * Extracted from init.c */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/percpu.h> #include <linux/init.h> #include <linux/string.h>
arch/xtensa/platforms/iss/network.c +1 -1
@@ -30,7 +30,7 @@#include <linux/etherdevice.h> #include <linux/interrupt.h> #include <linux/ioctl.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/ethtool.h> #include <linux/rtnetlink.h> #include <linux/platform_device.h>
arch/xtensa/platforms/iss/setup.c +1 -1
@@ -16,7 +16,7 @@* option) any later version. * */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/init.h>
block/blk-settings.c +1 -1
@@ -6,7 +6,7 @@#include <linux/init.h> #include <linux/bio.h> #include <linux/blkdev.h> -#include <linux/bootmem.h> /* for max_pfn/max_low_pfn */ +#include <linux/memblock.h> /* for max_pfn/max_low_pfn */ #include <linux/gcd.h> #include <linux/lcm.h> #include <linux/jiffies.h>
block/bounce.c +1 -1
@@ -18,7 +18,7 @@#include <linux/init.h> #include <linux/hash.h> #include <linux/highmem.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/printk.h> #include <asm/tlbflush.h>
drivers/acpi/numa.c +0 -1
@@ -27,7 +27,6 @@#include <linux/types.h> #include <linux/errno.h> #include <linux/acpi.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/numa.h> #include <linux/nodemask.h>
drivers/acpi/tables.c +1 -2
@@ -31,9 +31,8 @@#include <linux/irq.h> #include <linux/errno.h> #include <linux/acpi.h> -#include <linux/bootmem.h> -#include <linux/earlycpio.h> #include <linux/memblock.h> +#include <linux/earlycpio.h> #include <linux/initrd.h> #include "internal.h"
drivers/base/platform.c +1 -1
@@ -16,7 +16,7 @@#include <linux/module.h> #include <linux/init.h> #include <linux/dma-mapping.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/pm_runtime.h>
drivers/clk/ti/clk.c +1 -1
@@ -23,7 +23,7 @@#include <linux/of_address.h> #include <linux/list.h> #include <linux/regmap.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/device.h> #include "clock.h"
drivers/firmware/dmi_scan.c +1 -1
@@ -5,7 +5,7 @@#include <linux/ctype.h> #include <linux/dmi.h> #include <linux/efi.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/random.h> #include <asm/dmi.h> #include <asm/unaligned.h>
drivers/firmware/efi/apple-properties.c +1 -1
@@ -20,7 +20,7 @@#define pr_fmt (fmt) "apple-properties: " fmt -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/efi.h> #include <linux/io.h> #include <linux/platform_data/x86/apple.h>
drivers/firmware/iscsi_ibft_find.c +1 -1
@@ -18,7 +18,7 @@* GNU General Public License for more details. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/blkdev.h> #include <linux/ctype.h> #include <linux/device.h>
drivers/firmware/memmap.c +1 -1
@@ -19,7 +19,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/types.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/slab.h> #include <linux/mm.h>
drivers/iommu/mtk_iommu.c +1 -1
@@ -11,7 +11,7 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/bug.h> #include <linux/clk.h> #include <linux/component.h>
drivers/iommu/mtk_iommu_v1.c +1 -1
@@ -13,7 +13,7 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/bug.h> #include <linux/clk.h> #include <linux/component.h>
drivers/macintosh/smu.c +1 -2
@@ -23,7 +23,7 @@#include <linux/kernel.h> #include <linux/device.h> #include <linux/dmapool.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/vmalloc.h> #include <linux/highmem.h> #include <linux/jiffies.h>
@@ -38,7 +38,6 @@#include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/slab.h> -#include <linux/memblock.h> #include <linux/sched/signal.h> #include <asm/byteorder.h>
drivers/mtd/ar7part.c +1 -1
@@ -25,7 +25,7 @@#include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/module.h> #include <uapi/linux/magic.h>
drivers/net/arcnet/arc-rimi.c +1 -1
@@ -33,7 +33,7 @@#include <linux/ioport.h> #include <linux/delay.h> #include <linux/netdevice.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/io.h>
drivers/net/arcnet/com20020-isa.c +1 -1
@@ -38,7 +38,7 @@#include <linux/netdevice.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/io.h> #include "arcdevice.h"
drivers/net/arcnet/com90io.c +1 -1
@@ -34,7 +34,7 @@#include <linux/ioport.h> #include <linux/delay.h> #include <linux/netdevice.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/io.h>
drivers/of/fdt.c +0 -1
@@ -11,7 +11,6 @@#include <linux/crc32.h> #include <linux/kernel.h> #include <linux/initrd.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/mutex.h> #include <linux/of.h>
drivers/of/unittest.c +1 -1
@@ -5,7 +5,7 @@#define pr_fmt (fmt) "### dt-test ### " fmt -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/clk.h> #include <linux/err.h> #include <linux/errno.h>
drivers/s390/char/fs3270.c +1 -1
@@ -8,7 +8,7 @@* Copyright IBM Corp. 2003, 2009 */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/console.h> #include <linux/init.h> #include <linux/interrupt.h>
drivers/s390/char/tty3270.c +1 -1
@@ -19,7 +19,7 @@#include <linux/workqueue.h> #include <linux/slab.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/compat.h> #include <asm/ccwdev.h>
drivers/s390/cio/cmf.c +1 -1
@@ -13,7 +13,7 @@#define KMSG_COMPONENT "cio"#define pr_fmt (fmt) KMSG_COMPONENT ": " fmt -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/device.h> #include <linux/init.h> #include <linux/list.h>
drivers/s390/virtio/virtio_ccw.c +1 -1
@@ -9,7 +9,7 @@#include <linux/kernel_stat.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/err.h> #include <linux/virtio.h> #include <linux/virtio_config.h>
drivers/sfi/sfi_core.c +1 -1
@@ -59,7 +59,7 @@#define KMSG_COMPONENT "SFI"#define pr_fmt (fmt) KMSG_COMPONENT ": " fmt -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/errno.h>
drivers/tty/serial/cpm_uart/cpm_uart_core.c +1 -1
@@ -24,7 +24,7 @@#include <linux/console.h> #include <linux/sysrq.h> #include <linux/device.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/dma-mapping.h> #include <linux/fs_uart_pd.h> #include <linux/of_address.h>
drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c +1 -1
@@ -19,7 +19,7 @@#include <linux/console.h> #include <linux/sysrq.h> #include <linux/device.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/dma-mapping.h> #include <asm/io.h>
drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c +1 -1
@@ -19,7 +19,7 @@#include <linux/console.h> #include <linux/sysrq.h> #include <linux/device.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/dma-mapping.h> #include <asm/io.h>
drivers/usb/early/xhci-dbc.c +0 -1
@@ -12,7 +12,6 @@#include <linux/console.h> #include <linux/pci_regs.h> #include <linux/pci_ids.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/io.h> #include <asm/pci-direct.h>
drivers/xen/balloon.c +1 -1
@@ -44,7 +44,7 @@#include <linux/cred.h> #include <linux/errno.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/pagemap.h> #include <linux/highmem.h> #include <linux/mutex.h>
drivers/xen/events/events_base.c +1 -1
@@ -28,7 +28,7 @@#include <linux/irq.h> #include <linux/moduleparam.h> #include <linux/string.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/slab.h> #include <linux/irqnr.h> #include <linux/pci.h>
drivers/xen/grant-table.c +1 -1
@@ -33,7 +33,7 @@#define pr_fmt (fmt) "xen:" KBUILD_MODNAME ": " fmt -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/slab.h>
drivers/xen/swiotlb-xen.c +0 -1
@@ -35,7 +35,6 @@#define pr_fmt (fmt) "xen:" KBUILD_MODNAME ": " fmt -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/dma-direct.h> #include <linux/export.h>
drivers/xen/xen-selfballoon.c +1 -1
@@ -68,7 +68,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/kernel.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/swap.h> #include <linux/mm.h> #include <linux/mman.h>
fs/dcache.c +1 -1
@@ -26,7 +26,7 @@#include <linux/export.h> #include <linux/security.h> #include <linux/seqlock.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/bit_spinlock.h> #include <linux/rculist_bl.h> #include <linux/list_lru.h>
fs/inode.c +1 -1
@@ -10,7 +10,7 @@#include <linux/swap.h> #include <linux/security.h> #include <linux/cdev.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/fsnotify.h> #include <linux/mount.h> #include <linux/posix_acl.h>
fs/namespace.c +1 -1
@@ -24,7 +24,7 @@#include <linux/uaccess.h> #include <linux/proc_ns.h> #include <linux/magic.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/task_work.h> #include <linux/file.h> #include <linux/sched/task.h>
fs/proc/kcore.c +1 -1
@@ -22,7 +22,7 @@#include <linux/vmalloc.h> #include <linux/highmem.h> #include <linux/printk.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/uaccess.h>
fs/proc/page.c +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0 -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/compiler.h> #include <linux/fs.h> #include <linux/init.h>
fs/proc/vmcore.c +1 -1
@@ -16,7 +16,7 @@#include <linux/slab.h> #include <linux/highmem.h> #include <linux/printk.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/crash_dump.h> #include <linux/list.h>
include/linux/bootmem.h deleted +0 -173
173 lines not on this page · raw message
include/linux/memblock.h +147 -4
186 lines not on this page · raw message
init/main.c +1 -1
@@ -25,7 +25,7 @@#include <linux/ioport.h> #include <linux/init.h> #include <linux/initrd.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/acpi.h> #include <linux/console.h> #include <linux/nmi.h>
kernel/dma/swiotlb.c +1 -1
@@ -39,7 +39,7 @@#include <asm/dma.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/iommu-helper.h> #define CREATE_TRACE_POINTS
kernel/futex.c +1 -1
@@ -65,7 +65,7 @@#include <linux/sched/mm.h> #include <linux/hugetlb.h> #include <linux/freezer.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/fault-inject.h> #include <asm/futex.h>
kernel/locking/qspinlock_paravirt.h +1 -1
@@ -4,7 +4,7 @@#endif #include <linux/hash.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/debug_locks.h> /*
kernel/pid.c +1 -1
@@ -31,7 +31,7 @@#include <linux/slab.h> #include <linux/init.h> #include <linux/rculist.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/hash.h> #include <linux/pid_namespace.h> #include <linux/init_task.h>
kernel/power/snapshot.c +1 -1
@@ -23,7 +23,7 @@#include <linux/pm.h> #include <linux/device.h> #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/nmi.h> #include <linux/syscalls.h> #include <linux/console.h>
kernel/printk/printk.c +0 -1
@@ -29,7 +29,6 @@#include <linux/delay.h> #include <linux/smp.h> #include <linux/security.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/syscalls.h> #include <linux/crash_core.h>
kernel/profile.c +1 -1
@@ -16,7 +16,7 @@#include <linux/export.h> #include <linux/profile.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/notifier.h> #include <linux/mm.h> #include <linux/cpumask.h>
lib/cpumask.c +1 -1
@@ -4,7 +4,7 @@#include <linux/bitops.h> #include <linux/cpumask.h> #include <linux/export.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> /** * cpumask_next - get the next cpu in a cpumask
mm/hugetlb.c +0 -1
@@ -15,7 +15,6 @@#include <linux/compiler.h> #include <linux/cpuset.h> #include <linux/mutex.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/sysfs.h> #include <linux/slab.h>
mm/kasan/kasan_init.c +1 -2
@@ -10,11 +10,10 @@* */ -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/init.h> #include <linux/kasan.h> #include <linux/kernel.h> -#include <linux/memblock.h> #include <linux/mm.h> #include <linux/pfn.h> #include <linux/slab.h>
mm/kmemleak.c +1 -1
@@ -92,7 +92,7 @@#include <linux/stacktrace.h> #include <linux/cache.h> #include <linux/percpu.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/pfn.h> #include <linux/mmzone.h> #include <linux/slab.h>
mm/memblock.c +0 -1
@@ -20,7 +20,6 @@#include <linux/kmemleak.h> #include <linux/seq_file.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <asm/sections.h> #include <linux/io.h>
mm/memory_hotplug.c +0 -1
@@ -33,7 +33,6 @@#include <linux/stop_machine.h> #include <linux/hugetlb.h> #include <linux/memblock.h> -#include <linux/bootmem.h> #include <linux/compaction.h> #include <asm/tlbflush.h>
mm/page_alloc.c +0 -1
@@ -20,7 +20,6 @@#include <linux/interrupt.h> #include <linux/pagemap.h> #include <linux/jiffies.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/compiler.h> #include <linux/kernel.h>
mm/page_ext.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/mm.h> #include <linux/mmzone.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/page_ext.h> #include <linux/memory.h> #include <linux/vmalloc.h>
mm/page_idle.c +1 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/init.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/fs.h> #include <linux/sysfs.h> #include <linux/kobject.h>
mm/page_owner.c +1 -1
@@ -3,7 +3,7 @@#include <linux/mm.h> #include <linux/slab.h> #include <linux/uaccess.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/stacktrace.h> #include <linux/page_owner.h> #include <linux/jump_label.h>
mm/percpu.c +1 -1
@@ -65,7 +65,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/bitmap.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/err.h> #include <linux/lcm.h> #include <linux/list.h>
mm/sparse-vmemmap.c +0 -1
@@ -20,7 +20,6 @@*/ #include <linux/mm.h> #include <linux/mmzone.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/memremap.h> #include <linux/highmem.h>
mm/sparse.c +0 -1
@@ -5,7 +5,6 @@#include <linux/mm.h> #include <linux/slab.h> #include <linux/mmzone.h> -#include <linux/bootmem.h> #include <linux/memblock.h> #include <linux/compiler.h> #include <linux/highmem.h>
net/ipv4/inet_hashtables.c +1 -1
@@ -19,7 +19,7 @@#include <linux/slab.h> #include <linux/wait.h> #include <linux/vmalloc.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <net/addrconf.h> #include <net/inet_connection_sock.h>
net/ipv4/tcp.c +1 -1
@@ -262,7 +262,7 @@#include <linux/net.h> #include <linux/socket.h> #include <linux/random.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <linux/swap.h> #include <linux/cache.h>
net/ipv4/udp.c +1 -1
@@ -81,7 +81,7 @@#include <linux/uaccess.h> #include <asm/ioctls.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <linux/swap.h> #include <linux/types.h>
net/sctp/protocol.c +1 -1
@@ -46,7 +46,7 @@#include <linux/netdevice.h> #include <linux/inetdevice.h> #include <linux/seq_file.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/highmem.h> #include <linux/swap.h> #include <linux/slab.h>
net/xfrm/xfrm_hash.c +1 -1
@@ -6,7 +6,7 @@#include <linux/kernel.h> #include <linux/mm.h> -#include <linux/bootmem.h> +#include <linux/memblock.h> #include <linux/vmalloc.h> #include <linux/slab.h> #include <linux/xfrm.h>
Signature · 1 line
2.7.4
PATCH 30/30 docs/boot-time-mm: remove bootmem documentation
In reply to Mike Rapoport--- Documentation/core-api/boot-time-mm.rst | 71 +++++---------------------------- 1 file changed, 10 insertions(+), 61 deletions(-)
Documentation/core-api/boot-time-mm.rst +10 -61
@@ -5,54 +5,23 @@ Boot time memory management Early system initialization cannot use "normal" memory management simply because it is not set up yet. But there is still need to allocate memory for various data structures, for instance for the -physical page allocator. To address this, a specialized allocator -called the :ref:`Boot Memory Allocator <bootmem>`, or bootmem, was -introduced. Several years later PowerPC developers added a "Logical -Memory Blocks" allocator, which was later adopted by other -architectures and renamed to :ref:`memblock <memblock>`. There is also -a compatibility layer called `nobootmem` that translates bootmem -allocation interfaces to memblock calls. +physical page allocator. -The selection of the early allocator is done using -``CONFIG_NO_BOOTMEM`` and ``CONFIG_HAVE_MEMBLOCK`` kernel -configuration options. These options are enabled or disabled -statically by the architectures' Kconfig files. - -* Architectures that rely only on bootmem select - ``CONFIG_NO_BOOTMEM=n && CONFIG_HAVE_MEMBLOCK=n``. -* The users of memblock with the nobootmem compatibility layer set - ``CONFIG_NO_BOOTMEM=y && CONFIG_HAVE_MEMBLOCK=y``. -* And for those that use both memblock and bootmem the configuration - includes ``CONFIG_NO_BOOTMEM=n && CONFIG_HAVE_MEMBLOCK=y``. - -Whichever allocator is used, it is the responsibility of the -architecture specific initialization to set it up in -:c:func:`setup_arch` and tear it down in :c:func:`mem_init` functions. +A specialized allocator called ``memblock`` performs the +boot time memory management. The architecture specific initialization +must set it up in :c:func:`setup_arch` and tear it down in +:c:func:`mem_init` functions. Once the early memory management is available it offers a variety of functions and macros for memory allocations. The allocation request may be directed to the first (and probably the only) node or to a particular node in a NUMA system. There are API variants that panic -when an allocation fails and those that don't. And more recent and -advanced memblock even allows controlling its own behaviour. - -.. _bootmem: - -Bootmem -======= - -(mostly stolen from Mel Gorman's "Understanding the Linux Virtual -Memory Manager" `book`_) - -.. _book: https://www.kernel.org/doc/gorman/ - -.. kernel-doc:: mm/bootmem.c - :doc: bootmem overview +when an allocation fails and those that don't. -.. _memblock: +Memblock also offers a variety of APIs that control its own behaviour. -Memblock -======== +Memblock Overview +================= .. kernel-doc:: mm/memblock.c :doc: memblock overview
@@ -61,26 +30,6 @@ Memblock Functions and structures ======================== -Common API ----------- - -The functions that are described in this section are available -regardless of what early memory manager is enabled. - -.. kernel-doc:: mm/nobootmem.c - -Bootmem specific API --------------------- - -These interfaces available only with bootmem, i.e when ``CONFIG_NO_BOOTMEM=n`` - -.. kernel-doc:: include/linux/bootmem.h -.. kernel-doc:: mm/bootmem.c - :nodocs: - -Memblock specific API ---------------------- - Here is the description of memblock data structures, functions and macros. Some of them are actually internal, but since they are documented it would be silly to omit them. Besides, reading the
@@ -89,4 +38,4 @@ really happens under the hood. .. kernel-doc:: include/linux/memblock.h .. kernel-doc:: mm/memblock.c - :nodocs: + :functions:
Signature · 1 line
2.7.4
Re: [PATCH 02/30] mm: remove CONFIG_NO_BOOTMEM
In reply to Mike RapoportQuoted 2 lines · Mike Rapoport
All achitectures select
NO_BOOTMEMwhich essentially becomes 'Y' for any kernel configuration and therefore it can be removed.
git grep suggests that DEFERRED_STRUCT_PAGE_INIT still depends on NO_BOOTMEM but I have a vague feeling that I've seen a patch to address that. It would be great to have it folded to this one.
Quoted 1 line
Signed-off-by Mike Rapoport <[email protected]>
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK
In reply to Mike RapoportQuoted 2 lines · Mike Rapoport
All architecures use memblock for early memory management. There is no need for the
CONFIG_HAVE_MEMBLOCKconfiguration option.
git grep saysarch/csky/Kconfig: select HAVE_MEMBLOCK
Quoted 1 line
Signed-off-by Mike Rapoport <[email protected]>
Other than that
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 05/30] mm: nobootmem: remove dead code
In reply to Mike RapoportQuoted 3 lines · Mike Rapoport
Several bootmem functions and macros are not used. Remove them.
Signed-off-by Mike Rapoport <[email protected]>
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 07/30] memblock: remove _virt from APIs returning virtual address
In reply to Mike RapoportQuoted 6 lines · Mike Rapoport
The conversion is done using
sed -i 's@memblock_virt_alloc@memblock_alloc@g' \ $(git grep -l memblock_virt_alloc)Signed-off-by Mike Rapoport <[email protected]>
As I've said earlier, I am not entirely thrilled by this change. It is unnecessary churn. So if nothing else just add a note _why_ you think this is better.
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()
In reply to Mike RapoportQuoted 3 lines · Mike Rapoport
With the align parameter
memblock_alloc_node()can be used as drop in replacement foralloc_bootmem_pages_node()and__alloc_bootmem_node(), which is done in the following patches.
/me confused. Why do we need this patch at all? Maybe it should be folded into the later patch you are refereing here?
Quoted 38 lines
Signed-off-by Mike Rapoport <[email protected]>--- include/linux/bootmem.h | 4 ++-- mm/sparse.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)include/linux/bootmem.h +2
-2@@ -157,9 +157,9 @@ static inline void * __init memblock_alloc_from_nopanic( }static inline void *__init memblock_alloc_node ( -phys_addr_t size,int nid) +phys_addr_t size,phys_addr_t align,int nid) { -return memblock_alloc_try_nid (size,0 ,BOOTMEM_LOW_LIMIT , +return memblock_alloc_try_nid (size, align,BOOTMEM_LOW_LIMIT ,BOOTMEM_ALLOC_ACCESSIBLE , nid); }mm/sparse.c +1
-1@@ -68,7 +68,7 @@ static noinline struct mem_section __ref *sparse_index_alloc(int nid)if (slab_is_available ()) section =kzalloc_node (array_size,GFP_KERNEL , nid);else - section =memblock_alloc_node (array_size, nid); + section =memblock_alloc_node (array_size,0 , nid);return section; }Signature · 1 line
2.7.4
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()
Quoted 7 lines · Michal Hocko
Quoted 3 lines · Mike Rapoport
With the align parameter
memblock_alloc_node()can be used as drop in replacement foralloc_bootmem_pages_node()and__alloc_bootmem_node(), which is done in the following patches./me confused. Why do we need this patch at all? Maybe it should be folded into the later patch you are refereing here?
OK, I can see [email protected] now. If you are going to repost for whatever reason please merge those two. Also I would get rid of the implicit "0 implies SMP_CACHE_BYTES" behavior. It is subtle and you have to dig deep to find that out. Why not make it explicit?
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 16/30] memblock: replace __alloc_bootmem_node with appropriate memblock_ API
In reply to Mike RapoportQuoted 4 lines · Mike Rapoport
Use
memblock_alloc_try_nidwhenever goal (i.e. minimal address is specified) andmemblock_alloc_nodeotherwise.Signed-off-by Mike Rapoport <[email protected]>
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 21/30] memblock: replace alloc_bootmem with memblock_alloc
In reply to Mike RapoportQuoted 5 lines · Mike Rapoport
The
alloc_bootmem(size)is a shortcut for allocation ofSMP_CACHE_BYTESaligned memory. When the align parameter ofmemblock_alloc()is 0, the alignment is implicitly set toSMP_CACHE_BYTESand thusalloc_bootmem(size)andmemblock_alloc(size, 0)are equivalent.
Quoted 7 lines
The conversion is done using the following semantic patch:
@@
expression size;
@@
-alloc_bootmem(size)
+memblock_alloc(size, 0)
As mentioned in other email, please make it explicit SMP_CACHE_BYTES.
Quoted 318 lines
Signed-off-by Mike Rapoport <[email protected]>--- arch/alpha/kernel/core_marvel.c | 4 ++-- arch/alpha/kernel/pci-noop.c | 4 ++-- arch/alpha/kernel/pci.c | 4 ++-- arch/alpha/kernel/pci_iommu.c | 4 ++-- arch/ia64/kernel/mca.c | 4 ++-- arch/ia64/mm/tlb.c | 4 ++-- arch/m68k/sun3/sun3dvma.c | 3 ++- arch/microblaze/mm/init.c | 2 +- arch/mips/kernel/setup.c | 2 +- arch/um/drivers/net_kern.c | 2 +- arch/um/drivers/vector_kern.c | 2 +- arch/um/kernel/initrd.c | 2 +- arch/x86/kernel/acpi/boot.c | 3 ++- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/e820.c | 2 +- arch/x86/platform/olpc/olpc_dt.c | 2 +- arch/xtensa/platforms/iss/network.c | 2 +- drivers/macintosh/smu.c | 2 +- init/main.c | 4 ++-- 19 files changed, 28 insertions(+), 26 deletions(-)arch/alpha/kernel/core_marvel.c +2
-2@@ -82,7 +82,7 @@ mk_resource_name(int pe, int port, char *str)char *name;sprintf (tmp,"PCI %s PE %d PORT %d" , str, pe, port); - name =alloc_bootmem (strlen (tmp) +1 ); + name =memblock_alloc (strlen (tmp) +1 ,0 );strcpy (name, tmp);return name;@@ -117,7 +117,7 @@ alloc_io7(unsigned int pe)return NULL ; } - io7 =alloc_bootmem (sizeof (*io7)); + io7 =memblock_alloc (sizeof (*io7),0 ); io7->pe = pe;raw_spin_lock_init (&io7->irq_lock);arch/alpha/kernel/pci-noop.c +2
-2@@ -33,7 +33,7 @@ alloc_pci_controller(void) {struct pci_controller *hose; - hose =alloc_bootmem (sizeof (*hose)); + hose =memblock_alloc (sizeof (*hose),0 ); *hose_tail = hose; hose_tail = &hose->next;@@ -44,7 +44,7 @@ alloc_pci_controller(void)struct resource *__init alloc_resource (void ) { -return alloc_bootmem (sizeof (struct resource )); +return memblock_alloc (sizeof (struct resource ),0 ); } SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus,arch/alpha/kernel/pci.c +2
-2@@ -392,7 +392,7 @@ alloc_pci_controller(void) {struct pci_controller *hose; - hose =alloc_bootmem (sizeof (*hose)); + hose =memblock_alloc (sizeof (*hose),0 ); *hose_tail = hose; hose_tail = &hose->next;@@ -403,7 +403,7 @@ alloc_pci_controller(void)struct resource *__init alloc_resource (void ) { -return alloc_bootmem (sizeof (struct resource )); +return memblock_alloc (sizeof (struct resource ),0 ); }arch/alpha/kernel/pci_iommu.c +2
-2@@ -79,7 +79,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,printk ("%s: couldn't allocate arena from node %d\n" " falling back to system-wide allocation\n" , __func__, nid); - arena =alloc_bootmem (sizeof (*arena)); + arena =memblock_alloc (sizeof (*arena),0 ); } arena->ptes =memblock_alloc_node (sizeof (*arena), align, nid);@@ -92,7 +92,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,#else /* CONFIG_DISCONTIGMEM */ - arena =alloc_bootmem (sizeof (*arena)); + arena =memblock_alloc (sizeof (*arena),0 ); arena->ptes =memblock_alloc_from (mem_size, align,0 );#endif /* CONFIG_DISCONTIGMEM */ arch/ia64/kernel/mca.c +2
-2@@ -361,9 +361,9 @@ static ia64_state_log_t ia64_state_log[IA64_MAX_LOG_TYPES];#define IA64_LOG_ALLOCATE (it, size) \ {ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)] = \ - (ia64_err_rec_t *)alloc_bootmem(size); \ + (ia64_err_rec_t *)memblock_alloc(size, 0); \ ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)] = \ - (ia64_err_rec_t *)alloc_bootmem(size);} + (ia64_err_rec_t *)memblock_alloc(size, 0);}#define IA64_LOG_LOCK_INIT (it) spin_lock_init(&ia64_state_log[it].isl_lock)#define IA64_LOG_LOCK (it) spin_lock_irqsave(&ia64_state_log[it].isl_lock, s)#define IA64_LOG_UNLOCK (it) spin_unlock_irqrestore(&ia64_state_log[it].isl_lock,s)arch/ia64/mm/tlb.c +2
-2@@ -59,8 +59,8 @@ struct ia64_tr_entry *ia64_idtrs[NR_CPUS];void __init mmu_context_init (void ) { - ia64_ctx.bitmap =alloc_bootmem ((ia64_ctx.max_ctx+1 )>>3 ); - ia64_ctx.flushmap =alloc_bootmem ((ia64_ctx.max_ctx+1 )>>3 ); + ia64_ctx.bitmap =memblock_alloc ((ia64_ctx.max_ctx +1 ) >>3 ,0 ); + ia64_ctx.flushmap =memblock_alloc ((ia64_ctx.max_ctx +1 ) >>3 ,0 ); }/* arch/m68k/sun3/sun3dvma.c +2
-1@@ -267,7 +267,8 @@ void __init dvma_init(void)list_add (&(hole->list), &hole_list); - iommu_use =alloc_bootmem (IOMMU_TOTAL_ENTRIES *sizeof (unsigned long )); + iommu_use =memblock_alloc (IOMMU_TOTAL_ENTRIES *sizeof (unsigned long ), +0 );dvma_unmap_iommu (DVMA_START ,DVMA_SIZE );arch/microblaze/mm/init.c +1
-1@@ -377,7 +377,7 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)if (mem_init_done) p =kzalloc (size, mask);else { - p =alloc_bootmem (size); + p =memblock_alloc (size,0 );if (p)memset (p,0 , size); }arch/mips/kernel/setup.c +1
-1@@ -909,7 +909,7 @@ static void __init resource_init(void)if (end >=HIGHMEM_START ) end =HIGHMEM_START -1 ; - res =alloc_bootmem (sizeof (struct resource )); + res =memblock_alloc (sizeof (struct resource ),0 ); res->start = start; res->end = end;arch/um/drivers/net_kern.c +1
-1@@ -650,7 +650,7 @@ static int __init eth_setup(char *str)return 1 ; } - new =alloc_bootmem (sizeof (*new)); + new =memblock_alloc (sizeof (*new),0 );INIT_LIST_HEAD (&new->list); new->index = n;arch/um/drivers/vector_kern.c +1
-1@@ -1575,7 +1575,7 @@ static int __init vector_setup(char *str) str, error);return 1 ; } - new =alloc_bootmem (sizeof (*new)); + new =memblock_alloc (sizeof (*new),0 );INIT_LIST_HEAD (&new->list); new->unit = n; new->arguments = str;arch/um/kernel/initrd.c +1
-1@@ -36,7 +36,7 @@ int __init read_initrd(void)return 0 ; } - area =alloc_bootmem (size); + area =memblock_alloc (size,0 );if (load_initrd (initrd, area, size) ==-1 )return 0 ;arch/x86/kernel/acpi/boot.c +2
-1@@ -932,7 +932,8 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)* the resource tree during the lateinit timeframe. */ #define HPET_RESOURCE_NAME_SIZE 9 - hpet_res =alloc_bootmem (sizeof (*hpet_res) +HPET_RESOURCE_NAME_SIZE ); + hpet_res =memblock_alloc (sizeof (*hpet_res) +HPET_RESOURCE_NAME_SIZE , +0 ); hpet_res->name = (void *)&hpet_res[1 ]; hpet_res->flags =IORESOURCE_MEM ;arch/x86/kernel/apic/io_apic.c +1
-1@@ -2578,7 +2578,7 @@ static struct resource * __init ioapic_setup_resources(void) n =IOAPIC_RESOURCE_NAME_SIZE +sizeof (struct resource ); n *= nr_ioapics; - mem =alloc_bootmem (n); + mem =memblock_alloc (n,0 ); res = (void *)mem; mem +=sizeof (struct resource ) * nr_ioapics;arch/x86/kernel/e820.c +1
-1@@ -1094,7 +1094,7 @@ void __init e820__reserve_resources(void)struct resource *res;u64 end; - res =alloc_bootmem (sizeof (*res) * e820_table->nr_entries); + res =memblock_alloc (sizeof (*res) * e820_table->nr_entries,0 ); e820_res = res;for (i =0 ; i < e820_table->nr_entries; i++) {arch/x86/platform/olpc/olpc_dt.c +1
-1@@ -141,7 +141,7 @@ void * __init prom_early_alloc(unsigned long size)* fast enough on the platforms we care about while minimizing * wasted bootmem) and hand off chunks of it to callers. */ - res =alloc_bootmem (chunk_size); + res =memblock_alloc (chunk_size,0 );BUG_ON (!res); prom_early_allocated += chunk_size;memset (res,0 , chunk_size);arch/xtensa/platforms/iss/network.c +1
-1@@ -646,7 +646,7 @@ static int __init iss_net_setup(char *str)return 1 ; } - new =alloc_bootmem (sizeof (*new)); + new =memblock_alloc (sizeof (*new),0 );if (new ==NULL ) {pr_err ("Alloc_bootmem failed\n" );return 1 ;drivers/macintosh/smu.c +1
-1@@ -493,7 +493,7 @@ int __init smu_init (void) goto fail_np; } - smu =alloc_bootmem (sizeof (struct smu_device )); + smu =memblock_alloc (sizeof (struct smu_device ),0 );spin_lock_init (&smu->lock);INIT_LIST_HEAD (&smu->cmd_list);init/main.c +2
-2@@ -768,8 +768,8 @@ static int __init initcall_blacklist(char *str) str_entry =strsep (&str,"," );if (str_entry) {pr_debug ("blacklisting initcall %s\n" , str_entry); - entry =alloc_bootmem (sizeof (*entry)); - entry->buf =alloc_bootmem (strlen (str_entry) +1 ); + entry =memblock_alloc (sizeof (*entry),0 ); + entry->buf =memblock_alloc (strlen (str_entry) +1 ,0 );strcpy (entry->buf, str_entry);list_add (&entry->next, &blacklisted_initcalls); }Signature · 1 line
2.7.4
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 29/30] mm: remove include/linux/bootmem.h
In reply to Mike RapoportQuoted 6 lines · Mike Rapoport
Move remaining definitions and declarations from
include/linux/bootmem.hintoinclude/linux/memblock.hand remove the redundant header.The includes were replaced with the semantic patch below and then semi-automated removal of duplicated '#include <
linux/memblock.h>
Quoted 6 lines
@@
@@
- #include <linux/bootmem.h>
+ #include <linux/memblock.h>Signed-off-by Mike Rapoport <[email protected]>
Signature · 2 lines
Michal Hocko SUSE Labs
On Fri 14-09-18 15:10:15, Mike Rapoport wrote:
[...]
Quoted 4 lines
326 files changed, 866 insertions(+), 2539 deletions(-) delete mode 100644 include/linux/bootmem.h delete mode 100644 mm/bootmem.c delete mode 100644 mm/nobootmem.c
I _really_ love this part the most! Not only we got rid of the translation which always has been a headache but also this nicely shows how having multiple allocators hurt. I believe further cleanups on top will make the boot allocator even a place where you look and your eyes do not want to jump out.
I have only went through patches without my acks from the previous iteration and there are only minor comments. This looks good overall.
Nice work Mike!
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 02/30] mm: remove CONFIG_NO_BOOTMEM
In reply to Michal HockoQuoted 7 lines · Michal Hocko
Quoted 2 lines · Mike Rapoport
All achitectures select
NO_BOOTMEMwhich essentially becomes 'Y' for any kernel configuration and therefore it can be removed.git grep suggests that
DEFERRED_STRUCT_PAGE_INITstill depends onNO_BOOTMEMbut I have a vague feeling that I've seen a patch to address that. It would be great to have it folded to this one.
Yes, Alexander has already fixed that at [1]
[1] https://lkml.org/lkml/2018/9/25/1073
Quoted 7 lines
Quoted 1 line
Signed-off-by Mike Rapoport <[email protected]>Acked-by Michal Hocko <[email protected]>Signature · 2 lines
Michal Hocko SUSE Labs
Signature · 2 lines
Sincerely yours, Mike.
Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK
In reply to Michal HockoQuoted 6 lines · Michal Hocko
Quoted 2 lines · Mike Rapoport
All architecures use memblock for early memory management. There is no need for the
CONFIG_HAVE_MEMBLOCKconfiguration option.git grep says
arch/csky/Kconfig: selectHAVE_MEMBLOCK
Not only that, there are other bootmem leftovers in csky. I've sent the patch with the necessary fixups [1]
[1] https://lkml.kernel.org/lkml/20180926112744.GC4628@rapoport-lnx/
Quoted 8 lines
Quoted 1 line
Signed-off-by Mike Rapoport <[email protected]>Other than that
Acked-by Michal Hocko <[email protected]>Signature · 2 lines
Michal Hocko SUSE Labs
Signature · 2 lines
Sincerely yours, Mike.
Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()
In reply to Michal HockoQuoted 6 lines · Michal Hocko
Quoted 5 lines · Michal Hocko
Quoted 3 lines · Mike Rapoport
With the align parameter
memblock_alloc_node()can be used as drop in replacement foralloc_bootmem_pages_node()and__alloc_bootmem_node(), which is done in the following patches.
Quoted 8 lines
Quoted 2 lines
/me confused. Why do we need this patch at all? Maybe it should be folded into the later patch you are refereing here?
OK, I can see [email protected] now. If you are going to repost for whatever reason please merge those two. Also I would get rid of the implicit "0 implies
SMP_CACHE_BYTES" behavior. It is subtle and you have to dig deep to find that out. Why not make it explicit?
Agree. I'd just prefer to make it a separate patch rather then resend the whole series.
Quoted 4 lines
Signature · 2 lines
Michal Hocko SUSE Labs
Signature · 2 lines
Sincerely yours, Mike.
Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()
Quoted 10 lines · Mike Rapoport
Quoted 9 lines · Michal Hocko
Quoted 7 lines · Michal Hocko
Quoted 3 lines · Mike Rapoport
With the align parameter
memblock_alloc_node()can be used as drop in replacement foralloc_bootmem_pages_node()and__alloc_bootmem_node(), which is done in the following patches./me confused. Why do we need this patch at all? Maybe it should be folded into the later patch you are refereing here?
Quoted 8 lines
Quoted 5 lines
OK, I can see [email protected] now. If you are going to repost for whatever reason please merge those two. Also I would get rid of the implicit "0 implies
SMP_CACHE_BYTES" behavior. It is subtle and you have to dig deep to find that out. Why not make it explicit?Agree. I'd just prefer to make it a separate patch rather then resend the whole series.
Sure, no objection from me.
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK
In reply to Mike RapoportQuoted 5 lines · Mike Rapoport
All architecures use memblock for early memory management. There is no need for the
CONFIG_HAVE_MEMBLOCKconfiguration option.Signed-off-by Mike Rapoport <[email protected]>
<snip>
Quoted 13 lines
include/linux/memblock.h +0
-1@@ -2,7 +2,6 @@#define _LINUX_MEMBLOCK_H#ifdef __KERNEL__ -#ifdef CONFIG_HAVE_MEMBLOCK /* * Logical memory blocks. *
include/linux/memblock.h static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) · line 463
Quoted 6 lines
include/linux/memblock.h +0
-1@@ -460,7 +459,6 @@ static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) {return 0 ; } -#endif /* CONFIG_HAVE_MEMBLOCK */ #endif /* __KERNEL__ */
There was an #else above this section and I believe it and the code after it needs to be stripped as well.
Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK
Quoted 27 lines · Alexander Duyck
Quoted 5 lines · Mike Rapoport
All architecures use memblock for early memory management. There is no need for the
CONFIG_HAVE_MEMBLOCKconfiguration option.Signed-off-by Mike Rapoport <[email protected]><snip>
Quoted 18 lines
include/linux/memblock.h +0
-2@@ -2,7 +2,6 @@#define _LINUX_MEMBLOCK_H#ifdef __KERNEL__ -#ifdef CONFIG_HAVE_MEMBLOCK /* * Logical memory blocks. * @@ -460,7 +459,6 @@ static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) {return 0 ; } -#endif /* CONFIG_HAVE_MEMBLOCK */
Quoted 4 lines
include/linux/memblock.h static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) · line 463
Quoted 1 line
include/linux/memblock.h +0
-0#endif /* __KERNEL__ */ There was an #else above this section and I believe it and the code after it needs to be stripped as well.
Right, I've already sent the fix [1] and it's in mmots.
[1] https://lkml.org/lkml/2018/9/19/416
Signature · 2 lines
Sincerely yours, Mike.
Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK
Quoted 29 lines · Mike Rapoport
Quoted 27 lines · Alexander Duyck
Quoted 5 lines · Mike Rapoport
All architecures use memblock for early memory management. There is no need for the
CONFIG_HAVE_MEMBLOCKconfiguration option.Signed-off-by Mike Rapoport <[email protected]><snip>
Quoted 18 lines
include/linux/memblock.h +0
-2@@ -2,7 +2,6 @@#define _LINUX_MEMBLOCK_H#ifdef __KERNEL__ -#ifdef CONFIG_HAVE_MEMBLOCK /* * Logical memory blocks. * @@ -460,7 +459,6 @@ static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) {return 0 ; } -#endif /* CONFIG_HAVE_MEMBLOCK */
Quoted 9 lines
Quoted 4 lines
include/linux/memblock.h static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) · line 463
Quoted 1 line
include/linux/memblock.h +0
-0#endif /* __KERNEL__ */ There was an #else above this section and I believe it and the code after it needs to be stripped as well.
Right, I've already sent the fix [1] and it's in mmots.
Are you sure? The patch you reference appears to be for drivers/of/fdt.c, and the bit I pointed out here is in include/linux/memblock.h.
- Alex
Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK
Quoted 35 lines · Alexander Duyck
Quoted 34 lines · Mike Rapoport
Quoted 31 lines · Alexander Duyck
Quoted 5 lines · Mike Rapoport
All architecures use memblock for early memory management. There is no need for the
CONFIG_HAVE_MEMBLOCKconfiguration option.Signed-off-by Mike Rapoport <[email protected]><snip>
Quoted 13 lines
include/linux/memblock.h +0
-1@@ -2,7 +2,6 @@#define _LINUX_MEMBLOCK_H#ifdef __KERNEL__ -#ifdef CONFIG_HAVE_MEMBLOCK /* * Logical memory blocks. * include/linux/memblock.h static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) · line 463
Quoted 6 lines
include/linux/memblock.h +0
-1@@ -460,7 +459,6 @@ static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) {return 0 ; } -#endif /* CONFIG_HAVE_MEMBLOCK */ #endif /* __KERNEL__ */ There was an #else above this section and I believe it and the code after it needs to be stripped as well.
Quoted 8 lines
Quoted 4 lines
Right, I've already sent the fix [1] and it's in mmots.
Are you sure? The patch you reference appears to be for
drivers/of/fdt.c, and the bit I pointed out here is ininclude/linux/memblock.h.
Ah, sorry. You are right, will fix. Thanks for spotting it!
Quoted 2 lines
- Alex
Signature · 2 lines
Sincerely yours, Mike.