Commit 1192d526 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[PATCH] Cleanup: Add zone pointer to get_page_from_freelist

There are frequent references to *z in get_page_from_freelist.

Add an explicit zone variable that can be used in all these places.
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bd1b1677
...@@ -887,35 +887,37 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, ...@@ -887,35 +887,37 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order,
struct zone **z = zonelist->zones; struct zone **z = zonelist->zones;
struct page *page = NULL; struct page *page = NULL;
int classzone_idx = zone_idx(*z); int classzone_idx = zone_idx(*z);
struct zone *zone;
/* /*
* Go through the zonelist once, looking for a zone with enough free. * Go through the zonelist once, looking for a zone with enough free.
* See also cpuset_zone_allowed() comment in kernel/cpuset.c. * See also cpuset_zone_allowed() comment in kernel/cpuset.c.
*/ */
do { do {
zone = *z;
if (unlikely((gfp_mask & __GFP_THISNODE) && if (unlikely((gfp_mask & __GFP_THISNODE) &&
(*z)->zone_pgdat != zonelist->zones[0]->zone_pgdat)) zone->zone_pgdat != zonelist->zones[0]->zone_pgdat))
break; break;
if ((alloc_flags & ALLOC_CPUSET) && if ((alloc_flags & ALLOC_CPUSET) &&
!cpuset_zone_allowed(*z, gfp_mask)) !cpuset_zone_allowed(zone, gfp_mask))
continue; continue;
if (!(alloc_flags & ALLOC_NO_WATERMARKS)) { if (!(alloc_flags & ALLOC_NO_WATERMARKS)) {
unsigned long mark; unsigned long mark;
if (alloc_flags & ALLOC_WMARK_MIN) if (alloc_flags & ALLOC_WMARK_MIN)
mark = (*z)->pages_min; mark = zone->pages_min;
else if (alloc_flags & ALLOC_WMARK_LOW) else if (alloc_flags & ALLOC_WMARK_LOW)
mark = (*z)->pages_low; mark = zone->pages_low;
else else
mark = (*z)->pages_high; mark = zone->pages_high;
if (!zone_watermark_ok(*z, order, mark, if (!zone_watermark_ok(zone , order, mark,
classzone_idx, alloc_flags)) classzone_idx, alloc_flags))
if (!zone_reclaim_mode || if (!zone_reclaim_mode ||
!zone_reclaim(*z, gfp_mask, order)) !zone_reclaim(zone, gfp_mask, order))
continue; continue;
} }
page = buffered_rmqueue(zonelist, *z, order, gfp_mask); page = buffered_rmqueue(zonelist, zone, order, gfp_mask);
if (page) { if (page) {
break; break;
} }
......
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