We should break out of the hierarchy loop only if nr_reclaimed exceeded
nr_to_reclaim and not vice-versa. This patch fixes the condition.
Signed-off-by: Ying Han <yinghan@google.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* whole hierarchy is not sufficient.
*/
if (!global_reclaim(sc) &&
- sc->nr_to_reclaim >= sc->nr_reclaimed) {
+ sc->nr_to_reclaim <= sc->nr_reclaimed) {
mem_cgroup_iter_break(root, memcg);
break;
}