On 11.02.2020 14:20, Vasily Averin wrote: > 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@xxxxxxxxxxxxxxx > Fixes commit 0a4465d34028("mm, memcg: assign memcg-aware shrinkers bitmap to memcg") > > Signed-off-by: Vasily Averin <vvs@xxxxxxxxxxxxx> Acked-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> Thanks! > --- > 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) >