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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 C0A6CC433E0 for ; Wed, 27 Jan 2021 09:40:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 36A6B20758 for ; Wed, 27 Jan 2021 09:40:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36A6B20758 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 83F016B0006; Wed, 27 Jan 2021 04:40:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EF436B0008; Wed, 27 Jan 2021 04:40:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 705AC6B000A; Wed, 27 Jan 2021 04:40:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id 59A216B0006 for ; Wed, 27 Jan 2021 04:40:00 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2353B8249980 for ; Wed, 27 Jan 2021 09:40:00 +0000 (UTC) X-FDA: 77751058560.10.frog70_3b1831927596 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id F1CC516A0D2 for ; Wed, 27 Jan 2021 09:39:59 +0000 (UTC) X-HE-Tag: frog70_3b1831927596 X-Filterd-Recvd-Size: 4606 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 09:39:59 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1611740398; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Q0YAi1S/aFOFgK/kCeVHpTqq7cxGEYisnrUHB1LMNOI=; b=G7nmbnPwiCnbSvkXJ7TvSo8mKYsnHhn7LJFIx3PKmETFs1fcFrTKgq99VPMd1OyMGx/YW5 4UEzpf4i4k2Qft/4m+ia+sfqT+Ig0p1cFqEroXt4IbXVmvocHGyWTz+sVZVkxt+/Z1bx2i u0nBd6LRxeraCUybt8FtkozFZZuO4BQ= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5DF97AD57; Wed, 27 Jan 2021 09:39:58 +0000 (UTC) Date: Wed, 27 Jan 2021 10:39:57 +0100 From: Michal Hocko To: Matthew Wilcox Cc: linux-mm@kvack.org Subject: Re: [PATCH 3/2] mm: Rename alloc_pages_current to alloc_pages Message-ID: <20210127093957.GD827@dhcp22.suse.cz> References: <20210124120357.701077-1-willy@infradead.org> <20210124171107.GC308988@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210124171107.GC308988@casper.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: On Sun 24-01-21 17:11:07, Matthew Wilcox wrote: > When CONFIG_NUMA is enabled, alloc_pages() is a wrapper around > alloc_pages_current(). This is pointless, just implement alloc_pages() > directly. alloc_pages_current was a bit of a misnomer anyway as it implements memory policy as well (e.g. interleave). > Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Michal Hocko Thanks! > --- > 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 > -- Michal Hocko SUSE Labs