Skip to content

Commit 97ad108

Browse files
rppttorvalds
authored andcommitted
memblock: replace BOOTMEM_ALLOC_* with MEMBLOCK variants
Drop BOOTMEM_ALLOC_ACCESSIBLE and BOOTMEM_ALLOC_ANYWHERE in favor of identical MEMBLOCK definitions. Link: http://lkml.kernel.org/r/1536927045-23536-29-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chris Zankel <chris@zankel.net> Cc: "David S. Miller" <davem@davemloft.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greentime Hu <green.hu@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Guan Xuetao <gxt@pku.edu.cn> Cc: Ingo Molnar <mingo@redhat.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Jonas Bonn <jonas@southpole.se> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Ley Foon Tan <lftan@altera.com> Cc: Mark Salter <msalter@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Matt Turner <mattst88@gmail.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Simek <monstr@monstr.eu> Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Paul Burton <paul.burton@mips.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Richard Weinberger <richard@nod.at> Cc: Rich Felker <dalias@libc.org> Cc: Russell King <linux@armlinux.org.uk> Cc: Serge Semin <fancer.lancer@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent bda49a8 commit 97ad108

File tree

11 files changed

+19
-16
lines changed

11 files changed

+19
-16
lines changed

arch/ia64/mm/discontig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)
453453

454454
ptr = memblock_alloc_try_nid(pernodesize, PERCPU_PAGE_SIZE,
455455
__pa(MAX_DMA_ADDRESS),
456-
BOOTMEM_ALLOC_ACCESSIBLE,
456+
MEMBLOCK_ALLOC_ACCESSIBLE,
457457
bestnode);
458458

459459
return ptr;

arch/powerpc/kernel/setup_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ void __init emergency_stack_init(void)
764764
static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
765765
{
766766
return memblock_alloc_try_nid(size, align, __pa(MAX_DMA_ADDRESS),
767-
BOOTMEM_ALLOC_ACCESSIBLE,
767+
MEMBLOCK_ALLOC_ACCESSIBLE,
768768
early_cpu_to_node(cpu));
769769

770770
}

arch/sparc/kernel/smp_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size,
15951595
cpu, size, __pa(ptr));
15961596
} else {
15971597
ptr = memblock_alloc_try_nid(size, align, goal,
1598-
BOOTMEM_ALLOC_ACCESSIBLE, node);
1598+
MEMBLOCK_ALLOC_ACCESSIBLE, node);
15991599
pr_debug("per cpu data for cpu%d %lu bytes on node%d at "
16001600
"%016lx\n", cpu, size, node, __pa(ptr));
16011601
}

arch/x86/kernel/setup_percpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
114114
cpu, size, __pa(ptr));
115115
} else {
116116
ptr = memblock_alloc_try_nid_nopanic(size, align, goal,
117-
BOOTMEM_ALLOC_ACCESSIBLE,
117+
MEMBLOCK_ALLOC_ACCESSIBLE,
118118
node);
119119

120120
pr_debug("per cpu data for cpu%d %lu bytes on node%d at %016lx\n",

arch/x86/mm/kasan_init_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ static __init void *early_alloc(size_t size, int nid, bool panic)
2929
{
3030
if (panic)
3131
return memblock_alloc_try_nid(size, size,
32-
__pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
32+
__pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid);
3333
else
3434
return memblock_alloc_try_nid_nopanic(size, size,
35-
__pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
35+
__pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid);
3636
}
3737

3838
static void __init kasan_populate_pmd(pmd_t *pmd, unsigned long addr,

mm/hugetlb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/cpuset.h>
1717
#include <linux/mutex.h>
1818
#include <linux/bootmem.h>
19+
#include <linux/memblock.h>
1920
#include <linux/sysfs.h>
2021
#include <linux/slab.h>
2122
#include <linux/mmdebug.h>
@@ -2102,7 +2103,7 @@ int __alloc_bootmem_huge_page(struct hstate *h)
21022103

21032104
addr = memblock_alloc_try_nid_raw(
21042105
huge_page_size(h), huge_page_size(h),
2105-
0, BOOTMEM_ALLOC_ACCESSIBLE, node);
2106+
0, MEMBLOCK_ALLOC_ACCESSIBLE, node);
21062107
if (addr) {
21072108
/*
21082109
* Use the beginning of the huge page to store the

mm/kasan/kasan_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static inline bool kasan_zero_page_entry(pte_t pte)
8484
static __init void *early_alloc(size_t size, int node)
8585
{
8686
return memblock_alloc_try_nid(size, size, __pa(MAX_DMA_ADDRESS),
87-
BOOTMEM_ALLOC_ACCESSIBLE, node);
87+
MEMBLOCK_ALLOC_ACCESSIBLE, node);
8888
}
8989

9090
static void __ref zero_pte_populate(pmd_t *pmd, unsigned long addr,

mm/memblock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ phys_addr_t __init memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t ali
13421342
* hold the requested memory.
13431343
*
13441344
* The allocation is performed from memory region limited by
1345-
* memblock.current_limit if @max_addr == %BOOTMEM_ALLOC_ACCESSIBLE.
1345+
* memblock.current_limit if @max_addr == %MEMBLOCK_ALLOC_ACCESSIBLE.
13461346
*
13471347
* The memory block is aligned on %SMP_CACHE_BYTES if @align == 0.
13481348
*
@@ -1429,7 +1429,7 @@ static void * __init memblock_alloc_internal(
14291429
* @min_addr: the lower bound of the memory region from where the allocation
14301430
* is preferred (phys address)
14311431
* @max_addr: the upper bound of the memory region from where the allocation
1432-
* is preferred (phys address), or %BOOTMEM_ALLOC_ACCESSIBLE to
1432+
* is preferred (phys address), or %MEMBLOCK_ALLOC_ACCESSIBLE to
14331433
* allocate only from memory limited by memblock.current_limit value
14341434
* @nid: nid of the free area to find, %NUMA_NO_NODE for any node
14351435
*
@@ -1466,7 +1466,7 @@ void * __init memblock_alloc_try_nid_raw(
14661466
* @min_addr: the lower bound of the memory region from where the allocation
14671467
* is preferred (phys address)
14681468
* @max_addr: the upper bound of the memory region from where the allocation
1469-
* is preferred (phys address), or %BOOTMEM_ALLOC_ACCESSIBLE to
1469+
* is preferred (phys address), or %MEMBLOCK_ALLOC_ACCESSIBLE to
14701470
* allocate only from memory limited by memblock.current_limit value
14711471
* @nid: nid of the free area to find, %NUMA_NO_NODE for any node
14721472
*
@@ -1501,7 +1501,7 @@ void * __init memblock_alloc_try_nid_nopanic(
15011501
* @min_addr: the lower bound of the memory region from where the allocation
15021502
* is preferred (phys address)
15031503
* @max_addr: the upper bound of the memory region from where the allocation
1504-
* is preferred (phys address), or %BOOTMEM_ALLOC_ACCESSIBLE to
1504+
* is preferred (phys address), or %MEMBLOCK_ALLOC_ACCESSIBLE to
15051505
* allocate only from memory limited by memblock.current_limit value
15061506
* @nid: nid of the free area to find, %NUMA_NO_NODE for any node
15071507
*

mm/page_ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int __init alloc_node_page_ext(int nid)
163163

164164
base = memblock_alloc_try_nid_nopanic(
165165
table_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS),
166-
BOOTMEM_ALLOC_ACCESSIBLE, nid);
166+
MEMBLOCK_ALLOC_ACCESSIBLE, nid);
167167
if (!base)
168168
return -ENOMEM;
169169
NODE_DATA(nid)->node_page_ext = base;

mm/sparse-vmemmap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/mm.h>
2222
#include <linux/mmzone.h>
2323
#include <linux/bootmem.h>
24+
#include <linux/memblock.h>
2425
#include <linux/memremap.h>
2526
#include <linux/highmem.h>
2627
#include <linux/slab.h>
@@ -43,7 +44,7 @@ static void * __ref __earlyonly_bootmem_alloc(int node,
4344
unsigned long goal)
4445
{
4546
return memblock_alloc_try_nid_raw(size, align, goal,
46-
BOOTMEM_ALLOC_ACCESSIBLE, node);
47+
MEMBLOCK_ALLOC_ACCESSIBLE, node);
4748
}
4849

4950
void * __meminit vmemmap_alloc_block(unsigned long size, int node)

mm/sparse.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/slab.h>
77
#include <linux/mmzone.h>
88
#include <linux/bootmem.h>
9+
#include <linux/memblock.h>
910
#include <linux/compiler.h>
1011
#include <linux/highmem.h>
1112
#include <linux/export.h>
@@ -393,7 +394,7 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid,
393394

394395
map = memblock_alloc_try_nid(size,
395396
PAGE_SIZE, __pa(MAX_DMA_ADDRESS),
396-
BOOTMEM_ALLOC_ACCESSIBLE, nid);
397+
MEMBLOCK_ALLOC_ACCESSIBLE, nid);
397398
return map;
398399
}
399400
#endif /* !CONFIG_SPARSEMEM_VMEMMAP */
@@ -407,7 +408,7 @@ static void __init sparse_buffer_init(unsigned long size, int nid)
407408
sparsemap_buf =
408409
memblock_alloc_try_nid_raw(size, PAGE_SIZE,
409410
__pa(MAX_DMA_ADDRESS),
410-
BOOTMEM_ALLOC_ACCESSIBLE, nid);
411+
MEMBLOCK_ALLOC_ACCESSIBLE, nid);
411412
sparsemap_buf_end = sparsemap_buf + size;
412413
}
413414

0 commit comments

Comments
 (0)