From patchwork Mon Nov 25 21:01:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13885317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE0FED59D7E for ; Mon, 25 Nov 2024 21:58:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 27EC06B0088; Mon, 25 Nov 2024 16:58:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 22E2D6B0089; Mon, 25 Nov 2024 16:58:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F5B26B008C; Mon, 25 Nov 2024 16:58:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E62586B0088 for ; Mon, 25 Nov 2024 16:58:20 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 98A921C7496 for ; Mon, 25 Nov 2024 21:58:20 +0000 (UTC) X-FDA: 82825981392.03.75464C5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id 0C80940002 for ; Mon, 25 Nov 2024 21:58:14 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=R+4vFjM5; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732571896; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=B4MAOaCT1D+JgAGk/2nVFJpLtQ4vHb4K85arQnMGBtE=; b=tZVaaq+uWpHc/uxTDpXZ2A537IDREWjg4wr3uZOguMdG8FifsGWOPrygHzz3kzyTYWDWwg m1c2q5LZdgjypzCrhBNtM8d+XAjNj8lCe4WdGMJz3I2sIhNwHHRhSPOBHNY33Xcui2AfWE zDr4hRXhSNkOPvmfqMOkMtJvYA2+W14= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732571896; a=rsa-sha256; cv=none; b=dAbTX25VlWwLfjvVMKCkKKHFvYyy/tcGnmte1dqQNYAqeA4oPXKYeFlHC90mKQozs0meS7 Q2CCoAXFkOx2cJVhqI64BXbLnvMAgbtphYigR5FTLR1pPV+p2gbsvWrMBpLawuR69BPNUB ++NZnPijfvnJfaE8l59qE8Q3TyBnO78= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=R+4vFjM5; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=B4MAOaCT1D+JgAGk/2nVFJpLtQ4vHb4K85arQnMGBtE=; b=R+4vFjM5hId6Q+t8KqWteJ0Uy9 KefQAdkXDDr5SKD1NHa4OWq7Ouhs06TNr94wLSp5lcUf3LfmFARz/8hfRUPXQrT2c/48QKqntcdCv oMCFtLwAX60/AGft0Il1Nu7NxjoGburQlhGyd3lEczMAtfkHnmGZ7PIO/FGPLZVUmsI8cQSWcOrLz RZvbn9NME2widGTT4mCz59RRP8WLLYjcIAPHn5+IRVOj1S2avDj36tbXxxaGsTQKZkCGRKeJ8rIIx hSTWminfk/8ts8VztDh/O/9y/qntQRtCPeYjD3kjBxW+ZgpWAWo7HUlNCcy1Srb1hdEmSjmzlHnvA wLMImjXg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tFgDO-0000000CUDu-3n2d; Mon, 25 Nov 2024 21:01:50 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, David Hildenbrand Subject: [PATCH v3 02/15] mm: Make alloc_pages_mpol() static Date: Mon, 25 Nov 2024 21:01:34 +0000 Message-ID: <20241125210149.2976098-3-willy@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241125210149.2976098-1-willy@infradead.org> References: <20241125210149.2976098-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: 8ogn56xpuec534h4cnzqwdx3dn3z4xx1 X-Rspam-User: X-Rspamd-Queue-Id: 0C80940002 X-Rspamd-Server: rspam02 X-HE-Tag: 1732571894-572868 X-HE-Meta: U2FsdGVkX1+aYV5HkxEhjHgggnv2rdErHJyaW2ugcwSo/Afa9Djf14FcCnOY2K4GZNdcCF999LZ9CUKTqjjuZnqm/3I6aBA8gUycfzJKKGxgE0QdYKFkEbAlcA5Q7d+7MB7pt9OBOKFXXOC7XynF9JPeckADHJpbiQdFm7vOIauccSVGb87rd3ZYBvit6dCnQZVUagVE8Cey0yPn8FpqGbVWfdA185J1djmZv0c0g0li5fGfPml/bnfQ+7WTNXjZ0CzSez0x3NlkZCkUjNnQxkQaTn4esa6PpgiL9jsZF43CElhlNqk8BmjoXMEvXPNWLgI3x8xQieE8wVs+zE0vPfDfNHCL6R9GoyCGjLL090vJCrqJGt9sx0Z4wwkica9d1CsxwnYaV1Js4A710qfB2cI8Jti/1ay2Sv/5yZqWOJAOEf9eUd1+4T4ioRW1XCOAFvaMtRZlYxbtY53pRIh7SBlXl2jDKAmmjHkQ2vOOJtTMy2zDS7xNg/SPebbfTVg/7UarzOA6oiFJepCdRo19rUUmg1IATTCU+tM32JlKos8NAEWYAGRrqyF0mTsc3axxN2Wb3kyHrlUf7D2gcY4Mv/WosKE/+uJRyE3Ex80Tfeo1EgeoOKVWTsSDNkMVWVXXBZc1uo/W4I6umQIsAMCP3Pc1JPXwvHiOYPLJQ7HHpqLlpE8KG1aQpfIR+6eczdGuT93EG/BFyMbpBIhz285aFQ1KLYCTohw/OzBhLizYZyDsTd7d2X4HDV9xkOwZiainnQuiwlyDwJ3GktNcAJ5dtWrNpBtr8KooJv0jiOgkG4RjQ+tk2CSvhjK8YEtWzL9j3Rs+4O0JgZ8SdhlIwUrHlygvZG5s21cjp3rSXQC+PZlJDTzv3c3f/72ezuGTRuTGe4FvCsiFCr5zTOJCPjyENb84+ytDKFxva70EJRS54pNawzjM+F3MNcz/x4oB7zP03bUqKGuRa0mXtTaCFDR 37stp2s2 gUumVSHKvhY6/WhNnTX8D34k4Sb9mMw0xY1vRmTG+jf4cAO9xwMxzUfEpKw0VKyFeLpxobKMZzkLL9S1wn6jO7vCWgzo7NasRMgZeJ9JUw/paGu8utMYQOVUlxuTWV23ZJ8Hg9WK1Ql6+2gToeNxRppygOg1N+R3FsfTjQYUcCXJK4JPJJbUEKuXIP1Vh/Hg6ZamvH/LCSfUdQguwcX/6Ue1pG9G6nsrMmUHykurWhFpEj6WKW/vvbuPcrh7meFzJ6tSys4GZSJg3aFGfilk0fM9EqLPqdujPw5SXEBzefZgVM8Pjk0noMG79n57+IX/76ZB0jNu8C8Rz6IU2PiFsUKydInGuTviAjM4ai/i1hRAGU3yA7ZqSb8VYpgKa1v0CeFOU 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: List-Subscribe: List-Unsubscribe: All callers outside mempolicy.c now use folio_alloc_mpol() thanks to Kefeng's cleanups, so we can remove this as a visible symbol. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/gfp.h | 8 -------- mm/mempolicy.c | 8 ++++---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index b0fe9f62d15b..c96d5d7f7b89 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -300,8 +300,6 @@ static inline struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask, #ifdef CONFIG_NUMA struct page *alloc_pages_noprof(gfp_t gfp, unsigned int order); -struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order, - struct mempolicy *mpol, pgoff_t ilx, int nid); struct folio *folio_alloc_noprof(gfp_t gfp, unsigned int order); struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int order, struct mempolicy *mpol, pgoff_t ilx, int nid); @@ -312,11 +310,6 @@ static inline struct page *alloc_pages_noprof(gfp_t gfp_mask, unsigned int order { return alloc_pages_node_noprof(numa_node_id(), gfp_mask, order); } -static inline struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order, - struct mempolicy *mpol, pgoff_t ilx, int nid) -{ - return alloc_pages_noprof(gfp, order); -} static inline struct folio *folio_alloc_noprof(gfp_t gfp, unsigned int order) { return __folio_alloc_node_noprof(gfp, order, numa_node_id()); @@ -331,7 +324,6 @@ static inline struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int orde #endif #define alloc_pages(...) alloc_hooks(alloc_pages_noprof(__VA_ARGS__)) -#define alloc_pages_mpol(...) alloc_hooks(alloc_pages_mpol_noprof(__VA_ARGS__)) #define folio_alloc(...) alloc_hooks(folio_alloc_noprof(__VA_ARGS__)) #define folio_alloc_mpol(...) alloc_hooks(folio_alloc_mpol_noprof(__VA_ARGS__)) #define vma_alloc_folio(...) alloc_hooks(vma_alloc_folio_noprof(__VA_ARGS__)) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index bb37cd1a51d8..cda5f56085e6 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2218,7 +2218,7 @@ static struct page *alloc_pages_preferred_many(gfp_t gfp, unsigned int order, * * Return: The page on success or NULL if allocation fails. */ -struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order, +static struct page *alloc_pages_mpol(gfp_t gfp, unsigned int order, struct mempolicy *pol, pgoff_t ilx, int nid) { nodemask_t *nodemask; @@ -2280,7 +2280,7 @@ struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order, struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int order, struct mempolicy *pol, pgoff_t ilx, int nid) { - return page_rmappable_folio(alloc_pages_mpol_noprof(gfp | __GFP_COMP, + return page_rmappable_folio(alloc_pages_mpol(gfp | __GFP_COMP, order, pol, ilx, nid)); } @@ -2295,7 +2295,7 @@ struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int order, * NUMA policy. The caller must hold the mmap_lock of the mm_struct of the * VMA to prevent it from going away. Should be used for all allocations * for folios that will be mapped into user space, excepting hugetlbfs, and - * excepting where direct use of alloc_pages_mpol() is more appropriate. + * excepting where direct use of folio_alloc_mpol() is more appropriate. * * Return: The folio on success or NULL if allocation fails. */ @@ -2341,7 +2341,7 @@ struct page *alloc_pages_noprof(gfp_t gfp, unsigned int order) if (!in_interrupt() && !(gfp & __GFP_THISNODE)) pol = get_task_policy(current); - return alloc_pages_mpol_noprof(gfp, order, pol, NO_INTERLEAVE_INDEX, + return alloc_pages_mpol(gfp, order, pol, NO_INTERLEAVE_INDEX, numa_node_id()); } EXPORT_SYMBOL(alloc_pages_noprof);