diff options
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 13 |
1 files changed, 11 insertions, 2 deletions
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 | ||