]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
memcg: do obj_cgroup_put inside drain_obj_stock
authorShakeel Butt <shakeel.butt@linux.dev>
Fri, 4 Apr 2025 01:39:10 +0000 (18:39 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:48:11 +0000 (17:48 -0700)
commitae51c775aa2b1fd4fbaf781740ec8762292bec3a
tree45bf6372316b5aabf8ab53a944a526ae626899c5
parentb6d0471117daec360bad2b881c1e2d0f4d2c4d3b
memcg: do obj_cgroup_put inside drain_obj_stock

Previously we could not call obj_cgroup_put() inside the local lock
because on the put on the last reference, the release function
obj_cgroup_release() may try to re-acquire the local lock.  However that
chain has been broken.  Now simply do obj_cgroup_put() inside
drain_obj_stock() instead of returning the old objcg.

Link: https://lkml.kernel.org/r/20250404013913.1663035-7-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c