]> Pileus Git - ~andy/linux/blobdiff - mm/memcontrol.c
memcg, vmscan: do not attempt soft limit reclaim if it would not scan anything
[~andy/linux] / mm / memcontrol.c
index a18e228f140bf8ade69625a00686f58a57c6b043..848fc6c195d28555cc8d445fcbf7dfc0022c7643 100644 (file)
@@ -1885,7 +1885,11 @@ enum mem_cgroup_filter_t
 mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg,
                struct mem_cgroup *root)
 {
-       struct mem_cgroup *parent = memcg;
+       struct mem_cgroup *parent;
+
+       if (!memcg)
+               memcg = root_mem_cgroup;
+       parent = memcg;
 
        if (res_counter_soft_limit_excess(&memcg->res))
                return VISIT;