Commit 75866af6 authored by Vasily Averin's avatar Vasily Averin Committed by Linus Torvalds

mm/memcontrol.c: lost css_put in memcg_expand_shrinker_maps()

for_each_mem_cgroup() increases css reference counter for memory cgroup
and requires to use mem_cgroup_iter_break() if the walk is cancelled.

Link: http://lkml.kernel.org/r/c98414fb-7e1f-da0f-867a-9340ec4bd30b@virtuozzo.com
Fixes: 0a4465d3 ("mm, memcg: assign memcg-aware shrinkers bitmap to memcg")
Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
Acked-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Reviewed-by: default avatarRoman Gushchin <guro@fb.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fed98ef4
...@@ -409,9 +409,11 @@ int memcg_expand_shrinker_maps(int new_id) ...@@ -409,9 +409,11 @@ int memcg_expand_shrinker_maps(int new_id)
if (mem_cgroup_is_root(memcg)) if (mem_cgroup_is_root(memcg))
continue; continue;
ret = memcg_expand_one_shrinker_map(memcg, size, old_size); ret = memcg_expand_one_shrinker_map(memcg, size, old_size);
if (ret) if (ret) {
mem_cgroup_iter_break(NULL, memcg);
goto unlock; goto unlock;
} }
}
unlock: unlock:
if (!ret) if (!ret)
memcg_shrinker_map_size = size; memcg_shrinker_map_size = size;
......
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