From 238270e605ac380d8cb5ed97cc2b0fd8fbfb01c3 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Fri, 22 Feb 2013 16:32:30 -0800 Subject: [PATCH] --- yaml --- r: 356497 b: refs/heads/master c: a394cb8ee632ec5edce20309901ec66767497a43 h: refs/heads/master i: 356495: dd0a07d762f70ae3685f3836a21424a59a3dbc06 v: v3 --- [refs] | 2 +- trunk/mm/vmscan.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index ab44c4afc246..487d281fb5bb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4ca3a69bcb6875c3f20802522c1b4fc56bb14608 +refs/heads/master: a394cb8ee632ec5edce20309901ec66767497a43 diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 292f50a2a685..463990941a78 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -1973,18 +1973,17 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc) shrink_lruvec(lruvec, sc); /* - * Limit reclaim has historically picked one - * memcg and scanned it with decreasing - * priority levels until nr_to_reclaim had - * been reclaimed. This priority cycle is - * thus over after a single memcg. - * - * Direct reclaim and kswapd, on the other - * hand, have to scan all memory cgroups to - * fulfill the overall scan target for the + * Direct reclaim and kswapd have to scan all memory + * cgroups to fulfill the overall scan target for the * zone. + * + * Limit reclaim, on the other hand, only cares about + * nr_to_reclaim pages to be reclaimed and it will + * retry with decreasing priority if one round over the + * whole hierarchy is not sufficient. */ - if (!global_reclaim(sc)) { + if (!global_reclaim(sc) && + sc->nr_reclaimed >= sc->nr_to_reclaim) { mem_cgroup_iter_break(root, memcg); break; }