diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2013-09-24 18:27:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-24 20:00:25 -0400 |
commit | 20ba27f52eded4d14e309ac57971c9c83dec46e4 (patch) | |
tree | 6812074184e7f9f287be5bbeb15da593f0404925 /mm | |
parent | 99d7a8824a15cb6da046947e9b5a2335d52fbeb7 (diff) |
revert "memcg, vmscan: do not fall into reclaim-all pass too quickly"
Revert commit e975de998b96 ("memcg, vmscan: do not fall into reclaim-all
pass too quickly")
I merged this prematurely - Michal and Johannes still disagree about the
overall design direction and the future remains unclear.
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmscan.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 8ed1b775bdc9..97b0ed16749f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2176,11 +2176,10 @@ static inline bool should_continue_reclaim(struct zone *zone, | |||
2176 | } | 2176 | } |
2177 | } | 2177 | } |
2178 | 2178 | ||
2179 | static int | 2179 | static void |
2180 | __shrink_zone(struct zone *zone, struct scan_control *sc, bool soft_reclaim) | 2180 | __shrink_zone(struct zone *zone, struct scan_control *sc, bool soft_reclaim) |
2181 | { | 2181 | { |
2182 | unsigned long nr_reclaimed, nr_scanned; | 2182 | unsigned long nr_reclaimed, nr_scanned; |
2183 | int groups_scanned = 0; | ||
2184 | 2183 | ||
2185 | do { | 2184 | do { |
2186 | struct mem_cgroup *root = sc->target_mem_cgroup; | 2185 | struct mem_cgroup *root = sc->target_mem_cgroup; |
@@ -2198,7 +2197,6 @@ __shrink_zone(struct zone *zone, struct scan_control *sc, bool soft_reclaim) | |||
2198 | while ((memcg = mem_cgroup_iter_cond(root, memcg, &reclaim, filter))) { | 2197 | while ((memcg = mem_cgroup_iter_cond(root, memcg, &reclaim, filter))) { |
2199 | struct lruvec *lruvec; | 2198 | struct lruvec *lruvec; |
2200 | 2199 | ||
2201 | groups_scanned++; | ||
2202 | lruvec = mem_cgroup_zone_lruvec(zone, memcg); | 2200 | lruvec = mem_cgroup_zone_lruvec(zone, memcg); |
2203 | 2201 | ||
2204 | shrink_lruvec(lruvec, sc); | 2202 | shrink_lruvec(lruvec, sc); |
@@ -2226,8 +2224,6 @@ __shrink_zone(struct zone *zone, struct scan_control *sc, bool soft_reclaim) | |||
2226 | 2224 | ||
2227 | } while (should_continue_reclaim(zone, sc->nr_reclaimed - nr_reclaimed, | 2225 | } while (should_continue_reclaim(zone, sc->nr_reclaimed - nr_reclaimed, |
2228 | sc->nr_scanned - nr_scanned, sc)); | 2226 | sc->nr_scanned - nr_scanned, sc)); |
2229 | |||
2230 | return groups_scanned; | ||
2231 | } | 2227 | } |
2232 | 2228 | ||
2233 | 2229 | ||
@@ -2235,19 +2231,8 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc) | |||
2235 | { | 2231 | { |
2236 | bool do_soft_reclaim = mem_cgroup_should_soft_reclaim(sc); | 2232 | bool do_soft_reclaim = mem_cgroup_should_soft_reclaim(sc); |
2237 | unsigned long nr_scanned = sc->nr_scanned; | 2233 | unsigned long nr_scanned = sc->nr_scanned; |
2238 | int scanned_groups; | ||
2239 | 2234 | ||
2240 | scanned_groups = __shrink_zone(zone, sc, do_soft_reclaim); | 2235 | __shrink_zone(zone, sc, do_soft_reclaim); |
2241 | /* | ||
2242 | * memcg iterator might race with other reclaimer or start from | ||
2243 | * a incomplete tree walk so the tree walk in __shrink_zone | ||
2244 | * might have missed groups that are above the soft limit. Try | ||
2245 | * another loop to catch up with others. Do it just once to | ||
2246 | * prevent from reclaim latencies when other reclaimers always | ||
2247 | * preempt this one. | ||
2248 | */ | ||
2249 | if (do_soft_reclaim && !scanned_groups) | ||
2250 | __shrink_zone(zone, sc, do_soft_reclaim); | ||
2251 | 2236 | ||
2252 | /* | 2237 | /* |
2253 | * No group is over the soft limit or those that are do not have | 2238 | * No group is over the soft limit or those that are do not have |