Commit 93ea9964 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds

mm, page_alloc: remove field from alloc_context

The classzone_idx can be inferred from preferred_zoneref so remove the
unnecessary field and save stack space.
Signed-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c33d6c06
...@@ -1602,7 +1602,7 @@ unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order, ...@@ -1602,7 +1602,7 @@ unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
status = compact_zone_order(zone, order, gfp_mask, mode, status = compact_zone_order(zone, order, gfp_mask, mode,
&zone_contended, alloc_flags, &zone_contended, alloc_flags,
ac->classzone_idx); ac_classzone_idx(ac));
rc = max(status, rc); rc = max(status, rc);
/* /*
* It takes at least one zone that wasn't lock contended * It takes at least one zone that wasn't lock contended
...@@ -1612,7 +1612,7 @@ unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order, ...@@ -1612,7 +1612,7 @@ unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
/* If a normal allocation would succeed, stop compacting */ /* If a normal allocation would succeed, stop compacting */
if (zone_watermark_ok(zone, order, low_wmark_pages(zone), if (zone_watermark_ok(zone, order, low_wmark_pages(zone),
ac->classzone_idx, alloc_flags)) { ac_classzone_idx(ac), alloc_flags)) {
/* /*
* We think the allocation will succeed in this zone, * We think the allocation will succeed in this zone,
* but it is not certain, hence the false. The caller * but it is not certain, hence the false. The caller
......
...@@ -103,12 +103,13 @@ struct alloc_context { ...@@ -103,12 +103,13 @@ struct alloc_context {
struct zonelist *zonelist; struct zonelist *zonelist;
nodemask_t *nodemask; nodemask_t *nodemask;
struct zoneref *preferred_zoneref; struct zoneref *preferred_zoneref;
int classzone_idx;
int migratetype; int migratetype;
enum zone_type high_zoneidx; enum zone_type high_zoneidx;
bool spread_dirty_pages; bool spread_dirty_pages;
}; };
#define ac_classzone_idx(ac) zonelist_zone_idx(ac->preferred_zoneref)
/* /*
* Locate the struct page for both the matching buddy in our * Locate the struct page for both the matching buddy in our
* pair (buddy1) and the combined O(n+1) page they form (page). * pair (buddy1) and the combined O(n+1) page they form (page).
......
...@@ -2771,7 +2771,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, ...@@ -2771,7 +2771,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
mark = zone->watermark[alloc_flags & ALLOC_WMARK_MASK]; mark = zone->watermark[alloc_flags & ALLOC_WMARK_MASK];
if (!zone_watermark_fast(zone, order, mark, if (!zone_watermark_fast(zone, order, mark,
ac->classzone_idx, alloc_flags)) { ac_classzone_idx(ac), alloc_flags)) {
int ret; int ret;
/* Checked here to keep the fast path fast */ /* Checked here to keep the fast path fast */
...@@ -2794,7 +2794,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, ...@@ -2794,7 +2794,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
default: default:
/* did we reclaim enough */ /* did we reclaim enough */
if (zone_watermark_ok(zone, order, mark, if (zone_watermark_ok(zone, order, mark,
ac->classzone_idx, alloc_flags)) ac_classzone_idx(ac), alloc_flags))
goto try_this_zone; goto try_this_zone;
continue; continue;
...@@ -3114,7 +3114,7 @@ static void wake_all_kswapds(unsigned int order, const struct alloc_context *ac) ...@@ -3114,7 +3114,7 @@ static void wake_all_kswapds(unsigned int order, const struct alloc_context *ac)
for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, for_each_zone_zonelist_nodemask(zone, z, ac->zonelist,
ac->high_zoneidx, ac->nodemask) ac->high_zoneidx, ac->nodemask)
wakeup_kswapd(zone, order, zonelist_zone_idx(ac->preferred_zoneref)); wakeup_kswapd(zone, order, ac_classzone_idx(ac));
} }
static inline unsigned int static inline unsigned int
...@@ -3422,8 +3422,6 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, ...@@ -3422,8 +3422,6 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
goto no_zone; goto no_zone;
} }
ac.classzone_idx = zonelist_zone_idx(ac.preferred_zoneref);
/* First allocation attempt */ /* First allocation attempt */
page = get_page_from_freelist(alloc_mask, order, alloc_flags, &ac); page = get_page_from_freelist(alloc_mask, order, alloc_flags, &ac);
if (likely(page)) if (likely(page))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment