From patchwork Mon Feb 15 21:01:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12089187 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=-16.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,USER_AGENT_GIT 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 DBA20C433E0 for ; Mon, 15 Feb 2021 21:02:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 44F9F64DEC for ; Mon, 15 Feb 2021 21:02:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44F9F64DEC 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 AD6A98D013E; Mon, 15 Feb 2021 16:02:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A86D18D012C; Mon, 15 Feb 2021 16:02:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99D528D013E; Mon, 15 Feb 2021 16:02:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0238.hostedemail.com [216.40.44.238]) by kanga.kvack.org (Postfix) with ESMTP id 858E08D012C for ; Mon, 15 Feb 2021 16:02:16 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 518BD182EE036 for ; Mon, 15 Feb 2021 21:02:16 +0000 (UTC) X-FDA: 77821725072.13.53F20DE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id 820C7C000C58 for ; Mon, 15 Feb 2021 21:02:12 +0000 (UTC) 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=T4rBFP+Ihf/oar60G9fwAFnAwWiCmbHJ4RJj2NB8O8A=; b=kWUZu59IxU/oXjNoKgw//mKqnE Q9dkNacuM6Qhm3kx2CW5lItCpwe3AJfAiLZLsWapp7uHFooR9HVTIDkUnuBEUskG67EL7sv61IGE1 REho8UW+dj6CNrwamZGaYkJXsaOQhGwrxWQj4qezquDuIohKG6M2iOE63tM9HFDnkGpeLjg9t/r1p jELxcBd+e2ZDxJyLCFSQFf0GZv0YGXSGc8HcXmDGG4IXt6XhJTut0druHg/eVbUx09BedS3LXi0PJ lsfX/Nqd93aVbWxCiC8F6444Tq60N/UXbiQewLlG9jnbg3XNoQGaJlNRK5YwttqErT3/4aM7PZly8 j0oNW2AQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBl0R-00G3it-QC; Mon, 15 Feb 2021 21:02:08 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport Subject: [PATCH v2 1/6] mm/page_alloc: Rename alloc_mask to alloc_gfp Date: Mon, 15 Feb 2021 21:01:58 +0000 Message-Id: <20210215210203.3827513-2-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215210203.3827513-1-willy@infradead.org> References: <20210215210203.3827513-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 820C7C000C58 X-Stat-Signature: qwmre3si3ngy5qcbapmjczww9d6bsyon Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf22; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613422932-23793 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: We have two masks involved -- the nodemask and the gfp mask, so alloc_mask is an unclear name. Signed-off-by: Matthew Wilcox (Oracle) --- mm/page_alloc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0b55c9c95364..8100f9d123a8 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4916,7 +4916,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, int preferred_nid, nodemask_t *nodemask, - struct alloc_context *ac, gfp_t *alloc_mask, + struct alloc_context *ac, gfp_t *alloc_gfp, unsigned int *alloc_flags) { ac->highest_zoneidx = gfp_zone(gfp_mask); @@ -4925,7 +4925,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, ac->migratetype = gfp_migratetype(gfp_mask); if (cpusets_enabled()) { - *alloc_mask |= __GFP_HARDWALL; + *alloc_gfp |= __GFP_HARDWALL; /* * When we are in the interrupt context, it is irrelevant * to the current task context. It means that any node ok. @@ -4969,7 +4969,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, { struct page *page; unsigned int alloc_flags = ALLOC_WMARK_LOW; - gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */ + gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */ struct alloc_context ac = { }; /* @@ -4982,8 +4982,9 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, } gfp_mask &= gfp_allowed_mask; - alloc_mask = gfp_mask; - if (!prepare_alloc_pages(gfp_mask, order, preferred_nid, nodemask, &ac, &alloc_mask, &alloc_flags)) + alloc_gfp = gfp_mask; + if (!prepare_alloc_pages(gfp_mask, order, preferred_nid, nodemask, &ac, + &alloc_gfp, &alloc_flags)) return NULL; /* @@ -4993,7 +4994,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, alloc_flags |= alloc_flags_nofragment(ac.preferred_zoneref->zone, gfp_mask); /* First allocation attempt */ - page = get_page_from_freelist(alloc_mask, order, alloc_flags, &ac); + page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac); if (likely(page)) goto out; @@ -5003,7 +5004,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, * from a particular context which has been marked by * memalloc_no{fs,io}_{save,restore}. */ - alloc_mask = current_gfp_context(gfp_mask); + alloc_gfp = current_gfp_context(gfp_mask); ac.spread_dirty_pages = false; /* @@ -5012,7 +5013,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, */ ac.nodemask = nodemask; - page = __alloc_pages_slowpath(alloc_mask, order, &ac); + page = __alloc_pages_slowpath(alloc_gfp, order, &ac); out: if (memcg_kmem_enabled() && (gfp_mask & __GFP_ACCOUNT) && page && @@ -5021,7 +5022,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, page = NULL; } - trace_mm_page_alloc(page, order, alloc_mask, ac.migratetype); + trace_mm_page_alloc(page, order, alloc_gfp, ac.migratetype); return page; } From patchwork Mon Feb 15 21:01:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12089195 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=-16.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,USER_AGENT_GIT 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 F3114C433E0 for ; Mon, 15 Feb 2021 21:02:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A79BD64DEC for ; Mon, 15 Feb 2021 21:02:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A79BD64DEC 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 99EF78D0142; Mon, 15 Feb 2021 16:02:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 94DA98D0140; Mon, 15 Feb 2021 16:02:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8412E8D0142; Mon, 15 Feb 2021 16:02:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 6EA898D0140 for ; Mon, 15 Feb 2021 16:02:21 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3F2CF2DFA for ; Mon, 15 Feb 2021 21:02:21 +0000 (UTC) X-FDA: 77821725282.26.drain64_0e098b32763e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 19186180EEAB7 for ; Mon, 15 Feb 2021 21:02:21 +0000 (UTC) X-HE-Tag: drain64_0e098b32763e X-Filterd-Recvd-Size: 4383 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Feb 2021 21:02:20 +0000 (UTC) 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=YXglIPTcdnUpspPjiNXAqzaWfXqjrvS8v9+PgPprkxQ=; b=VCyt/VJX+fdKYmMs+SqyDALypH 9DhMlyzaeeJoBnk+puDueGvUcQQwcS2Pl/4xDvY5TfhWieRIGGxOEQ5CJe0LDTvmuZHn7tvPcWhat ZFLc+hY9mWoSo3B5wrnOchLiFiIGah7FmDaHe/nxtWpJetC1R49VIZ1zqw0SL2j1GAVP6ysAbpTbq AN2xlKbIgeDPK4kj29NHs+8TgZfREK6nv9sDk1xM4afEaOS/XXWwv6CMeXZV2pdIZiLWdRWVfyfYV U9Eh9wFckxU+WRiSw1wQ6ynrPUVPqkXqtXgUPGzjyDmvFhy/kZrVmfi3hBnViLgR4ygGCsry0Q7D1 h06XZlEA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBl0U-00G3iz-SY; Mon, 15 Feb 2021 21:02:11 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport , Vlastimil Babka Subject: [PATCH v2 2/6] mm/page_alloc: Rename gfp_mask to gfp Date: Mon, 15 Feb 2021 21:01:59 +0000 Message-Id: <20210215210203.3827513-3-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215210203.3827513-1-willy@infradead.org> References: <20210215210203.3827513-1-willy@infradead.org> MIME-Version: 1.0 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: Shorten some overly-long lines by renaming this identifier. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka --- mm/page_alloc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8100f9d123a8..9e4841ede0f4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4964,7 +4964,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, * This is the 'heart' of the zoned buddy allocator. */ struct page * -__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, +__alloc_pages_nodemask(gfp_t gfp, unsigned int order, int preferred_nid, nodemask_t *nodemask) { struct page *page; @@ -4977,13 +4977,13 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, * so bail out early if the request is out of bound. */ if (unlikely(order >= MAX_ORDER)) { - WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN)); + WARN_ON_ONCE(!(gfp & __GFP_NOWARN)); return NULL; } - gfp_mask &= gfp_allowed_mask; - alloc_gfp = gfp_mask; - if (!prepare_alloc_pages(gfp_mask, order, preferred_nid, nodemask, &ac, + gfp &= gfp_allowed_mask; + alloc_gfp = gfp; + if (!prepare_alloc_pages(gfp, order, preferred_nid, nodemask, &ac, &alloc_gfp, &alloc_flags)) return NULL; @@ -4991,7 +4991,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, * Forbid the first pass from falling back to types that fragment * memory until all local zones are considered. */ - alloc_flags |= alloc_flags_nofragment(ac.preferred_zoneref->zone, gfp_mask); + alloc_flags |= alloc_flags_nofragment(ac.preferred_zoneref->zone, gfp); /* First allocation attempt */ page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac); @@ -5004,7 +5004,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, * from a particular context which has been marked by * memalloc_no{fs,io}_{save,restore}. */ - alloc_gfp = current_gfp_context(gfp_mask); + alloc_gfp = current_gfp_context(gfp); ac.spread_dirty_pages = false; /* @@ -5016,8 +5016,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, page = __alloc_pages_slowpath(alloc_gfp, order, &ac); out: - if (memcg_kmem_enabled() && (gfp_mask & __GFP_ACCOUNT) && page && - unlikely(__memcg_kmem_charge_page(page, gfp_mask, order) != 0)) { + if (memcg_kmem_enabled() && (gfp & __GFP_ACCOUNT) && page && + unlikely(__memcg_kmem_charge_page(page, gfp, order) != 0)) { __free_pages(page, order); page = NULL; } From patchwork Mon Feb 15 21:02:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12089193 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=-16.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,USER_AGENT_GIT 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 F2D5AC433E6 for ; Mon, 15 Feb 2021 21:02:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 81ECA64DEC for ; Mon, 15 Feb 2021 21:02:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81ECA64DEC 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 661CB8D0141; Mon, 15 Feb 2021 16:02:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D1D08D0140; Mon, 15 Feb 2021 16:02:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AD238D0142; Mon, 15 Feb 2021 16:02:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 16B788D013F for ; Mon, 15 Feb 2021 16:02:20 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D52028248047 for ; Mon, 15 Feb 2021 21:02:19 +0000 (UTC) X-FDA: 77821725198.08.meat09_08175042763e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id BB11E1819E623 for ; Mon, 15 Feb 2021 21:02:19 +0000 (UTC) X-HE-Tag: meat09_08175042763e X-Filterd-Recvd-Size: 8018 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Feb 2021 21:02:17 +0000 (UTC) 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=RdJbcC6TW0aIAr2m3bvDrNfEz+Rj1fQDi2jA7rWw6IU=; b=CGXXgk6D56KEDPqU15BlN5a6K4 sG8E4NwSfUhZQKtBWH5aoYaGnmXtK25Bbx158v9do8gl+9La6BC8XAjF15x3uZADy7gUHGiE2QJHm PDrPRMFSSu/Qv/+7XUhCIPqOW3vSPFbHpS1MbxsWrRatOXVF7U0W92sIwPa4izW2hXPU9iownhsFi OAbeGZlHX4WngBsmtmU7hxDIeJANrc4yTBs7VRvfI5tKb8+sHoROg8uvej1GRghc9bT5MqJ/7Yrpf 72n+xUPsQVY8a06/0lUCR/nSSjX0SNWzKLWOVHS7km7fBv88UBw2fhU3cQEXgCCxNKDChK8in5lOq sWeoAkBQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBl0W-00G3jA-0o; Mon, 15 Feb 2021 21:02:12 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport , Vlastimil Babka , Michal Hocko Subject: [PATCH v2 3/6] mm/page_alloc: Combine __alloc_pages and __alloc_pages_nodemask Date: Mon, 15 Feb 2021 21:02:00 +0000 Message-Id: <20210215210203.3827513-4-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215210203.3827513-1-willy@infradead.org> References: <20210215210203.3827513-1-willy@infradead.org> MIME-Version: 1.0 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: There are only two callers of __alloc_pages() so prune the thicket of alloc_page variants by combining the two functions together. Current callers of __alloc_pages() simply add an extra 'NULL' parameter and current callers of __alloc_pages_nodemask() call __alloc_pages() instead. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka Acked-by: Michal Hocko --- Documentation/admin-guide/mm/transhuge.rst | 2 +- include/linux/gfp.h | 13 +++---------- mm/hugetlb.c | 2 +- mm/internal.h | 4 ++-- mm/mempolicy.c | 6 +++--- mm/migrate.c | 2 +- mm/page_alloc.c | 5 ++--- 7 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index 3b8a336511a4..c9c37f16eef8 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -402,7 +402,7 @@ compact_fail but failed. It is possible to establish how long the stalls were using the function -tracer to record how long was spent in __alloc_pages_nodemask and +tracer to record how long was spent in __alloc_pages() and using the mm_page_alloc tracepoint to identify which allocations were for huge pages. diff --git a/include/linux/gfp.h b/include/linux/gfp.h index ecd1b5d27936..012dc86923b3 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -512,15 +512,8 @@ static inline int arch_make_page_accessible(struct page *page) } #endif -struct page * -__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, - nodemask_t *nodemask); - -static inline struct page * -__alloc_pages(gfp_t gfp_mask, unsigned int order, int preferred_nid) -{ - return __alloc_pages_nodemask(gfp_mask, order, preferred_nid, NULL); -} +struct page *__alloc_pages(gfp_t gfp, unsigned int order, int preferred_nid, + nodemask_t *nodemask); /* * Allocate pages, preferring the node given as nid. The node must be valid and @@ -532,7 +525,7 @@ __alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order) VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); VM_WARN_ON((gfp_mask & __GFP_THISNODE) && !node_online(nid)); - return __alloc_pages(gfp_mask, order, nid); + return __alloc_pages(gfp_mask, order, nid, NULL); } /* diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b6992297aa16..05ac34febc71 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1589,7 +1589,7 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, gfp_mask |= __GFP_RETRY_MAYFAIL; if (nid == NUMA_NO_NODE) nid = numa_mem_id(); - page = __alloc_pages_nodemask(gfp_mask, order, nid, nmask); + page = __alloc_pages(gfp_mask, order, nid, nmask); if (page) __count_vm_event(HTLB_BUDDY_PGALLOC); else diff --git a/mm/internal.h b/mm/internal.h index 9902648f2206..0c593c142175 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -126,10 +126,10 @@ extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address); * family of functions. * * nodemask, migratetype and highest_zoneidx are initialized only once in - * __alloc_pages_nodemask() and then never change. + * __alloc_pages() and then never change. * * zonelist, preferred_zone and highest_zoneidx are set first in - * __alloc_pages_nodemask() for the fast path, and might be later changed + * __alloc_pages() for the fast path, and might be later changed * in __alloc_pages_slowpath(). All other functions pass the whole structure * by a const pointer. */ diff --git a/mm/mempolicy.c b/mm/mempolicy.c index ab51132547b8..5f0d20298736 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2140,7 +2140,7 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order, { struct page *page; - page = __alloc_pages(gfp, order, nid); + page = __alloc_pages(gfp, order, nid, NULL); /* skip NUMA_INTERLEAVE_HIT counter update if numa stats is disabled */ if (!static_branch_likely(&vm_numa_stat_key)) return page; @@ -2237,7 +2237,7 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, nmask = policy_nodemask(gfp, pol); preferred_nid = policy_node(gfp, pol, node); - page = __alloc_pages_nodemask(gfp, order, preferred_nid, nmask); + page = __alloc_pages(gfp, order, preferred_nid, nmask); mpol_cond_put(pol); out: return page; @@ -2274,7 +2274,7 @@ struct page *alloc_pages_current(gfp_t gfp, unsigned order) if (pol->mode == MPOL_INTERLEAVE) page = alloc_page_interleave(gfp, order, interleave_nodes(pol)); else - page = __alloc_pages_nodemask(gfp, order, + page = __alloc_pages(gfp, order, policy_node(gfp, pol, numa_node_id()), policy_nodemask(gfp, pol)); diff --git a/mm/migrate.c b/mm/migrate.c index 62b81d5257aa..47df0df8f21a 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1617,7 +1617,7 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) if (is_highmem_idx(zidx) || zidx == ZONE_MOVABLE) gfp_mask |= __GFP_HIGHMEM; - new_page = __alloc_pages_nodemask(gfp_mask, order, nid, mtc->nmask); + new_page = __alloc_pages(gfp_mask, order, nid, mtc->nmask); if (new_page && PageTransHuge(new_page)) prep_transhuge_page(new_page); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9e4841ede0f4..b917afdfcd69 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4963,8 +4963,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, /* * This is the 'heart' of the zoned buddy allocator. */ -struct page * -__alloc_pages_nodemask(gfp_t gfp, unsigned int order, int preferred_nid, +struct page *__alloc_pages(gfp_t gfp, unsigned int order, int preferred_nid, nodemask_t *nodemask) { struct page *page; @@ -5026,7 +5025,7 @@ __alloc_pages_nodemask(gfp_t gfp, unsigned int order, int preferred_nid, return page; } -EXPORT_SYMBOL(__alloc_pages_nodemask); +EXPORT_SYMBOL(__alloc_pages); /* * Common helper functions. Never use with __GFP_HIGHMEM because the returned From patchwork Mon Feb 15 21:02:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12089191 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=-16.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,USER_AGENT_GIT 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 09706C433DB for ; Mon, 15 Feb 2021 21:02:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9F92364DEC for ; Mon, 15 Feb 2021 21:02:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F92364DEC 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 3BAE58D013F; Mon, 15 Feb 2021 16:02:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 299DE8D0141; Mon, 15 Feb 2021 16:02:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 160688D0140; Mon, 15 Feb 2021 16:02:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id EFBB18D013F for ; Mon, 15 Feb 2021 16:02:19 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B62DD1830BAFC for ; Mon, 15 Feb 2021 21:02:19 +0000 (UTC) X-FDA: 77821725198.13.oven93_2d016ee2763e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 97F3D182E5D51 for ; Mon, 15 Feb 2021 21:02:19 +0000 (UTC) X-HE-Tag: oven93_2d016ee2763e X-Filterd-Recvd-Size: 3835 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Feb 2021 21:02:19 +0000 (UTC) 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=DcMcGqEYGitsI8JzyEsY2SVmAXMuMGUx+1mezGKwMnI=; b=VaSCaeyYGRx8pojh/nkeJjmfa3 0/dMR8ovO0Fwd4XRuCfocFygy/ijU67cd9OUUm5Pewu3P0chuWFd3SmlrOcK1CYESBfMcF3QUBMKq rG4JgnhIwISB26o+dbbVHpC75psIvRwVm2r2pBtXPrgTDVMPG6j50BfacW1t1oLWmwbrwEoChA2Yk a67m2hVhWD3Sv0oZLZa3yaA25Pb5QhD1BYrrIYrO2vmBboRiuYJUokRoGW3UJiC6rd2lKUl4S2NOY Pm16z4RlZla7b0thQpXKapDLaw/vMc+Kgz5RHr6ax4PnblV0jRyfNmtOIwGntpcZ1Rou3JhYijun6 9cFeNZew==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBl0X-00G3jG-Ar; Mon, 15 Feb 2021 21:02:13 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport , Vlastimil Babka , Michal Hocko Subject: [PATCH v2 4/6] mm/mempolicy: Rename alloc_pages_current to alloc_pages Date: Mon, 15 Feb 2021 21:02:01 +0000 Message-Id: <20210215210203.3827513-5-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215210203.3827513-1-willy@infradead.org> References: <20210215210203.3827513-1-willy@infradead.org> MIME-Version: 1.0 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) Acked-by: Vlastimil Babka Acked-by: Michal Hocko --- include/linux/gfp.h | 8 +------- mm/mempolicy.c | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 012dc86923b3..f61e8f4b6a1e 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -543,13 +543,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 5f0d20298736..c71532b7e3f8 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2245,7 +2245,7 @@ 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, @@ -2259,7 +2259,7 @@ EXPORT_SYMBOL(alloc_pages_vma); * interrupt context and 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 +2280,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) { From patchwork Mon Feb 15 21:02:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12089205 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=-16.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,USER_AGENT_GIT 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 3F369C433E0 for ; Mon, 15 Feb 2021 21:27:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7F52D64DEB for ; Mon, 15 Feb 2021 21:27:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F52D64DEB 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 1215C8D0146; Mon, 15 Feb 2021 16:27:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 037A48D0140; Mon, 15 Feb 2021 16:27:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C67E88D0146; Mon, 15 Feb 2021 16:27:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id A42C78D0140 for ; Mon, 15 Feb 2021 16:27:45 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7004E182C37FB for ; Mon, 15 Feb 2021 21:27:45 +0000 (UTC) X-FDA: 77821789290.27.6F95F65 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 9214B407F8EB for ; Mon, 15 Feb 2021 21:27:42 +0000 (UTC) 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=oFOH0RLriHgX7doqy8IQPzbwxwo66Qod+mnch1C9/cw=; b=X/nvdaDmh1lfS6tOBXujNtaugC DeTLKEHHixV4vcrckteSbNQdiBpG13FqYbq+mopkk0Gm9Axyn473hHD0jGkX9Ldde33T1y5XnGwhX fdco7NJixKJJBe/5z8FDzaquWqtoUup1ewPVAHzk47KcqWXrR2deIuf2gw072Pmh+NiePHsRs5gUG NoVTko6ANnBjrxQI8SPoDe6KEsGBpUORFq16hMq0fD8bBKuz9wsk91Uy/4ynuzaXuMC5Kp3UKEyTp Lj5qkKnrbXgA499y3DUXwfZuCz52QZTPoWNdciTy+2cmrjjeklnJnRb5mQW9sj479KeyBZ2XRbGHV 0OBHt5yA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBl0Z-00G3jN-7b; Mon, 15 Feb 2021 21:02:15 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport Subject: [PATCH v2 5/6] mm/mempolicy: Rewrite alloc_pages documentation Date: Mon, 15 Feb 2021 21:02:02 +0000 Message-Id: <20210215210203.3827513-6-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215210203.3827513-1-willy@infradead.org> References: <20210215210203.3827513-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: uwzu7rpdczuwtptq6inz6h441qgqj956 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9214B407F8EB Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613424462-872101 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: Document alloc_pages() for both NUMA and non-NUMA cases as kernel-doc doesn't care. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Mike Rapoport Acked-by: Michal Hocko --- mm/mempolicy.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index c71532b7e3f8..96c98ce16727 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2245,19 +2245,18 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, EXPORT_SYMBOL(alloc_pages_vma); /** - * alloc_pages - Allocate pages. + * alloc_pages - Allocate pages. + * @gfp: GFP flags. + * @order: Power of two of number of pages to allocate. * - * @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 1 << @order contiguous pages. The physical address of the + * first page is naturally aligned (eg an order-3 allocation will be aligned + * to a multiple of 8 * PAGE_SIZE bytes). The NUMA policy of the current + * process is honoured when in process context. * - * 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. + * Context: Can be called from any context, providing the appropriate GFP + * flags are used. + * Return: NULL when no page can be allocated. */ struct page *alloc_pages(gfp_t gfp, unsigned order) { From patchwork Mon Feb 15 21:02:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12089203 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=-16.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,USER_AGENT_GIT 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 201DDC433DB for ; Mon, 15 Feb 2021 21:27:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 42BD364DF4 for ; Mon, 15 Feb 2021 21:27:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42BD364DF4 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 9AB418D0145; Mon, 15 Feb 2021 16:27:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 932048D0140; Mon, 15 Feb 2021 16:27:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D3F58D0145; Mon, 15 Feb 2021 16:27:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 62F6F8D0140 for ; Mon, 15 Feb 2021 16:27:44 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2A9791830BAFC for ; Mon, 15 Feb 2021 21:27:44 +0000 (UTC) X-FDA: 77821789248.21.D186BFF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 61C1D40001DE for ; Mon, 15 Feb 2021 21:27:40 +0000 (UTC) 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=U8xL7jZtVdkTL717JgJE+H0mUa5R2CNMtxN6ezrvZEM=; b=EQyfhl9CuNGCPwMd78XzMzdIXE qM967QAynK0viF5gFJJV0EoypwtKXz3r25543NdypnfHP6FdF+At4afDgPIDzvUsoKRLyEiR4wv75 t8VBBYnzJvVrjLr2YfcZM1Wj0YkpqyGkiV9QsdzSQdfPw7kwePjbBCXZewoCbHuyHsY/isY9VO5mt od+aGlfz6ZRJlmPmB2aFuZtzeIipGr7kc93P8Dsg4XYgNDBkr0oX139UBQfCdIz4fWOTMO5hnA8gT BSyzq22qmvSVUr7oddeW9IyWQMkJgdmY9Py1x+KNJVi32yVIKkzZ5jdRx8fZZCnrjXnNDHVSatZ43 Jz3inIzw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBl0a-00G3jW-Dd; Mon, 15 Feb 2021 21:02:16 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport Subject: [PATCH v2 6/6] mm/mempolicy: Fix mpol_misplaced kernel-doc Date: Mon, 15 Feb 2021 21:02:03 +0000 Message-Id: <20210215210203.3827513-7-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215210203.3827513-1-willy@infradead.org> References: <20210215210203.3827513-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: meu49f9j7rcs79oz3tc8sd1puku7ka8k X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 61C1D40001DE Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613424460-456474 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: Sphinx interprets the Return section as a list and complains about it. Turn it into a sentence and move it to the end of the kernel-doc to fit the kernel-doc style. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Mike Rapoport --- Documentation/core-api/mm-api.rst | 1 + mm/mempolicy.c | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Documentation/core-api/mm-api.rst b/Documentation/core-api/mm-api.rst index 201b5423303b..874ae1250258 100644 --- a/Documentation/core-api/mm-api.rst +++ b/Documentation/core-api/mm-api.rst @@ -92,3 +92,4 @@ More Memory Management Functions :export: .. kernel-doc:: mm/page_alloc.c +.. kernel-doc:: mm/mempolicy.c diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 96c98ce16727..577f59c8f327 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2456,14 +2456,11 @@ static void sp_free(struct sp_node *n) * @addr: virtual address where page mapped * * Lookup current policy node id for vma,addr and "compare to" page's - * node id. - * - * Returns: - * -1 - not misplaced, page is in the right node - * node - node id where the page should be - * - * Policy determination "mimics" alloc_page_vma(). + * node id. Policy determination "mimics" alloc_page_vma(). * Called from fault path where we know the vma and faulting address. + * + * Return: -1 if the page is in a node that is valid for this policy, or a + * suitable node ID to allocate a replacement page from. */ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long addr) {