From: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Please fold into mm/memcg: Protect memcg_stock with a local_lock_t Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> [do: backported to v5.15] Signed-off-by: David Oberhollenzer <goliath@xxxxxxxxxxxx> --- mm/memcontrol.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 50d2d5432018..70c374761bb8 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3249,6 +3249,10 @@ static struct obj_cgroup *drain_obj_stock(struct memcg_stock_pcp *stock) } stock->cached_objcg = NULL; + /* + * The `old' objects needs to be released by the caller via + * obj_cgroup_put() outside of memcg_stock_pcp::stock_lock. + */ return old; } -- 2.37.1