commit | beb0cc781b8e07d4bf89b6be2bf6e7ff7fe8b7ff | [log] [tgz] |
---|---|---|
author | Yang Shi <[email protected]> | Fri Aug 02 21:48:44 2019 -0700 |
committer | Greg Kroah-Hartman <[email protected]> | Tue Aug 06 19:06:54 2019 +0200 |
tree | c3aa160f117a86615f55ed6ff9929e3056d82860 | |
parent | 72651bbdf3d5e2d587c0a1cc0da977cb608787a5 [diff] |
mm: vmscan: check if mem cgroup is disabled or not before calling memcg slab shrinker commit fa1e512fac717f34e7c12d7a384c46e90a647392 upstream. Shakeel Butt reported premature oom on kernel with "cgroup_disable=memory" since mem_cgroup_is_root() returns false even though memcg is actually NULL. The drop_caches is also broken. It is because commit aeed1d325d42 ("mm/vmscan.c: generalize shrink_slab() calls in shrink_node()") removed the !memcg check before !mem_cgroup_is_root(). And, surprisingly root memcg is allocated even though memory cgroup is disabled by kernel boot parameter. Add mem_cgroup_disabled() check to make reclaimer work as expected. Link: http://lkml.kernel.org/r/[email protected] Fixes: aeed1d325d42 ("mm/vmscan.c: generalize shrink_slab() calls in shrink_node()") Signed-off-by: Yang Shi <[email protected]> Reported-by: Shakeel Butt <[email protected]> Reviewed-by: Shakeel Butt <[email protected]> Reviewed-by: Kirill Tkhai <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Jan Hadrava <[email protected]> Cc: Vladimir Davydov <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Qian Cai <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: <[email protected]> [4.19+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>