Commit d5028f9f authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Linus Torvalds

vmscan: fix sane_reclaim helper for legacy memcg

The sane_reclaim() helper is supposed to return false for memcg reclaim
if the legacy hierarchy is used, because the latter lacks dirty
throttling mechanism, and so it did before it was accidentally broken by
commit 33398cf2 ("memcg: export struct mem_cgroup").  Fix it.

Fixes: 33398cf2 ("memcg: export struct mem_cgroup")
Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d046b770
...@@ -175,7 +175,7 @@ static bool sane_reclaim(struct scan_control *sc) ...@@ -175,7 +175,7 @@ static bool sane_reclaim(struct scan_control *sc)
if (!memcg) if (!memcg)
return true; return true;
#ifdef CONFIG_CGROUP_WRITEBACK #ifdef CONFIG_CGROUP_WRITEBACK
if (memcg->css.cgroup) if (cgroup_on_dfl(memcg->css.cgroup))
return true; return true;
#endif #endif
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment