mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
memcg: bail out memory.max when memcg is dying
memory.max has the same high-latency reclaim loop as memory.high, and may additionally invoke the OOM killer on a cgroup that is already going away, further delaying its removal. Mitigate this by bailing out of the loop once memcg_is_dying(). Link: https://lore.kernel.org/20260702120235.376752-3-jiayuan.chen@linux.dev Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com> Reported-by: Zhou Yingfu <yingfu.zhou@shopee.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Jiayuan Chen <jiayuan.chen@linux.dev> Cc: Axel Rasmussen <axelrasmussen@google.com> Cc: Barry Song <baohua@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Kairui Song <kasong@tencent.com> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: Shakeel Butt <shakeel.butt@linux.dev> Cc: Wei Xu <weixugc@google.com> Cc: Yuanchu Xie <yuanchu@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
0beeaf14e7
commit
e13f634f50
|
|
@ -4854,6 +4854,10 @@ static ssize_t memory_max_write(struct kernfs_open_file *of,
|
|||
if (signal_pending(current))
|
||||
break;
|
||||
|
||||
/* cgroup_rmdir() waits for us with cgroup_mutex held. */
|
||||
if (memcg_is_dying(memcg))
|
||||
break;
|
||||
|
||||
if (!drained) {
|
||||
drain_all_stock(memcg);
|
||||
drained = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user