diff options
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index ef8551e0d2d0..0515b8f44894 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1249,15 +1249,13 @@ static unsigned long shrink_zone(int priority, struct zone *zone, | |||
1249 | static unsigned long shrink_zones(int priority, struct zonelist *zonelist, | 1249 | static unsigned long shrink_zones(int priority, struct zonelist *zonelist, |
1250 | struct scan_control *sc) | 1250 | struct scan_control *sc) |
1251 | { | 1251 | { |
1252 | enum zone_type high_zoneidx = gfp_zone(sc->gfp_mask); | ||
1252 | unsigned long nr_reclaimed = 0; | 1253 | unsigned long nr_reclaimed = 0; |
1253 | struct zone **zones = zonelist->zones; | 1254 | struct zone **z; |
1254 | int i; | 1255 | struct zone *zone; |
1255 | |||
1256 | 1256 | ||
1257 | sc->all_unreclaimable = 1; | 1257 | sc->all_unreclaimable = 1; |
1258 | for (i = 0; zones[i] != NULL; i++) { | 1258 | for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { |
1259 | struct zone *zone = zones[i]; | ||
1260 | |||
1261 | if (!populated_zone(zone)) | 1259 | if (!populated_zone(zone)) |
1262 | continue; | 1260 | continue; |
1263 | /* | 1261 | /* |
@@ -1311,8 +1309,9 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
1311 | unsigned long nr_reclaimed = 0; | 1309 | unsigned long nr_reclaimed = 0; |
1312 | struct reclaim_state *reclaim_state = current->reclaim_state; | 1310 | struct reclaim_state *reclaim_state = current->reclaim_state; |
1313 | unsigned long lru_pages = 0; | 1311 | unsigned long lru_pages = 0; |
1314 | struct zone **zones = zonelist->zones; | 1312 | struct zone **z; |
1315 | int i; | 1313 | struct zone *zone; |
1314 | enum zone_type high_zoneidx = gfp_zone(gfp_mask); | ||
1316 | 1315 | ||
1317 | if (scan_global_lru(sc)) | 1316 | if (scan_global_lru(sc)) |
1318 | count_vm_event(ALLOCSTALL); | 1317 | count_vm_event(ALLOCSTALL); |
@@ -1320,8 +1319,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
1320 | * mem_cgroup will not do shrink_slab. | 1319 | * mem_cgroup will not do shrink_slab. |
1321 | */ | 1320 | */ |
1322 | if (scan_global_lru(sc)) { | 1321 | if (scan_global_lru(sc)) { |
1323 | for (i = 0; zones[i] != NULL; i++) { | 1322 | for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { |
1324 | struct zone *zone = zones[i]; | ||
1325 | 1323 | ||
1326 | if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) | 1324 | if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) |
1327 | continue; | 1325 | continue; |
@@ -1385,8 +1383,7 @@ out: | |||
1385 | priority = 0; | 1383 | priority = 0; |
1386 | 1384 | ||
1387 | if (scan_global_lru(sc)) { | 1385 | if (scan_global_lru(sc)) { |
1388 | for (i = 0; zones[i] != NULL; i++) { | 1386 | for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { |
1389 | struct zone *zone = zones[i]; | ||
1390 | 1387 | ||
1391 | if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) | 1388 | if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) |
1392 | continue; | 1389 | continue; |