From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 1A3D76B77B7 for ; Thu, 6 Sep 2018 04:06:17 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id m9-v6so3329620eds.17 for ; Thu, 06 Sep 2018 01:06:17 -0700 (PDT) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id h20-v6si3968970ede.252.2018.09.06.01.06.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Sep 2018 01:06:16 -0700 (PDT) Date: Thu, 6 Sep 2018 10:06:14 +0200 From: Michal Hocko Subject: Re: [RFC PATCH 14/29] memblock: add align parameter to memblock_alloc_node() Message-ID: <20180906080614.GW14951@dhcp22.suse.cz> References: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> <1536163184-26356-15-git-send-email-rppt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536163184-26356-15-git-send-email-rppt@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Ingo Molnar , Michael Ellerman , Paul Burton , Thomas Gleixner , Tony Luck , linux-ia64@vger.kernel.org, linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org On Wed 05-09-18 18:59:29, Mike Rapoport wrote: > With the align parameter memblock_alloc_node() can be used as drop in > replacement for alloc_bootmem_pages_node(). Why do we need an additional translation later? Sparse code which is the only one to use it already uses memblock_alloc_try_nid elsewhere (sparse_mem_map_populate). > Signed-off-by: Mike Rapoport > --- > include/linux/bootmem.h | 4 ++-- > mm/sparse.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h > index 7d91f0f..3896af2 100644 > --- a/include/linux/bootmem.h > +++ b/include/linux/bootmem.h > @@ -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); > } > > diff --git a/mm/sparse.c b/mm/sparse.c > index 04e97af..509828f 100644 > --- a/mm/sparse.c > +++ b/mm/sparse.c > @@ -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; > } > -- > 2.7.4 > -- Michal Hocko SUSE Labs