linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: lost css_put in memcg_expand_shrinker_maps()
@ 2020-02-11 11:20 Vasily Averin
  2020-02-11 11:32 ` Kirill Tkhai
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vasily Averin @ 2020-02-11 11:20 UTC (permalink / raw)
  To: Johannes Weiner, Michal Hocko, Vladimir Davydov, Andrew Morton,
	Kirill Tkhai, cgroups, linux-mm

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

Cc: stable@vger.kernel.org
Fixes commit 0a4465d34028("mm, memcg: assign memcg-aware shrinkers bitmap to memcg")

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 mm/memcontrol.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 6c83cf4..e2da615 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -409,8 +409,10 @@ int memcg_expand_shrinker_maps(int new_id)
 		if (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)
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-11 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 11:20 [PATCH] memcg: lost css_put in memcg_expand_shrinker_maps() Vasily Averin
2020-02-11 11:32 ` Kirill Tkhai
2020-02-11 14:01 ` Michal Hocko
2020-02-11 14:44 ` Roman Gushchin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox