From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C082C433E0 for ; Sun, 24 Jan 2021 17:11:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB10F22D57 for ; Sun, 24 Jan 2021 17:11:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB10F22D57 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C71616B0005; Sun, 24 Jan 2021 12:11:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C21D16B0006; Sun, 24 Jan 2021 12:11:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B10986B0007; Sun, 24 Jan 2021 12:11:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id 9B6D66B0005 for ; Sun, 24 Jan 2021 12:11:49 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 533CB3637 for ; Sun, 24 Jan 2021 17:11:49 +0000 (UTC) X-FDA: 77741310738.17.burst29_00035b02757e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 3BF74180D0184 for ; Sun, 24 Jan 2021 17:11:49 +0000 (UTC) X-HE-Tag: burst29_00035b02757e X-Filterd-Recvd-Size: 4284 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Sun, 24 Jan 2021 17:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BYKC2L2hVAaS8QnagdYHDRlvFUx7Q8YKgh3eD9EhNqY=; b=FA0bJc+ZmMAfzvqt55Ee0Oi/9R gQB4SotqReMKno8iQrOD0ETP80A0JQt4NbjRd53QGhT8JSML3NT2wEBNCcLkHvDeg8+UYMqEUPhq9 Bo6+klsAhn8Q7bUBO4VrGkU6WBsIYtXT4L4y7ejAwm9U07q8Gmm7ToIQzz73OIr3ep9Ku8NlFwHqd LgD1PSXFP906UIuVjvbNonI/pB4zKcfDQtIiw8Gy3p4ZBk38h+3HBPGWcWSWz2+pMLCglClIdMq+p y/kPGaQvuU1H2xbAqOINyCA0xYrf7us6aLP5z6XNGiCYoOLDHtdBbwyuSRmUOWqWiojB9x+vc/vI3 rrLSmPiw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l3iup-003CGl-4T for linux-mm@kvack.org; Sun, 24 Jan 2021 17:11:27 +0000 Date: Sun, 24 Jan 2021 17:11:07 +0000 From: Matthew Wilcox To: linux-mm@kvack.org Subject: [PATCH 3/2] mm: Rename alloc_pages_current to alloc_pages Message-ID: <20210124171107.GC308988@casper.infradead.org> References: <20210124120357.701077-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210124120357.701077-1-willy@infradead.org> 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: When CONFIG_NUMA is enabled, alloc_pages() is a wrapper around alloc_pages_current(). This is pointless, just implement alloc_pages() directly. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/gfp.h | 8 +------- mm/mempolicy.c | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index acca2c487da8..44978b35ce1a 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -532,13 +532,7 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, } #ifdef CONFIG_NUMA -extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); - -static inline struct page * -alloc_pages(gfp_t gfp_mask, unsigned int order) -{ - return alloc_pages_current(gfp_mask, order); -} +struct page *alloc_pages(gfp_t gfp, unsigned int order); extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, struct vm_area_struct *vma, unsigned long addr, int node, bool hugepage); diff --git a/mm/mempolicy.c b/mm/mempolicy.c index addf0854d693..0cf54aa5a2f0 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2245,21 +2245,20 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, EXPORT_SYMBOL(alloc_pages_vma); /** - * alloc_pages_current - Allocate pages. + * alloc_pages - Allocate pages. + * @gfp: + * %GFP_USER user allocation, + * %GFP_KERNEL kernel allocation, + * %GFP_HIGHMEM highmem allocation, + * %GFP_FS don't call back into a file system. + * %GFP_ATOMIC don't sleep. + * @order: Power of two of allocation size in pages. 0 is a single page. * - * @gfp: - * %GFP_USER user allocation, - * %GFP_KERNEL kernel allocation, - * %GFP_HIGHMEM highmem allocation, - * %GFP_FS don't call back into a file system. - * %GFP_ATOMIC don't sleep. - * @order: Power of two of allocation size in pages. 0 is a single page. - * - * Allocate a page from the kernel page pool. When not in - * interrupt context and apply the current process NUMA policy. - * Returns NULL when no page can be allocated. + * Allocate a page from the kernel page pool. When in + * process context apply the current process NUMA policy. + * Returns NULL when no page can be allocated. */ -struct page *alloc_pages_current(gfp_t gfp, unsigned order) +struct page *alloc_pages(gfp_t gfp, unsigned order) { struct mempolicy *pol = &default_policy; struct page *page; @@ -2280,7 +2279,7 @@ struct page *alloc_pages_current(gfp_t gfp, unsigned order) return page; } -EXPORT_SYMBOL(alloc_pages_current); +EXPORT_SYMBOL(alloc_pages); int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst) { -- 2.29.2