[PATCH 04/11] mm: Pass order to prep_new_page in GFP flags

Matthew Wilcox
2019-05-07T04:06:18Z

Matches the change to the __alloc_pages_nodemask API.

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

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e26536825a0b..cb997c41c384 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2056,10 +2056,11 @@ inline void post_alloc_hook(struct page *page, unsigned int order,
set_page_owner(page, order, gfp_flags);
}

-static void prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags,
- unsigned int alloc_flags)
+static void prep_new_page(struct page *page, gfp_t gfp_flags,
+ unsigned int alloc_flags)
{
int i;
+ unsigned int order = gfp_order(gfp_flags);

post_alloc_hook(page, order, gfp_flags);

@@ -3598,7 +3599,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
page = rmqueue(ac->preferred_zoneref->zone, zone, order,
gfp_mask, alloc_flags, ac->migratetype);
if (page) {
- prep_new_page(page, order, gfp_mask, alloc_flags);
+ prep_new_page(page, gfp_mask, alloc_flags);

/*
* If this is a high-order atomic allocation then check
@@ -3828,7 +3829,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,

/* Prep a captured page if available */
if (page)
- prep_new_page(page, order, gfp_mask, alloc_flags);
+ prep_new_page(page, gfp_mask, alloc_flags);

/* Try get a page from the freelist if available */
if (!page)
--
2.20.1