All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-mm@kvack.org, Mike Rapoport <rppt@linux.ibm.com>
Subject: [PATCH v3 1/7] mm/page_alloc: Rename alloc_mask to alloc_gfp
Date: Thu, 25 Feb 2021 15:06:36 +0000	[thread overview]
Message-ID: <20210225150642.2582252-2-willy@infradead.org> (raw)
In-Reply-To: <20210225150642.2582252-1-willy@infradead.org>

We have two masks involved -- the nodemask and the gfp mask, so
alloc_mask is an unclear name.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 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 f10966e3b4a5..da54ed84232a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4937,7 +4937,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);
@@ -4946,7 +4946,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.
@@ -4990,7 +4990,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 = { };
 
 	/*
@@ -5003,8 +5003,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;
 
 	/*
@@ -5014,7 +5015,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;
 
@@ -5024,7 +5025,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;
 
 	/*
@@ -5033,7 +5034,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 &&
@@ -5042,7 +5043,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;
 }
-- 
2.29.2



  reply	other threads:[~2021-02-25 15:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25 15:06 [PATCH v3 0/7] Rationalise __alloc_pages wrappers Matthew Wilcox (Oracle)
2021-02-25 15:06 ` Matthew Wilcox (Oracle) [this message]
2021-03-19 14:44   ` [PATCH v3 1/7] mm/page_alloc: Rename alloc_mask to alloc_gfp Vlastimil Babka
2021-02-25 15:06 ` [PATCH v3 2/7] mm/page_alloc: Rename gfp_mask to gfp Matthew Wilcox (Oracle)
2021-02-25 15:06 ` [PATCH v3 3/7] mm/page_alloc: Combine __alloc_pages and __alloc_pages_nodemask Matthew Wilcox (Oracle)
2021-02-25 15:06 ` [PATCH v3 4/7] mm/mempolicy: Rename alloc_pages_current to alloc_pages Matthew Wilcox (Oracle)
2021-02-25 15:06 ` [PATCH v3 5/7] mm/mempolicy: Rewrite alloc_pages documentation Matthew Wilcox (Oracle)
2021-03-19 14:47   ` Vlastimil Babka
2021-02-25 15:06 ` [PATCH v3 6/7] mm/mempolicy: Rewrite alloc_pages_vma documentation Matthew Wilcox (Oracle)
2021-02-25 18:42   ` Mike Rapoport
2021-03-19 14:48   ` Vlastimil Babka
2021-02-25 15:06 ` [PATCH v3 7/7] mm/mempolicy: Fix mpol_misplaced kernel-doc Matthew Wilcox (Oracle)
2021-03-19 14:49   ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210225150642.2582252-2-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.