[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180906074919.GS14951@dhcp22.suse.cz>
Date: Thu, 6 Sep 2018 09:49:19 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Mike Rapoport <rppt@...ux.vnet.ibm.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
"David S. Miller" <davem@...emloft.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...hat.com>,
Michael Ellerman <mpe@...erman.id.au>,
Paul Burton <paul.burton@...s.com>,
Thomas Gleixner <tglx@...utronix.de>,
Tony Luck <tony.luck@...el.com>, linux-ia64@...r.kernel.org,
linux-mips@...ux-mips.org, linuxppc-dev@...ts.ozlabs.org,
sparclinux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 10/29] memblock: replace __alloc_bootmem_node_nopanic
with memblock_alloc_try_nid_nopanic
On Wed 05-09-18 18:59:25, Mike Rapoport wrote:
> The __alloc_bootmem_node_nopanic() is used only once, there is no reason to
> add a wrapper for memblock_alloc_try_nid_nopanic for it.
OK, it took me a bit longer to see they are equivalent. Both zero the
memory and fallback to a different node if the given one doesn't have a
proper range. So good. Lack of proper documentation didn't really help.
> Signed-off-by: Mike Rapoport <rppt@...ux.vnet.ibm.com>
Acked-by: Michal Hocko <mhocko@...e.com>
> ---
> arch/x86/kernel/setup_percpu.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
> index ea554f8..67d48e26 100644
> --- a/arch/x86/kernel/setup_percpu.c
> +++ b/arch/x86/kernel/setup_percpu.c
> @@ -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));
> }
> --
> 2.7.4
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists