From patchwork Wed Sep 5 15:59: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: 10589135 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 0DB7113AC for ; Wed, 5 Sep 2018 16:00:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D12742A550 for ; Wed, 5 Sep 2018 16:00:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC6F22A674; Wed, 5 Sep 2018 16:00:48 +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 51EDF2A6E1 for ; Wed, 5 Sep 2018 16:00:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B27176B7409; Wed, 5 Sep 2018 12:00:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A5B846B740D; Wed, 5 Sep 2018 12:00:37 -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 8B8AA6B740C; Wed, 5 Sep 2018 12:00:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by kanga.kvack.org (Postfix) with ESMTP id 2ED176B740D for ; Wed, 5 Sep 2018 12:00:37 -0400 (EDT) Received: by mail-oi0-f69.google.com with SMTP id w12-v6so9003877oie.12 for ; Wed, 05 Sep 2018 09:00:37 -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=yCHCepTQlnW+YpUBuXGFXLlg8KTKq+Bn5cCVk3uyQZw=; b=mjOo6rAgRTkLbxtuW2NcrMR6TPpeTJzWNpbFMgJNE9PvbmjUEFFpzWJqoX41V52SAB GoGpvoM0PGo+wdU1u3ByqiVgaYYW94Y/jICS3jTtP8ksuElWkUePwavLjMQJ/OZIpmPh t2vr52BSC4AKFzv7ICWBYXn/NWmtxpjKL+lCrMnvQBdAQcOdLjIu78SvMvo6y4fS6qCa /1V/uBPbhaF6c+lPwHofkJmiD5c061ISHDbefqs9g3XXTzMIVtikdh1qSnSqNk3Xdu6q N1VQ/fS7XQyGZMoG4Et261t11YCiUIyGIwtP4cKGymNgwCU4/3HcoR310mkOkG+lTvkc ve/g== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 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: APzg51C0zhrqQUNX552iijKLMciX4ClRabW3GdAJeT8Jdz78TEPwb8xN sxfP9/xVQSvN89K3MaKVOTJ2fi7IuSRlHUzUMkLG2pJdODj7TO7W2sc1gKaqKdVxuiFRgjaXE0l bw4QiBS+V/BFks+JnBj0Tp5D1/avc1v175H+72Ogu2dSHvpTL1zo09hQPmmkrvzE= X-Received: by 2002:aca:4204:: with SMTP id p4-v6mr2815255oia.242.1536163236927; Wed, 05 Sep 2018 09:00:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ0p1BYT9qAbwxhoZrN35lJM5JrAHai9FJ73T5Kv1jx/6CsCS6PKaxXxvXxfRMK9OBWkUXQ X-Received: by 2002:aca:4204:: with SMTP id p4-v6mr2815202oia.242.1536163236257; Wed, 05 Sep 2018 09:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536163236; cv=none; d=google.com; s=arc-20160816; b=KluBECGjSElppavHi9svHZQbuA29D2qFJpqAotGRbothuV8Q3v/zc7aDdJtuDIexJ5 fJT0sqV/PVWV2AQvnMyFh+9V7KN/SoSn/hXtfdz6k/wr58c7IDB00X7f1N5xrtyzoeHS +yok402aFxVAWA7vzxTb0xGlT82srhrY5M1bZbLweWYHKXk2KUHN+t3JIDTrLJgBPiBx sQyH5nx+CrVty4QdUWZXT6nTBtjp1n+OQO7DSdts91fPmKPVqW4T6eW+SxIhGd2r+qid 5fAHINcsciCAu7xuXTymtccLpV62ZEWxvQuVdnZLm7TM7hiF+/ckVuvEZGhyngF2ZSmu Ab/w== 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=yCHCepTQlnW+YpUBuXGFXLlg8KTKq+Bn5cCVk3uyQZw=; b=BLYc5UbXXkgliUJU+3Gl7hWsjv4WDF3Ea/Ubhch2T06N6j7F2Mj7ba/uKWXOxDDRv/ y94t4+haqMwjm6N7soFTXbtDAQOYbOQPKzi4bEP80Rx//4oqaDoAHwWAtyHTTBMjNDkh sdnolbRnpeyCkKk2olfCVR73x3n1CcwSAVVn9hLS3+21d9+iqLyWxj0VLZnPZB45TRlp MFQoLh89bvjnJB5gwz5aAqMtjwXyuvBhVnJdF5e+srUqoKGAX+PWPNvLklR1BcAlo4Z0 1TuPLLS4Ni0rUrtUlKI0+nWFJOkC2FrBh/noONq9ol6Cr8TjDLofAPBJnRLXf+vbUzUF mYEw== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 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 (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id u203-v6si1551592oif.354.2018.09.05.09.00.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 09:00:36 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 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 (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w85FuYYE022358 for ; Wed, 5 Sep 2018 12:00:35 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2magp9day6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 05 Sep 2018 12:00:34 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Sep 2018 17:00:31 +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) Wed, 5 Sep 2018 17:00:27 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w85G0QUx34734304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Sep 2018 16:00:26 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D94342045; Wed, 5 Sep 2018 19:00:21 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2468042057; Wed, 5 Sep 2018 19:00:19 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.92]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 5 Sep 2018 19:00:19 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Wed, 05 Sep 2018 19:00:23 +0300 From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Ingo Molnar , Michael Ellerman , Michal Hocko , 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, Mike Rapoport Subject: [RFC PATCH 14/29] memblock: add align parameter to memblock_alloc_node() Date: Wed, 5 Sep 2018 18:59:29 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18090516-0008-0000-0000-0000026CBA33 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18090516-0009-0000-0000-000021D4D856 Message-Id: <1536163184-26356-15-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-05_09:,, 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-1809050164 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(). 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; }