From 5843c11c3994b8ee68ad6b88d46df00ae2a87ab8 Mon Sep 17 00:00:00 2001 From: Vladimir Davydov Date: Tue, 22 Sep 2015 14:59:20 -0700 Subject: [PATCH] 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 5e941251b82a2 ("memcg: export struct mem_cgroup"). Fix it. Fixes: 5e941251b82a2 ("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 --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 2d978b28a410b..7f63a9381f71e 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; -- 2.39.5