mm/memcontrol.c: lost css_put in memcg_expand_shrinker_maps()
Subsystems (3)
[email protected]
maintainerPATCH 10/15 mm/memcontrol.c: lost css_put in memcg_expand_shrinker_maps()
From: Vasily Averin <[email protected]>
Subject: 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.
Fixes 0a4465d34028 ("mm, memcg: assign memcg-aware shrinkers bitmap to memcg")
Signed-off-by Vasily Averin <[email protected]>
Acked-by Kirill Tkhai <[email protected]>
Acked-by Michal Hocko <[email protected]>
Reviewed-by Roman Gushchin <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Vladimir Davydov <[email protected]>
Cc <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/memcontrol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
mm/memcontrol.c renamed from mm/memcontrol.c~memcg-lost-css_put-in-memcg_expand_shrinker_maps +3 -1
@@ -409,8 +409,10 @@ int memcg_expand_shrinker_maps(int new_iif (mem_cgroup_is_root (memcg))continue ; ret =memcg_expand_one_shrinker_map (memcg, size, old_size); -if (ret) +if (ret) { +mem_cgroup_iter_break (NULL , memcg); goto unlock; + } } unlock:if (!ret)
_