diff options
-rw-r--r-- | fs/buffer.c | 8 | ||||
-rw-r--r-- | include/linux/swap.h | 2 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 | ||||
-rw-r--r-- | mm/vmscan.c | 21 |
4 files changed, 18 insertions, 15 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 8b9807523efe..1dae94acb3fe 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -360,16 +360,16 @@ void invalidate_bdev(struct block_device *bdev) | |||
360 | */ | 360 | */ |
361 | static void free_more_memory(void) | 361 | static void free_more_memory(void) |
362 | { | 362 | { |
363 | struct zone **zones; | 363 | struct zonelist *zonelist; |
364 | pg_data_t *pgdat; | 364 | pg_data_t *pgdat; |
365 | 365 | ||
366 | wakeup_pdflush(1024); | 366 | wakeup_pdflush(1024); |
367 | yield(); | 367 | yield(); |
368 | 368 | ||
369 | for_each_online_pgdat(pgdat) { | 369 | for_each_online_pgdat(pgdat) { |
370 | zones = pgdat->node_zonelists[gfp_zone(GFP_NOFS)].zones; | 370 | zonelist = &pgdat->node_zonelists[gfp_zone(GFP_NOFS)]; |
371 | if (*zones) | 371 | if (zonelist->zones[0]) |
372 | try_to_free_pages(zones, 0, GFP_NOFS); | 372 | try_to_free_pages(zonelist, 0, GFP_NOFS); |
373 | } | 373 | } |
374 | } | 374 | } |
375 | 375 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 878459ae0454..4286e7ac2b00 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -181,7 +181,7 @@ extern int rotate_reclaimable_page(struct page *page); | |||
181 | extern void swap_setup(void); | 181 | extern void swap_setup(void); |
182 | 182 | ||
183 | /* linux/mm/vmscan.c */ | 183 | /* linux/mm/vmscan.c */ |
184 | extern unsigned long try_to_free_pages(struct zone **zones, int order, | 184 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
185 | gfp_t gfp_mask); | 185 | gfp_t gfp_mask); |
186 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 186 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
187 | gfp_t gfp_mask); | 187 | gfp_t gfp_mask); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 32e796af12a1..1bda771a072a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1569,7 +1569,7 @@ nofail_alloc: | |||
1569 | reclaim_state.reclaimed_slab = 0; | 1569 | reclaim_state.reclaimed_slab = 0; |
1570 | p->reclaim_state = &reclaim_state; | 1570 | p->reclaim_state = &reclaim_state; |
1571 | 1571 | ||
1572 | did_some_progress = try_to_free_pages(zonelist->zones, order, gfp_mask); | 1572 | did_some_progress = try_to_free_pages(zonelist, order, gfp_mask); |
1573 | 1573 | ||
1574 | p->reclaim_state = NULL; | 1574 | p->reclaim_state = NULL; |
1575 | p->flags &= ~PF_MEMALLOC; | 1575 | p->flags &= ~PF_MEMALLOC; |
diff --git a/mm/vmscan.c b/mm/vmscan.c index f80a5b7c057f..ef8551e0d2d0 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1246,10 +1246,11 @@ static unsigned long shrink_zone(int priority, struct zone *zone, | |||
1246 | * If a zone is deemed to be full of pinned pages then just give it a light | 1246 | * If a zone is deemed to be full of pinned pages then just give it a light |
1247 | * scan then give up on it. | 1247 | * scan then give up on it. |
1248 | */ | 1248 | */ |
1249 | static unsigned long shrink_zones(int priority, struct zone **zones, | 1249 | static unsigned long shrink_zones(int priority, struct zonelist *zonelist, |
1250 | struct scan_control *sc) | 1250 | struct scan_control *sc) |
1251 | { | 1251 | { |
1252 | unsigned long nr_reclaimed = 0; | 1252 | unsigned long nr_reclaimed = 0; |
1253 | struct zone **zones = zonelist->zones; | ||
1253 | int i; | 1254 | int i; |
1254 | 1255 | ||
1255 | 1256 | ||
@@ -1301,8 +1302,8 @@ static unsigned long shrink_zones(int priority, struct zone **zones, | |||
1301 | * holds filesystem locks which prevent writeout this might not work, and the | 1302 | * holds filesystem locks which prevent writeout this might not work, and the |
1302 | * allocation attempt will fail. | 1303 | * allocation attempt will fail. |
1303 | */ | 1304 | */ |
1304 | static unsigned long do_try_to_free_pages(struct zone **zones, gfp_t gfp_mask, | 1305 | static unsigned long do_try_to_free_pages(struct zonelist *zonelist, |
1305 | struct scan_control *sc) | 1306 | gfp_t gfp_mask, struct scan_control *sc) |
1306 | { | 1307 | { |
1307 | int priority; | 1308 | int priority; |
1308 | int ret = 0; | 1309 | int ret = 0; |
@@ -1310,6 +1311,7 @@ static unsigned long do_try_to_free_pages(struct zone **zones, gfp_t gfp_mask, | |||
1310 | unsigned long nr_reclaimed = 0; | 1311 | unsigned long nr_reclaimed = 0; |
1311 | struct reclaim_state *reclaim_state = current->reclaim_state; | 1312 | struct reclaim_state *reclaim_state = current->reclaim_state; |
1312 | unsigned long lru_pages = 0; | 1313 | unsigned long lru_pages = 0; |
1314 | struct zone **zones = zonelist->zones; | ||
1313 | int i; | 1315 | int i; |
1314 | 1316 | ||
1315 | if (scan_global_lru(sc)) | 1317 | if (scan_global_lru(sc)) |
@@ -1333,7 +1335,7 @@ static unsigned long do_try_to_free_pages(struct zone **zones, gfp_t gfp_mask, | |||
1333 | sc->nr_scanned = 0; | 1335 | sc->nr_scanned = 0; |
1334 | if (!priority) | 1336 | if (!priority) |
1335 | disable_swap_token(); | 1337 | disable_swap_token(); |
1336 | nr_reclaimed += shrink_zones(priority, zones, sc); | 1338 | nr_reclaimed += shrink_zones(priority, zonelist, sc); |
1337 | /* | 1339 | /* |
1338 | * Don't shrink slabs when reclaiming memory from | 1340 | * Don't shrink slabs when reclaiming memory from |
1339 | * over limit cgroups | 1341 | * over limit cgroups |
@@ -1397,7 +1399,8 @@ out: | |||
1397 | return ret; | 1399 | return ret; |
1398 | } | 1400 | } |
1399 | 1401 | ||
1400 | unsigned long try_to_free_pages(struct zone **zones, int order, gfp_t gfp_mask) | 1402 | unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
1403 | gfp_t gfp_mask) | ||
1401 | { | 1404 | { |
1402 | struct scan_control sc = { | 1405 | struct scan_control sc = { |
1403 | .gfp_mask = gfp_mask, | 1406 | .gfp_mask = gfp_mask, |
@@ -1410,7 +1413,7 @@ unsigned long try_to_free_pages(struct zone **zones, int order, gfp_t gfp_mask) | |||
1410 | .isolate_pages = isolate_pages_global, | 1413 | .isolate_pages = isolate_pages_global, |
1411 | }; | 1414 | }; |
1412 | 1415 | ||
1413 | return do_try_to_free_pages(zones, gfp_mask, &sc); | 1416 | return do_try_to_free_pages(zonelist, gfp_mask, &sc); |
1414 | } | 1417 | } |
1415 | 1418 | ||
1416 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 1419 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
@@ -1428,11 +1431,11 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont, | |||
1428 | .mem_cgroup = mem_cont, | 1431 | .mem_cgroup = mem_cont, |
1429 | .isolate_pages = mem_cgroup_isolate_pages, | 1432 | .isolate_pages = mem_cgroup_isolate_pages, |
1430 | }; | 1433 | }; |
1431 | struct zone **zones; | 1434 | struct zonelist *zonelist; |
1432 | int target_zone = gfp_zone(GFP_HIGHUSER_MOVABLE); | 1435 | int target_zone = gfp_zone(GFP_HIGHUSER_MOVABLE); |
1433 | 1436 | ||
1434 | zones = NODE_DATA(numa_node_id())->node_zonelists[target_zone].zones; | 1437 | zonelist = &NODE_DATA(numa_node_id())->node_zonelists[target_zone]; |
1435 | if (do_try_to_free_pages(zones, sc.gfp_mask, &sc)) | 1438 | if (do_try_to_free_pages(zonelist, sc.gfp_mask, &sc)) |
1436 | return 1; | 1439 | return 1; |
1437 | return 0; | 1440 | return 0; |
1438 | } | 1441 | } |