diff options
author | Mike Rapoport <rppt@linux.ibm.com> | 2019-03-12 02:30:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-12 13:04:02 -0400 |
commit | 26fb3dae0a1ec78bdde4b5b72e0e709503e8c596 (patch) | |
tree | 2179b20e2d8552352f0d4bb8a1598a2340d22bef | |
parent | c0dbe825a9f11d68725b01b9ed311f7c44ca9166 (diff) |
memblock: drop memblock_alloc_*_nopanic() variants
As all the memblock allocation functions return NULL in case of error
rather than panic(), the duplicates with _nopanic suffix can be removed.
Link: http://lkml.kernel.org/r/1548057848-15136-22-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Petr Mladek <pmladek@suse.com> [printk]
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Guo Ren <ren_guo@c-sky.com> [c-sky]
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Juergen Gross <jgross@suse.com> [Xen]
Cc: Mark Salter <msalter@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
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>
-rw-r--r-- | arch/arc/kernel/unwind.c | 3 | ||||
-rw-r--r-- | arch/sh/mm/init.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/setup_percpu.c | 10 | ||||
-rw-r--r-- | arch/x86/mm/kasan_init_64.c | 14 | ||||
-rw-r--r-- | drivers/firmware/memmap.c | 2 | ||||
-rw-r--r-- | drivers/usb/early/xhci-dbc.c | 2 | ||||
-rw-r--r-- | include/linux/memblock.h | 35 | ||||
-rw-r--r-- | kernel/dma/swiotlb.c | 2 | ||||
-rw-r--r-- | kernel/printk/printk.c | 9 | ||||
-rw-r--r-- | mm/memblock.c | 35 | ||||
-rw-r--r-- | mm/page_alloc.c | 10 | ||||
-rw-r--r-- | mm/page_ext.c | 2 | ||||
-rw-r--r-- | mm/percpu.c | 11 | ||||
-rw-r--r-- | mm/sparse.c | 6 |
14 files changed, 31 insertions, 112 deletions
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index d34f69eb1a95..271e9fafa479 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c | |||
@@ -181,8 +181,7 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
181 | */ | 181 | */ |
182 | static void *__init unw_hdr_alloc_early(unsigned long sz) | 182 | static void *__init unw_hdr_alloc_early(unsigned long sz) |
183 | { | 183 | { |
184 | return memblock_alloc_from_nopanic(sz, sizeof(unsigned int), | 184 | return memblock_alloc_from(sz, sizeof(unsigned int), MAX_DMA_ADDRESS); |
185 | MAX_DMA_ADDRESS); | ||
186 | } | 185 | } |
187 | 186 | ||
188 | static void *unw_hdr_alloc(unsigned long sz) | 187 | static void *unw_hdr_alloc(unsigned long sz) |
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index fceefd92016f..70621324db41 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -202,7 +202,7 @@ void __init allocate_pgdat(unsigned int nid) | |||
202 | get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); | 202 | get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); |
203 | 203 | ||
204 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 204 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
205 | NODE_DATA(nid) = memblock_alloc_try_nid_nopanic( | 205 | NODE_DATA(nid) = memblock_alloc_try_nid( |
206 | sizeof(struct pglist_data), | 206 | sizeof(struct pglist_data), |
207 | SMP_CACHE_BYTES, MEMBLOCK_LOW_LIMIT, | 207 | SMP_CACHE_BYTES, MEMBLOCK_LOW_LIMIT, |
208 | MEMBLOCK_ALLOC_ACCESSIBLE, nid); | 208 | MEMBLOCK_ALLOC_ACCESSIBLE, nid); |
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 13af08827eef..4bf46575568a 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -106,22 +106,22 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, | |||
106 | void *ptr; | 106 | void *ptr; |
107 | 107 | ||
108 | if (!node_online(node) || !NODE_DATA(node)) { | 108 | if (!node_online(node) || !NODE_DATA(node)) { |
109 | ptr = memblock_alloc_from_nopanic(size, align, goal); | 109 | ptr = memblock_alloc_from(size, align, goal); |
110 | pr_info("cpu %d has no node %d or node-local memory\n", | 110 | pr_info("cpu %d has no node %d or node-local memory\n", |
111 | cpu, node); | 111 | cpu, node); |
112 | pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n", | 112 | pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n", |
113 | cpu, size, __pa(ptr)); | 113 | cpu, size, __pa(ptr)); |
114 | } else { | 114 | } else { |
115 | ptr = memblock_alloc_try_nid_nopanic(size, align, goal, | 115 | ptr = memblock_alloc_try_nid(size, align, goal, |
116 | MEMBLOCK_ALLOC_ACCESSIBLE, | 116 | MEMBLOCK_ALLOC_ACCESSIBLE, |
117 | node); | 117 | node); |
118 | 118 | ||
119 | pr_debug("per cpu data for cpu%d %lu bytes on node%d at %016lx\n", | 119 | pr_debug("per cpu data for cpu%d %lu bytes on node%d at %016lx\n", |
120 | cpu, size, node, __pa(ptr)); | 120 | cpu, size, node, __pa(ptr)); |
121 | } | 121 | } |
122 | return ptr; | 122 | return ptr; |
123 | #else | 123 | #else |
124 | return memblock_alloc_from_nopanic(size, align, goal); | 124 | return memblock_alloc_from(size, align, goal); |
125 | #endif | 125 | #endif |
126 | } | 126 | } |
127 | 127 | ||
diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c index 462fde83b515..8dc0fc0b1382 100644 --- a/arch/x86/mm/kasan_init_64.c +++ b/arch/x86/mm/kasan_init_64.c | |||
@@ -24,14 +24,16 @@ extern struct range pfn_mapped[E820_MAX_ENTRIES]; | |||
24 | 24 | ||
25 | static p4d_t tmp_p4d_table[MAX_PTRS_PER_P4D] __initdata __aligned(PAGE_SIZE); | 25 | static p4d_t tmp_p4d_table[MAX_PTRS_PER_P4D] __initdata __aligned(PAGE_SIZE); |
26 | 26 | ||
27 | static __init void *early_alloc(size_t size, int nid, bool panic) | 27 | static __init void *early_alloc(size_t size, int nid, bool should_panic) |
28 | { | 28 | { |
29 | if (panic) | 29 | void *ptr = memblock_alloc_try_nid(size, size, |
30 | return memblock_alloc_try_nid(size, size, | ||
31 | __pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid); | ||
32 | else | ||
33 | return memblock_alloc_try_nid_nopanic(size, size, | ||
34 | __pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid); | 30 | __pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid); |
31 | |||
32 | if (!ptr && should_panic) | ||
33 | panic("%pS: Failed to allocate page, nid=%d from=%lx\n", | ||
34 | (void *)_RET_IP_, nid, __pa(MAX_DMA_ADDRESS)); | ||
35 | |||
36 | return ptr; | ||
35 | } | 37 | } |
36 | 38 | ||
37 | static void __init kasan_populate_pmd(pmd_t *pmd, unsigned long addr, | 39 | static void __init kasan_populate_pmd(pmd_t *pmd, unsigned long addr, |
diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c index ec4fd253a4e9..d168c87c7d30 100644 --- a/drivers/firmware/memmap.c +++ b/drivers/firmware/memmap.c | |||
@@ -333,7 +333,7 @@ int __init firmware_map_add_early(u64 start, u64 end, const char *type) | |||
333 | { | 333 | { |
334 | struct firmware_map_entry *entry; | 334 | struct firmware_map_entry *entry; |
335 | 335 | ||
336 | entry = memblock_alloc_nopanic(sizeof(struct firmware_map_entry), | 336 | entry = memblock_alloc(sizeof(struct firmware_map_entry), |
337 | SMP_CACHE_BYTES); | 337 | SMP_CACHE_BYTES); |
338 | if (WARN_ON(!entry)) | 338 | if (WARN_ON(!entry)) |
339 | return -ENOMEM; | 339 | return -ENOMEM; |
diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c index d2652dccc699..c9cfb100ecdc 100644 --- a/drivers/usb/early/xhci-dbc.c +++ b/drivers/usb/early/xhci-dbc.c | |||
@@ -94,7 +94,7 @@ static void * __init xdbc_get_page(dma_addr_t *dma_addr) | |||
94 | { | 94 | { |
95 | void *virt; | 95 | void *virt; |
96 | 96 | ||
97 | virt = memblock_alloc_nopanic(PAGE_SIZE, PAGE_SIZE); | 97 | virt = memblock_alloc(PAGE_SIZE, PAGE_SIZE); |
98 | if (!virt) | 98 | if (!virt) |
99 | return NULL; | 99 | return NULL; |
100 | 100 | ||
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index c077227e6d53..db69ad97aa2e 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -335,9 +335,6 @@ static inline phys_addr_t memblock_phys_alloc(phys_addr_t size, | |||
335 | void *memblock_alloc_try_nid_raw(phys_addr_t size, phys_addr_t align, | 335 | void *memblock_alloc_try_nid_raw(phys_addr_t size, phys_addr_t align, |
336 | phys_addr_t min_addr, phys_addr_t max_addr, | 336 | phys_addr_t min_addr, phys_addr_t max_addr, |
337 | int nid); | 337 | int nid); |
338 | void *memblock_alloc_try_nid_nopanic(phys_addr_t size, phys_addr_t align, | ||
339 | phys_addr_t min_addr, phys_addr_t max_addr, | ||
340 | int nid); | ||
341 | void *memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, | 338 | void *memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, |
342 | phys_addr_t min_addr, phys_addr_t max_addr, | 339 | phys_addr_t min_addr, phys_addr_t max_addr, |
343 | int nid); | 340 | int nid); |
@@ -364,36 +361,12 @@ static inline void * __init memblock_alloc_from(phys_addr_t size, | |||
364 | MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE); | 361 | MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE); |
365 | } | 362 | } |
366 | 363 | ||
367 | static inline void * __init memblock_alloc_nopanic(phys_addr_t size, | ||
368 | phys_addr_t align) | ||
369 | { | ||
370 | return memblock_alloc_try_nid_nopanic(size, align, MEMBLOCK_LOW_LIMIT, | ||
371 | MEMBLOCK_ALLOC_ACCESSIBLE, | ||
372 | NUMA_NO_NODE); | ||
373 | } | ||
374 | |||
375 | static inline void * __init memblock_alloc_low(phys_addr_t size, | 364 | static inline void * __init memblock_alloc_low(phys_addr_t size, |
376 | phys_addr_t align) | 365 | phys_addr_t align) |
377 | { | 366 | { |
378 | return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT, | 367 | return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT, |
379 | ARCH_LOW_ADDRESS_LIMIT, NUMA_NO_NODE); | 368 | ARCH_LOW_ADDRESS_LIMIT, NUMA_NO_NODE); |
380 | } | 369 | } |
381 | static inline void * __init memblock_alloc_low_nopanic(phys_addr_t size, | ||
382 | phys_addr_t align) | ||
383 | { | ||
384 | return memblock_alloc_try_nid_nopanic(size, align, MEMBLOCK_LOW_LIMIT, | ||
385 | ARCH_LOW_ADDRESS_LIMIT, | ||
386 | NUMA_NO_NODE); | ||
387 | } | ||
388 | |||
389 | static inline void * __init memblock_alloc_from_nopanic(phys_addr_t size, | ||
390 | phys_addr_t align, | ||
391 | phys_addr_t min_addr) | ||
392 | { | ||
393 | return memblock_alloc_try_nid_nopanic(size, align, min_addr, | ||
394 | MEMBLOCK_ALLOC_ACCESSIBLE, | ||
395 | NUMA_NO_NODE); | ||
396 | } | ||
397 | 370 | ||
398 | static inline void * __init memblock_alloc_node(phys_addr_t size, | 371 | static inline void * __init memblock_alloc_node(phys_addr_t size, |
399 | phys_addr_t align, int nid) | 372 | phys_addr_t align, int nid) |
@@ -402,14 +375,6 @@ static inline void * __init memblock_alloc_node(phys_addr_t size, | |||
402 | MEMBLOCK_ALLOC_ACCESSIBLE, nid); | 375 | MEMBLOCK_ALLOC_ACCESSIBLE, nid); |
403 | } | 376 | } |
404 | 377 | ||
405 | static inline void * __init memblock_alloc_node_nopanic(phys_addr_t size, | ||
406 | int nid) | ||
407 | { | ||
408 | return memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, | ||
409 | MEMBLOCK_LOW_LIMIT, | ||
410 | MEMBLOCK_ALLOC_ACCESSIBLE, nid); | ||
411 | } | ||
412 | |||
413 | static inline void __init memblock_free_early(phys_addr_t base, | 378 | static inline void __init memblock_free_early(phys_addr_t base, |
414 | phys_addr_t size) | 379 | phys_addr_t size) |
415 | { | 380 | { |
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 56ac77a80b1f..53012db1e53c 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c | |||
@@ -256,7 +256,7 @@ swiotlb_init(int verbose) | |||
256 | bytes = io_tlb_nslabs << IO_TLB_SHIFT; | 256 | bytes = io_tlb_nslabs << IO_TLB_SHIFT; |
257 | 257 | ||
258 | /* Get IO TLB memory from the low pages */ | 258 | /* Get IO TLB memory from the low pages */ |
259 | vstart = memblock_alloc_low_nopanic(PAGE_ALIGN(bytes), PAGE_SIZE); | 259 | vstart = memblock_alloc_low(PAGE_ALIGN(bytes), PAGE_SIZE); |
260 | if (vstart && !swiotlb_init_with_tbl(vstart, io_tlb_nslabs, verbose)) | 260 | if (vstart && !swiotlb_init_with_tbl(vstart, io_tlb_nslabs, verbose)) |
261 | return; | 261 | return; |
262 | 262 | ||
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 8eee85bb2687..6b7654b8001f 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
@@ -1143,14 +1143,7 @@ void __init setup_log_buf(int early) | |||
1143 | if (!new_log_buf_len) | 1143 | if (!new_log_buf_len) |
1144 | return; | 1144 | return; |
1145 | 1145 | ||
1146 | if (early) { | 1146 | new_log_buf = memblock_alloc(new_log_buf_len, LOG_ALIGN); |
1147 | new_log_buf = | ||
1148 | memblock_alloc(new_log_buf_len, LOG_ALIGN); | ||
1149 | } else { | ||
1150 | new_log_buf = memblock_alloc_nopanic(new_log_buf_len, | ||
1151 | LOG_ALIGN); | ||
1152 | } | ||
1153 | |||
1154 | if (unlikely(!new_log_buf)) { | 1147 | if (unlikely(!new_log_buf)) { |
1155 | pr_err("log_buf_len: %lu bytes not available\n", | 1148 | pr_err("log_buf_len: %lu bytes not available\n", |
1156 | new_log_buf_len); | 1149 | new_log_buf_len); |
diff --git a/mm/memblock.c b/mm/memblock.c index a838c50ca9a8..0ab30d0185bc 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -1434,41 +1434,6 @@ void * __init memblock_alloc_try_nid_raw( | |||
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | /** | 1436 | /** |
1437 | * memblock_alloc_try_nid_nopanic - allocate boot memory block | ||
1438 | * @size: size of memory block to be allocated in bytes | ||
1439 | * @align: alignment of the region and block's size | ||
1440 | * @min_addr: the lower bound of the memory region from where the allocation | ||
1441 | * is preferred (phys address) | ||
1442 | * @max_addr: the upper bound of the memory region from where the allocation | ||
1443 | * is preferred (phys address), or %MEMBLOCK_ALLOC_ACCESSIBLE to | ||
1444 | * allocate only from memory limited by memblock.current_limit value | ||
1445 | * @nid: nid of the free area to find, %NUMA_NO_NODE for any node | ||
1446 | * | ||
1447 | * Public function, provides additional debug information (including caller | ||
1448 | * info), if enabled. This function zeroes the allocated memory. | ||
1449 | * | ||
1450 | * Return: | ||
1451 | * Virtual address of allocated memory block on success, NULL on failure. | ||
1452 | */ | ||
1453 | void * __init memblock_alloc_try_nid_nopanic( | ||
1454 | phys_addr_t size, phys_addr_t align, | ||
1455 | phys_addr_t min_addr, phys_addr_t max_addr, | ||
1456 | int nid) | ||
1457 | { | ||
1458 | void *ptr; | ||
1459 | |||
1460 | memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pF\n", | ||
1461 | __func__, (u64)size, (u64)align, nid, &min_addr, | ||
1462 | &max_addr, (void *)_RET_IP_); | ||
1463 | |||
1464 | ptr = memblock_alloc_internal(size, align, | ||
1465 | min_addr, max_addr, nid); | ||
1466 | if (ptr) | ||
1467 | memset(ptr, 0, size); | ||
1468 | return ptr; | ||
1469 | } | ||
1470 | |||
1471 | /** | ||
1472 | * memblock_alloc_try_nid - allocate boot memory block | 1437 | * memblock_alloc_try_nid - allocate boot memory block |
1473 | * @size: size of memory block to be allocated in bytes | 1438 | * @size: size of memory block to be allocated in bytes |
1474 | * @align: alignment of the region and block's size | 1439 | * @align: alignment of the region and block's size |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3eb01dedfb50..03fcf73d47da 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -6445,8 +6445,8 @@ static void __ref setup_usemap(struct pglist_data *pgdat, | |||
6445 | zone->pageblock_flags = NULL; | 6445 | zone->pageblock_flags = NULL; |
6446 | if (usemapsize) { | 6446 | if (usemapsize) { |
6447 | zone->pageblock_flags = | 6447 | zone->pageblock_flags = |
6448 | memblock_alloc_node_nopanic(usemapsize, | 6448 | memblock_alloc_node(usemapsize, SMP_CACHE_BYTES, |
6449 | pgdat->node_id); | 6449 | pgdat->node_id); |
6450 | if (!zone->pageblock_flags) | 6450 | if (!zone->pageblock_flags) |
6451 | panic("Failed to allocate %ld bytes for zone %s pageblock flags on node %d\n", | 6451 | panic("Failed to allocate %ld bytes for zone %s pageblock flags on node %d\n", |
6452 | usemapsize, zone->name, pgdat->node_id); | 6452 | usemapsize, zone->name, pgdat->node_id); |
@@ -6679,7 +6679,8 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat) | |||
6679 | end = pgdat_end_pfn(pgdat); | 6679 | end = pgdat_end_pfn(pgdat); |
6680 | end = ALIGN(end, MAX_ORDER_NR_PAGES); | 6680 | end = ALIGN(end, MAX_ORDER_NR_PAGES); |
6681 | size = (end - start) * sizeof(struct page); | 6681 | size = (end - start) * sizeof(struct page); |
6682 | map = memblock_alloc_node_nopanic(size, pgdat->node_id); | 6682 | map = memblock_alloc_node(size, SMP_CACHE_BYTES, |
6683 | pgdat->node_id); | ||
6683 | if (!map) | 6684 | if (!map) |
6684 | panic("Failed to allocate %ld bytes for node %d memory map\n", | 6685 | panic("Failed to allocate %ld bytes for node %d memory map\n", |
6685 | size, pgdat->node_id); | 6686 | size, pgdat->node_id); |
@@ -7959,8 +7960,7 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
7959 | size = bucketsize << log2qty; | 7960 | size = bucketsize << log2qty; |
7960 | if (flags & HASH_EARLY) { | 7961 | if (flags & HASH_EARLY) { |
7961 | if (flags & HASH_ZERO) | 7962 | if (flags & HASH_ZERO) |
7962 | table = memblock_alloc_nopanic(size, | 7963 | table = memblock_alloc(size, SMP_CACHE_BYTES); |
7963 | SMP_CACHE_BYTES); | ||
7964 | else | 7964 | else |
7965 | table = memblock_alloc_raw(size, | 7965 | table = memblock_alloc_raw(size, |
7966 | SMP_CACHE_BYTES); | 7966 | SMP_CACHE_BYTES); |
diff --git a/mm/page_ext.c b/mm/page_ext.c index ab4244920e0f..d8f1aca4ad43 100644 --- a/mm/page_ext.c +++ b/mm/page_ext.c | |||
@@ -161,7 +161,7 @@ static int __init alloc_node_page_ext(int nid) | |||
161 | 161 | ||
162 | table_size = get_entry_size() * nr_pages; | 162 | table_size = get_entry_size() * nr_pages; |
163 | 163 | ||
164 | base = memblock_alloc_try_nid_nopanic( | 164 | base = memblock_alloc_try_nid( |
165 | table_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), | 165 | table_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), |
166 | MEMBLOCK_ALLOC_ACCESSIBLE, nid); | 166 | MEMBLOCK_ALLOC_ACCESSIBLE, nid); |
167 | if (!base) | 167 | if (!base) |
diff --git a/mm/percpu.c b/mm/percpu.c index 3f9fb3086a9b..2e6fc8d552c9 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1905,7 +1905,7 @@ struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups, | |||
1905 | __alignof__(ai->groups[0].cpu_map[0])); | 1905 | __alignof__(ai->groups[0].cpu_map[0])); |
1906 | ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]); | 1906 | ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]); |
1907 | 1907 | ||
1908 | ptr = memblock_alloc_nopanic(PFN_ALIGN(ai_size), PAGE_SIZE); | 1908 | ptr = memblock_alloc(PFN_ALIGN(ai_size), PAGE_SIZE); |
1909 | if (!ptr) | 1909 | if (!ptr) |
1910 | return NULL; | 1910 | return NULL; |
1911 | ai = ptr; | 1911 | ai = ptr; |
@@ -2496,7 +2496,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, | |||
2496 | size_sum = ai->static_size + ai->reserved_size + ai->dyn_size; | 2496 | size_sum = ai->static_size + ai->reserved_size + ai->dyn_size; |
2497 | areas_size = PFN_ALIGN(ai->nr_groups * sizeof(void *)); | 2497 | areas_size = PFN_ALIGN(ai->nr_groups * sizeof(void *)); |
2498 | 2498 | ||
2499 | areas = memblock_alloc_nopanic(areas_size, SMP_CACHE_BYTES); | 2499 | areas = memblock_alloc(areas_size, SMP_CACHE_BYTES); |
2500 | if (!areas) { | 2500 | if (!areas) { |
2501 | rc = -ENOMEM; | 2501 | rc = -ENOMEM; |
2502 | goto out_free; | 2502 | goto out_free; |
@@ -2729,8 +2729,7 @@ EXPORT_SYMBOL(__per_cpu_offset); | |||
2729 | static void * __init pcpu_dfl_fc_alloc(unsigned int cpu, size_t size, | 2729 | static void * __init pcpu_dfl_fc_alloc(unsigned int cpu, size_t size, |
2730 | size_t align) | 2730 | size_t align) |
2731 | { | 2731 | { |
2732 | return memblock_alloc_from_nopanic( | 2732 | return memblock_alloc_from(size, align, __pa(MAX_DMA_ADDRESS)); |
2733 | size, align, __pa(MAX_DMA_ADDRESS)); | ||
2734 | } | 2733 | } |
2735 | 2734 | ||
2736 | static void __init pcpu_dfl_fc_free(void *ptr, size_t size) | 2735 | static void __init pcpu_dfl_fc_free(void *ptr, size_t size) |
@@ -2778,9 +2777,7 @@ void __init setup_per_cpu_areas(void) | |||
2778 | void *fc; | 2777 | void *fc; |
2779 | 2778 | ||
2780 | ai = pcpu_alloc_alloc_info(1, 1); | 2779 | ai = pcpu_alloc_alloc_info(1, 1); |
2781 | fc = memblock_alloc_from_nopanic(unit_size, | 2780 | fc = memblock_alloc_from(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); |
2782 | PAGE_SIZE, | ||
2783 | __pa(MAX_DMA_ADDRESS)); | ||
2784 | if (!ai || !fc) | 2781 | if (!ai || !fc) |
2785 | panic("Failed to allocate memory for percpu areas."); | 2782 | panic("Failed to allocate memory for percpu areas."); |
2786 | /* kmemleak tracks the percpu allocations separately */ | 2783 | /* kmemleak tracks the percpu allocations separately */ |
diff --git a/mm/sparse.c b/mm/sparse.c index 7397fb4e78b4..69904aa6165b 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -330,9 +330,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, | |||
330 | limit = goal + (1UL << PA_SECTION_SHIFT); | 330 | limit = goal + (1UL << PA_SECTION_SHIFT); |
331 | nid = early_pfn_to_nid(goal >> PAGE_SHIFT); | 331 | nid = early_pfn_to_nid(goal >> PAGE_SHIFT); |
332 | again: | 332 | again: |
333 | p = memblock_alloc_try_nid_nopanic(size, | 333 | p = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid); |
334 | SMP_CACHE_BYTES, goal, limit, | ||
335 | nid); | ||
336 | if (!p && limit) { | 334 | if (!p && limit) { |
337 | limit = 0; | 335 | limit = 0; |
338 | goto again; | 336 | goto again; |
@@ -386,7 +384,7 @@ static unsigned long * __init | |||
386 | sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, | 384 | sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, |
387 | unsigned long size) | 385 | unsigned long size) |
388 | { | 386 | { |
389 | return memblock_alloc_node_nopanic(size, pgdat->node_id); | 387 | return memblock_alloc_node(size, SMP_CACHE_BYTES, pgdat->node_id); |
390 | } | 388 | } |
391 | 389 | ||
392 | static void __init check_usemap_section_nr(int nid, unsigned long *usemap) | 390 | static void __init check_usemap_section_nr(int nid, unsigned long *usemap) |