From: Mike Rapoport <rppt@linux.vnet.ibm.com>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH 16/30] memblock: replace __alloc_bootmem_node with appropriate memblock_ API
Date: Fri, 14 Sep 2018 15:10:31 +0300 [thread overview]
Message-ID: <1536927045-23536-17-git-send-email-rppt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1536927045-23536-1-git-send-email-rppt@linux.vnet.ibm.com>
Use memblock_alloc_try_nid whenever goal (i.e. minimal address is
specified) and memblock_alloc_node otherwise.
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
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(-)
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 1928d57..918dda9 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -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;
}
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6a501b2..6add560 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -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)
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 206bf81..5fb11ea 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -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);
}
}
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index d3ea1f3..83ff88d 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -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));
}
--
2.7.4
next prev parent reply other threads:[~2018-09-14 12:10 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-14 12:10 [OpenRISC] [PATCH 00/30] mm: remove bootmem allocator Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 01/30] mips: switch to NO_BOOTMEM Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 02/30] mm: remove CONFIG_NO_BOOTMEM Mike Rapoport
2018-09-26 9:22 ` Michal Hocko
2018-09-26 11:48 ` Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK Mike Rapoport
2018-09-26 9:24 ` Michal Hocko
2018-09-26 11:54 ` Mike Rapoport
2018-09-26 16:58 ` Alexander Duyck
2018-09-26 18:31 ` Mike Rapoport
2018-09-27 0:34 ` Alexander Duyck
2018-09-27 4:50 ` Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 04/30] mm: remove bootmem allocator implementation Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 05/30] mm: nobootmem: remove dead code Mike Rapoport
2018-09-26 9:25 ` Michal Hocko
2018-09-14 12:10 ` [OpenRISC] [PATCH 06/30] memblock: rename memblock_alloc{_nid, _try_nid} to memblock_phys_alloc* Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 07/30] memblock: remove _virt from APIs returning virtual address Mike Rapoport
2018-09-26 9:27 ` Michal Hocko
2018-09-14 12:10 ` [OpenRISC] [PATCH 08/30] memblock: replace alloc_bootmem_align with memblock_alloc Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 09/30] memblock: replace alloc_bootmem_low with memblock_alloc_low Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 10/30] memblock: replace __alloc_bootmem_node_nopanic with memblock_alloc_try_nid_nopanic Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 11/30] memblock: replace alloc_bootmem_pages_nopanic with memblock_alloc_nopanic Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 12/30] memblock: replace alloc_bootmem_low with memblock_alloc_low Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 13/30] memblock: replace __alloc_bootmem_nopanic with memblock_alloc_from_nopanic Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 14/30] memblock: add align parameter to memblock_alloc_node() Mike Rapoport
2018-09-26 9:31 ` Michal Hocko
2018-09-26 9:36 ` Michal Hocko
2018-09-26 13:43 ` Mike Rapoport
2018-09-26 14:23 ` Michal Hocko
2018-09-14 12:10 ` [OpenRISC] [PATCH 15/30] memblock: replace alloc_bootmem_pages_node with memblock_alloc_node Mike Rapoport
2018-09-14 12:10 ` Mike Rapoport [this message]
2018-09-26 9:37 ` [OpenRISC] [PATCH 16/30] memblock: replace __alloc_bootmem_node with appropriate memblock_ API Michal Hocko
2018-09-14 12:10 ` [OpenRISC] [PATCH 17/30] memblock: replace alloc_bootmem_node with memblock_alloc_node Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 18/30] memblock: replace alloc_bootmem_low_pages with memblock_alloc_low Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 19/30] memblock: replace alloc_bootmem_pages with memblock_alloc Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 20/30] memblock: replace __alloc_bootmem with memblock_alloc_from Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 21/30] memblock: replace alloc_bootmem with memblock_alloc Mike Rapoport
2018-09-26 9:38 ` Michal Hocko
2018-09-14 12:10 ` [OpenRISC] [PATCH 22/30] mm: nobootmem: remove bootmem allocation APIs Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 23/30] memblock: replace free_bootmem{_node} with memblock_free Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 24/30] memblock: replace free_bootmem_late with memblock_free_late Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 25/30] memblock: rename free_all_bootmem to memblock_free_all Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 26/30] memblock: rename __free_pages_bootmem to memblock_free_pages Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 27/30] mm: remove nobootmem Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 28/30] memblock: replace BOOTMEM_ALLOC_* with MEMBLOCK variants Mike Rapoport
2018-09-14 12:10 ` [OpenRISC] [PATCH 29/30] mm: remove include/linux/bootmem.h Mike Rapoport
2018-09-26 9:38 ` Michal Hocko
2018-09-14 12:10 ` [OpenRISC] [PATCH 30/30] docs/boot-time-mm: remove bootmem documentation Mike Rapoport
2018-09-26 9:41 ` [OpenRISC] [PATCH 00/30] mm: remove bootmem allocator Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1536927045-23536-17-git-send-email-rppt@linux.vnet.ibm.com \
--to=rppt@linux.vnet.ibm.com \
--cc=openrisc@lists.librecores.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).