From patchwork Fri Sep 14 12:10:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10600671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 206E5112B for ; Fri, 14 Sep 2018 12:12:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC3AC2B2A8 for ; Fri, 14 Sep 2018 12:12:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC2F52B2AB; Fri, 14 Sep 2018 12:12:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FBDA2B2A8 for ; Fri, 14 Sep 2018 12:12:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FA2C8E0010; Fri, 14 Sep 2018 08:12:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 980B88E0001; Fri, 14 Sep 2018 08:12:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FC2F8E0010; Fri, 14 Sep 2018 08:12:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by kanga.kvack.org (Postfix) with ESMTP id 4D3F18E0001 for ; Fri, 14 Sep 2018 08:12:36 -0400 (EDT) Received: by mail-oi0-f71.google.com with SMTP id m21-v6so9200487oic.7 for ; Fri, 14 Sep 2018 05:12:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=hw35RGIHivmnT2XehZ+fbyPB+0v+SYcCCcsNYQ5ayb8=; b=iRAuStaxIKNIr/s3g7qy64nEz3T37Itn8VE9Kb05E9wrvyTIwe2rBjbCLwN02g6LOT /wg7HfkJNXrJTSHuyx2GEDxtV+R8RAkChBh1L1PzXuNzun/k2UlP57OIvi88PAm6YRPH E2D+2ZNfLY30Joej9fpyOVdmb/ejXFxhhJB9IKGqCho1VZq91WajFb8uEDX92tmHbmnb YP24w3HVo0OiCHecs6Rt7khtLiH3uX8rVmkOsfi1iuQU8Fs70jv+vVxmV7QuZkyj2QXd 3rD++UTF74LqY0x+uevjfclbDzTpeZa3VSX0Eh3UHFWBdSkVx+Sh+N+R9w51BG3n0mPe e1+Q== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: APzg51D5dxR5dTQ69hnQ0oOsOFUuu1F98TuSh/HoGQnTAK6jdICtFGE4 Za8394ahaH4NtesnYDXkGP+9i6BLH+qFUZYXPpM42I68vCHGfWVLE3zVwV8p3xlIcz+qD5zIkEj Um5GDXy3cJW4XkaMzB8d1pZo8NzV5fEh3svFHSsP949qcFXBT05sHOxdovDqTfwQ= X-Received: by 2002:a9d:6082:: with SMTP id m2-v6mr4005256otj.177.1536927156020; Fri, 14 Sep 2018 05:12:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaLEmGm4onvVvSXkxSPbNvHZ5xW04otO5tQ+ZCYD6wm+karnlFY8qY9T/K5pTXHfVdvk+Ss X-Received: by 2002:a9d:6082:: with SMTP id m2-v6mr4005208otj.177.1536927155207; Fri, 14 Sep 2018 05:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536927155; cv=none; d=google.com; s=arc-20160816; b=f6uM9Ex1WD4Dnp/3E1wUhq4Qp/VPRgJkgtMVawWUyzwwLwehFDuypk1PaEFsotMgFK 1FFdZdkYHg2OECIbGvu6/SgUBmdg2R6JP8eTasyGb0dXFEQEKcCiwE16ZM++0p+oC3Kz Krs8KeRq3/xknFTqEwGLN3UBLYhjGMtiISo+mqFdeE6YJqsR3XtnxNiUVmwsVLoVSWP2 95jKoszD6dXVAA3ZllYE0y+fUOtWAv1+FBS+LWdvtW0aMSaliKXo0sMBI9rCBW4rJSTo u7Fp2dbNHi4dw0eArEaJOivIeJWKmlsGTCTkisiuOlfzcXP/OggipUMD9X2TyIU6Ujyk cRJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from; bh=hw35RGIHivmnT2XehZ+fbyPB+0v+SYcCCcsNYQ5ayb8=; b=uKrjd6jKD5xqA9Jw4LWNfMI5E5FCP3ABCHjG8ZBdp4DfOvYtXCHgee9e0aQXSwXMbu dlPyawoGe/Lki+v4yKvqMLWDJiX/Ng7SIO/NGz5wfLSfz3SH27Gh8FrxlFBqJeW++u0I cAO7JEUgC07X7cPOtRVwXfsgCuM8n4/Tznu9Z2wUKLxM6OAFIiMeZv0TFmzgnyaMY2vB xyJ8rCDePjILi8SrFuI5FVQbG4/A++2BUu8Ru78Artc5BeUClBxpf3Szp4VXHvz0AiUz QNgCbvKivWATNGSM306NQlIS5jqhAY2vRrXQKDP4V2HMgR/niaRtKDH7FTbj7YuPhHOd bywg== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id v129-v6si3658511oib.424.2018.09.14.05.12.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 05:12:35 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com 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 w8EC58Di012984 for ; Fri, 14 Sep 2018 08:12:34 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mgce2h35b-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Sep 2018 08:12:34 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Sep 2018 13:12:30 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 14 Sep 2018 13:12:18 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8ECCHZQ24969242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Sep 2018 12:12:17 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6701852059; Fri, 14 Sep 2018 15:12:05 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.207.116]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 47C6352054; Fri, 14 Sep 2018 15:12:00 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 14 Sep 2018 15:12:11 +0300 From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , Catalin Marinas , Chris Zankel , "David S. Miller" , Geert Uytterhoeven , Greentime Hu , Greg Kroah-Hartman , Guan Xuetao , Ingo Molnar , "James E.J. Bottomley" , Jonas Bonn , Jonathan Corbet , Ley Foon Tan , Mark Salter , Martin Schwidefsky , Matt Turner , Michael Ellerman , Michal Hocko , Michal Simek , Palmer Dabbelt , Paul Burton , Richard Kuo , Richard Weinberger , Rich Felker , Russell King , Serge Semin , Thomas Gleixner , Tony Luck , Vineet Gupta , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, Mike Rapoport Subject: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node() Date: Fri, 14 Sep 2018 15:10:29 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536927045-23536-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1536927045-23536-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18091412-0008-0000-0000-000002715A6E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091412-0009-0000-0000-000021D9A04E Message-Id: <1536927045-23536-15-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-14_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1809140129 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP With the align parameter memblock_alloc_node() can be used as drop in replacement for alloc_bootmem_pages_node() and __alloc_bootmem_node(), which is done in the following patches. 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; }