diff options
-rw-r--r-- | mm/vmscan.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 9ce6ec84328e..884ae08c16cc 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1977,11 +1977,14 @@ restart: | |||
1977 | * If a zone is deemed to be full of pinned pages then just give it a light | 1977 | * If a zone is deemed to be full of pinned pages then just give it a light |
1978 | * scan then give up on it. | 1978 | * scan then give up on it. |
1979 | */ | 1979 | */ |
1980 | static void shrink_zones(int priority, struct zonelist *zonelist, | 1980 | static unsigned long shrink_zones(int priority, struct zonelist *zonelist, |
1981 | struct scan_control *sc) | 1981 | struct scan_control *sc) |
1982 | { | 1982 | { |
1983 | struct zoneref *z; | 1983 | struct zoneref *z; |
1984 | struct zone *zone; | 1984 | struct zone *zone; |
1985 | unsigned long nr_soft_reclaimed; | ||
1986 | unsigned long nr_soft_scanned; | ||
1987 | unsigned long total_scanned = 0; | ||
1985 | 1988 | ||
1986 | for_each_zone_zonelist_nodemask(zone, z, zonelist, | 1989 | for_each_zone_zonelist_nodemask(zone, z, zonelist, |
1987 | gfp_zone(sc->gfp_mask), sc->nodemask) { | 1990 | gfp_zone(sc->gfp_mask), sc->nodemask) { |
@@ -1998,8 +2001,17 @@ static void shrink_zones(int priority, struct zonelist *zonelist, | |||
1998 | continue; /* Let kswapd poll it */ | 2001 | continue; /* Let kswapd poll it */ |
1999 | } | 2002 | } |
2000 | 2003 | ||
2004 | nr_soft_scanned = 0; | ||
2005 | nr_soft_reclaimed = mem_cgroup_soft_limit_reclaim(zone, | ||
2006 | sc->order, sc->gfp_mask, | ||
2007 | &nr_soft_scanned); | ||
2008 | sc->nr_reclaimed += nr_soft_reclaimed; | ||
2009 | total_scanned += nr_soft_scanned; | ||
2010 | |||
2001 | shrink_zone(priority, zone, sc); | 2011 | shrink_zone(priority, zone, sc); |
2002 | } | 2012 | } |
2013 | |||
2014 | return total_scanned; | ||
2003 | } | 2015 | } |
2004 | 2016 | ||
2005 | static bool zone_reclaimable(struct zone *zone) | 2017 | static bool zone_reclaimable(struct zone *zone) |
@@ -2064,7 +2076,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2064 | sc->nr_scanned = 0; | 2076 | sc->nr_scanned = 0; |
2065 | if (!priority) | 2077 | if (!priority) |
2066 | disable_swap_token(); | 2078 | disable_swap_token(); |
2067 | shrink_zones(priority, zonelist, sc); | 2079 | total_scanned += shrink_zones(priority, zonelist, sc); |
2068 | /* | 2080 | /* |
2069 | * Don't shrink slabs when reclaiming memory from | 2081 | * Don't shrink slabs when reclaiming memory from |
2070 | * over limit cgroups | 2082 | * over limit cgroups |