diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 3 | ||||
-rw-r--r-- | mm/vmscan.c | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cbd532161f68..0284e528748d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1582,7 +1582,8 @@ nofail_alloc: | |||
1582 | reclaim_state.reclaimed_slab = 0; | 1582 | reclaim_state.reclaimed_slab = 0; |
1583 | p->reclaim_state = &reclaim_state; | 1583 | p->reclaim_state = &reclaim_state; |
1584 | 1584 | ||
1585 | did_some_progress = try_to_free_pages(zonelist, order, gfp_mask); | 1585 | did_some_progress = try_to_free_pages(zonelist, order, |
1586 | gfp_mask, nodemask); | ||
1586 | 1587 | ||
1587 | p->reclaim_state = NULL; | 1588 | p->reclaim_state = NULL; |
1588 | lockdep_clear_current_reclaim_state(); | 1589 | lockdep_clear_current_reclaim_state(); |
diff --git a/mm/vmscan.c b/mm/vmscan.c index f4619c6cd59e..06e72693b458 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -78,6 +78,12 @@ struct scan_control { | |||
78 | /* Which cgroup do we reclaim from */ | 78 | /* Which cgroup do we reclaim from */ |
79 | struct mem_cgroup *mem_cgroup; | 79 | struct mem_cgroup *mem_cgroup; |
80 | 80 | ||
81 | /* | ||
82 | * Nodemask of nodes allowed by the caller. If NULL, all nodes | ||
83 | * are scanned. | ||
84 | */ | ||
85 | nodemask_t *nodemask; | ||
86 | |||
81 | /* Pluggable isolate pages callback */ | 87 | /* Pluggable isolate pages callback */ |
82 | unsigned long (*isolate_pages)(unsigned long nr, struct list_head *dst, | 88 | unsigned long (*isolate_pages)(unsigned long nr, struct list_head *dst, |
83 | unsigned long *scanned, int order, int mode, | 89 | unsigned long *scanned, int order, int mode, |
@@ -1538,7 +1544,8 @@ static void shrink_zones(int priority, struct zonelist *zonelist, | |||
1538 | struct zone *zone; | 1544 | struct zone *zone; |
1539 | 1545 | ||
1540 | sc->all_unreclaimable = 1; | 1546 | sc->all_unreclaimable = 1; |
1541 | for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { | 1547 | for_each_zone_zonelist_nodemask(zone, z, zonelist, high_zoneidx, |
1548 | sc->nodemask) { | ||
1542 | if (!populated_zone(zone)) | 1549 | if (!populated_zone(zone)) |
1543 | continue; | 1550 | continue; |
1544 | /* | 1551 | /* |
@@ -1683,7 +1690,7 @@ out: | |||
1683 | } | 1690 | } |
1684 | 1691 | ||
1685 | unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | 1692 | unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
1686 | gfp_t gfp_mask) | 1693 | gfp_t gfp_mask, nodemask_t *nodemask) |
1687 | { | 1694 | { |
1688 | struct scan_control sc = { | 1695 | struct scan_control sc = { |
1689 | .gfp_mask = gfp_mask, | 1696 | .gfp_mask = gfp_mask, |
@@ -1694,6 +1701,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | |||
1694 | .order = order, | 1701 | .order = order, |
1695 | .mem_cgroup = NULL, | 1702 | .mem_cgroup = NULL, |
1696 | .isolate_pages = isolate_pages_global, | 1703 | .isolate_pages = isolate_pages_global, |
1704 | .nodemask = nodemask, | ||
1697 | }; | 1705 | }; |
1698 | 1706 | ||
1699 | return do_try_to_free_pages(zonelist, &sc); | 1707 | return do_try_to_free_pages(zonelist, &sc); |
@@ -1714,6 +1722,7 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont, | |||
1714 | .order = 0, | 1722 | .order = 0, |
1715 | .mem_cgroup = mem_cont, | 1723 | .mem_cgroup = mem_cont, |
1716 | .isolate_pages = mem_cgroup_isolate_pages, | 1724 | .isolate_pages = mem_cgroup_isolate_pages, |
1725 | .nodemask = NULL, /* we don't care the placement */ | ||
1717 | }; | 1726 | }; |
1718 | struct zonelist *zonelist; | 1727 | struct zonelist *zonelist; |
1719 | 1728 | ||