Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp956879imm; Thu, 6 Sep 2018 12:52:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYABKKuo6eAFrPtjliHK80OMxT9zaXvVi3P1WSBXvb3wi5aSVyEzPQBByunLiYw2E1Cx7n4 X-Received: by 2002:a17:902:904c:: with SMTP id w12-v6mr4388527plz.95.1536263576988; Thu, 06 Sep 2018 12:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536263576; cv=none; d=google.com; s=arc-20160816; b=NnL8kqXILIHzbBKUMGOnDirJ93zwMIpPjOSguBCH9NNlTqxlkjNbKbjxXX4cSGQIEH 7bE3z5fZxr33g2/n5sJTf1f3oVOTNBv0lkBxAqMqML5LX/1h0jixacx0evFHjsFouctC 4LCjI7CByd0KgtNQMhD3gS19nVy09+WJnU/ovtVGDZJSq2WqOaJBzp9M+QCvd+69tHxR 6IPo9mrHwSPHa/7VBJGIPHgEGgIJ7kXJiKR5RpRqo6Lxf38mei8qkgV8t7cXB14N3mDc hu9TrQKRWkmvqf62ya8HNBw3p3coZFOS7eQ9DUXaxwTimqY1TlWVXkjt7gQ0iyGIWjU1 14rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=1lJDd72Z7x+RbvZTpkspugUjrUHSUzMl9jEHUgEeNWk=; b=PkaqXRd/Z+X/hGvLKIPTuFf0sfhqaSX1+nZ4ya1r7XLZKiO/FUXS9RCd6ylz4VzlCh LLNAlhMGs85LTbCCaSOMrC0ybbJSnD0viZVfUoKznkz+x/7wpJ71gRtYVIg1OV6bICVF ee8AOJTDhFSXzjaAP3F5S3XLaXCGQYBKKiDJwWukkSiv3yUMy3V5vmxt7BSaM4V2AUbn 6HxVQNGDoox00zyXVslq+tVjEG+Kq9sinmO2+ZUos3DVYc1WFW3PghxElEEmTRkzLLm8 cyx888iduk9OWPtsNVKZekL2SJygNbJbL+7yYr/GR5ug/KABGb44HWY/jUORnGALj7iU 8WRA== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9-v6si6449727pgt.398.2018.09.06.12.52.38; Thu, 06 Sep 2018 12:52:56 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728205AbeIFRZR (ORCPT + 99 others); Thu, 6 Sep 2018 13:25:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41492 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727514AbeIFRZR (ORCPT ); Thu, 6 Sep 2018 13:25:17 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w86CmwYQ048992 for ; Thu, 6 Sep 2018 08:49:55 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mb2c6p3dr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Sep 2018 08:49:54 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Sep 2018 13:49:53 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Sep 2018 13:49:48 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w86Cnl4R43909146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Sep 2018 12:49:47 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E89E742045; Thu, 6 Sep 2018 15:49:41 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CED5942041; Thu, 6 Sep 2018 15:49:40 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.92]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 6 Sep 2018 15:49:40 +0100 (BST) Date: Thu, 6 Sep 2018 15:49:44 +0300 From: Mike Rapoport To: Michal Hocko 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() References: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> <1536163184-26356-15-git-send-email-rppt@linux.vnet.ibm.com> <20180906080614.GW14951@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180906080614.GW14951@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18090612-4275-0000-0000-000002B63917 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18090612-4276-0000-0000-000037BF583B Message-Id: <20180906124944.GF27492@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-06_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809060131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2018 at 10:06:14AM +0200, Michal Hocko wrote: > 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). It is also used in later patches to replace alloc_bootmem* in several places and most of them explicitly set the alignment. > > 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 > -- Sincerely yours, Mike.