Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp223172imm; Thu, 6 Sep 2018 01:08:05 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb53m5nX+LjSrpG7IJ/qwdoatIb3XeN89KJG+2wWYH6y+Ds4vQ5rBbBq90uR29SE/ThX59Z X-Received: by 2002:a63:24c:: with SMTP id 73-v6mr1622537pgc.252.1536221285524; Thu, 06 Sep 2018 01:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536221285; cv=none; d=google.com; s=arc-20160816; b=vJOQLrWnuQAsgOEd1Y4sQ2FKxygM0y3eE2+1wNgEoiRPuv2YE3ZvXd80sIxIVwj9SU vZzSNYI4Fl8Sj0rmtckpGzlWd6bhUJduPtUue7KDXyo0yxaBFvcU5pWoKqCFXyeb7Kch ye1ZLxoEDOHbmQXAmrqJ4EnEj/8iqRA31nP0NESigZoemo0MTn60o0NUG3nwt34WWJd9 SD/2VJGNSde0rYgO84DiRTqFgQlxOPJSPiij+mlzGI+sInmnyNYDq7sa0hHzXwv1YOeG Sax/xrOtaFdSqszQbd2P/QfImUkPOta6Q6jrvixUrIHWcVrHjweem3DDgv747qTr3rml K4Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/Zqm3HX71rCLdBUoyUqrHcBRvnSL4kONNlw4MlDwuGo=; b=H9F4TPYiY5E484BJIrW1OH7YpWV3Ps/3W3jorJdO1ADt40NMJnQTN3LouwnTtWk32q B5BPTKd55W44dC+b456m8+of0676Tamowmp4ZRZJy6f/iao6Z0G+11kGDGSLY4DTYpRY ExZ48zHWKeHnsEf7z6wDAleFaEyg696GlKz62HvKDoFRJUXfdwsXzZX7v39v5+1mn04k EHbbLwHNBOxLafwuNOb56R+oGRfr3bf6trseTFuQfcXDZTz0yeLBPjoCYUsRI5Oma/CO XEB3uqBOs8LxoC7iAIctTqZSSPY62D45zysccWlOC/7vaaOUQFFv3diJaebw2PCBQCI1 0OsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17-v6si4674501pfi.183.2018.09.06.01.07.50; Thu, 06 Sep 2018 01:08:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728227AbeIFMkb (ORCPT + 99 others); Thu, 6 Sep 2018 08:40:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:34408 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727864AbeIFMk3 (ORCPT ); Thu, 6 Sep 2018 08:40:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 22F14ADF4; Thu, 6 Sep 2018 08:06:15 +0000 (UTC) Date: Thu, 6 Sep 2018 10:06:14 +0200 From: Michal Hocko 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 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> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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