From: Vladimir Davydov Date: Tue, 22 Sep 2015 21:59:20 +0000 (-0700) Subject: vmscan: fix sane_reclaim helper for legacy memcg X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d5028f9f7d8de5c375c52b98976b6f310e73398f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 33398cf2f360c ("memcg: export struct mem_cgroup"). Fix it. Fixes: 33398cf2f360c ("memcg: export struct mem_cgroup") Signed-off-by: Vladimir Davydov Acked-by: Tejun Heo Acked-by: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 2d978b28a410..7f63a9381f71 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -175,7 +175,7 @@ static bool sane_reclaim(struct scan_control *sc) if (!memcg) return true; #ifdef CONFIG_CGROUP_WRITEBACK - if (memcg->css.cgroup) + if (cgroup_on_dfl(memcg->css.cgroup)) return true; #endif return false;