summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorCon Kolivas2006-01-06 09:11:15 +0100
committerLinus Torvalds2006-01-06 17:33:28 +0100
commitf3fe65122da05e1cd4c9140340d96ea2f95d0c49 (patch)
tree65f2bcdb0a9665123b5083d3aea7dae483593cbc /mm/vmscan.c
parent[PATCH] consolidate lru_add_drain() and lru_drain_cache() (diff)
downloadkernel-qcow2-linux-f3fe65122da05e1cd4c9140340d96ea2f95d0c49.tar.gz
kernel-qcow2-linux-f3fe65122da05e1cd4c9140340d96ea2f95d0c49.tar.xz
kernel-qcow2-linux-f3fe65122da05e1cd4c9140340d96ea2f95d0c49.zip
[PATCH] mm: add populated_zone() helper
There are numerous places we check whether a zone is populated or not. Provide a helper function to check for populated zones and convert all checks for zone->present_pages. Signed-off-by: Con Kolivas <kernel@kolivas.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5c8a412b43f4..7681d8ee04fe 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -897,7 +897,7 @@ shrink_caches(struct zone **zones, struct scan_control *sc)
for (i = 0; zones[i] != NULL; i++) {
struct zone *zone = zones[i];
- if (zone->present_pages == 0)
+ if (!populated_zone(zone))
continue;
if (!cpuset_zone_allowed(zone, __GFP_HARDWALL))
@@ -1069,7 +1069,7 @@ loop_again:
for (i = pgdat->nr_zones - 1; i >= 0; i--) {
struct zone *zone = pgdat->node_zones + i;
- if (zone->present_pages == 0)
+ if (!populated_zone(zone))
continue;
if (zone->all_unreclaimable &&
@@ -1106,7 +1106,7 @@ scan:
struct zone *zone = pgdat->node_zones + i;
int nr_slab;
- if (zone->present_pages == 0)
+ if (!populated_zone(zone))
continue;
if (zone->all_unreclaimable && priority != DEF_PRIORITY)
@@ -1258,7 +1258,7 @@ void wakeup_kswapd(struct zone *zone, int order)
{
pg_data_t *pgdat;
- if (zone->present_pages == 0)
+ if (!populated_zone(zone))
return;
pgdat = zone->zone_pgdat;