linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: linux-mm@kvack.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: [PATCH 07/11] mm: Pass order to get_page_from_freelist in GFP flags
Date: Mon,  6 May 2019 21:06:05 -0700	[thread overview]
Message-ID: <20190507040609.21746-8-willy@infradead.org> (raw)
In-Reply-To: <20190507040609.21746-1-willy@infradead.org>

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

Matches the change to the __alloc_pages_nodemask API.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/page_alloc.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4705d0e7cf6f..cf71547be903 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3482,13 +3482,14 @@ alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask)
  * a page.
  */
 static struct page *
-get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
-						const struct alloc_context *ac)
+get_page_from_freelist(gfp_t gfp_mask, int alloc_flags,
+			const struct alloc_context *ac)
 {
 	struct zoneref *z;
 	struct zone *zone;
 	struct pglist_data *last_pgdat_dirty_limit = NULL;
 	bool no_fallback;
+	unsigned int order = gfp_order(gfp_mask);
 
 retry:
 	/*
@@ -3684,15 +3685,13 @@ __alloc_pages_cpuset_fallback(gfp_t gfp_mask, unsigned int order,
 {
 	struct page *page;
 
-	page = get_page_from_freelist(gfp_mask, order,
-			alloc_flags|ALLOC_CPUSET, ac);
+	page = get_page_from_freelist(gfp_mask, alloc_flags|ALLOC_CPUSET, ac);
 	/*
 	 * fallback to ignore cpuset restriction if our nodes
 	 * are depleted
 	 */
 	if (!page)
-		page = get_page_from_freelist(gfp_mask, order,
-				alloc_flags, ac);
+		page = get_page_from_freelist(gfp_mask, alloc_flags, ac);
 
 	return page;
 }
@@ -3730,7 +3729,7 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
 	 * allocation which will never fail due to oom_lock already held.
 	 */
 	page = get_page_from_freelist((gfp_mask | __GFP_HARDWALL) &
-				      ~__GFP_DIRECT_RECLAIM, order,
+				      ~__GFP_DIRECT_RECLAIM,
 				      ALLOC_WMARK_HIGH|ALLOC_CPUSET, ac);
 	if (page)
 		goto out;
@@ -3831,7 +3830,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
 
 	/* Try get a page from the freelist if available */
 	if (!page)
-		page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
+		page = get_page_from_freelist(gfp_mask, alloc_flags, ac);
 
 	if (page) {
 		struct zone *zone = page_zone(page);
@@ -4058,7 +4057,7 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
 		return NULL;
 
 retry:
-	page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
+	page = get_page_from_freelist(gfp_mask, alloc_flags, ac);
 
 	/*
 	 * If an allocation failed after direct reclaim, it could be because
@@ -4363,7 +4362,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 	 * The adjusted alloc_flags might result in immediate success, so try
 	 * that first
 	 */
-	page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
+	page = get_page_from_freelist(gfp_mask, alloc_flags, ac);
 	if (page)
 		goto got_pg;
 
@@ -4433,7 +4432,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 	}
 
 	/* Attempt with potentially adjusted zonelist and alloc_flags */
-	page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
+	page = get_page_from_freelist(gfp_mask, alloc_flags, ac);
 	if (page)
 		goto got_pg;
 
@@ -4640,7 +4639,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, int preferred_nid, nodemask_t *nodemask)
 	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_mask, alloc_flags, &ac);
 	if (likely(page))
 		goto out;
 
-- 
2.20.1


  parent reply	other threads:[~2019-05-07  4:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  4:05 [RFC 00/11] Remove 'order' argument from many mm functions Matthew Wilcox
2019-05-07  4:05 ` [PATCH 01/11] fix function alignment Matthew Wilcox
2019-05-09 10:55   ` Kirill A. Shutemov
2019-05-07  4:06 ` [PATCH 02/11] mm: Pass order to __alloc_pages_nodemask in GFP flags Matthew Wilcox
2019-05-09  1:50   ` Ira Weiny
2019-05-09 13:58     ` Matthew Wilcox
2019-05-09 16:22       ` Weiny, Ira
2019-05-09 10:59   ` Kirill A. Shutemov
2019-05-07  4:06 ` [PATCH 03/11] mm: Pass order to __get_free_pages() " Matthew Wilcox
2019-05-07  4:06 ` [PATCH 04/11] mm: Pass order to prep_new_page " Matthew Wilcox
2019-05-07  4:06 ` [PATCH 05/11] mm: Remove gfp_flags argument from rmqueue_pcplist Matthew Wilcox
2019-05-07  4:06 ` [PATCH 06/11] mm: Pass order to rmqueue in GFP flags Matthew Wilcox
2019-05-07  4:06 ` Matthew Wilcox [this message]
2019-05-07  4:06 ` [PATCH 08/11] mm: Pass order to __alloc_pages_cpuset_fallback " Matthew Wilcox
2019-05-07  4:06 ` [PATCH 09/11] mm: Pass order to prepare_alloc_pages " Matthew Wilcox
2019-05-07  4:06 ` [PATCH 10/11] mm: Pass order to try_to_free_pages " Matthew Wilcox
2019-05-07  4:06 ` [PATCH 11/11] mm: Pass order to node_reclaim() " Matthew Wilcox
2019-05-09  1:58 ` [RFC 00/11] Remove 'order' argument from many mm functions Ira Weiny
2019-05-09 14:07   ` Matthew Wilcox
2019-05-09 16:48     ` Weiny, Ira
2019-05-09 18:29       ` Matthew Wilcox
2019-05-29 21:44         ` Ira Weiny
2019-05-09 11:07 ` Kirill A. Shutemov
2019-05-14 14:51   ` Matthew Wilcox

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=20190507040609.21746-8-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).