Skip to contentSkip to conversation

memcg-bail-out-memorymax-when-memcg-is-dying.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 5

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: memcg: bail out memory.max when memcg is dying
has been removed from the -mm tree. Its filename was
memcg-bail-out-memorymax-when-memcg-is-dying.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Jiayuan Chen <[email protected]>
Subject: memcg: bail out memory.max when memcg is dying
Date: Thu, 2 Jul 2026 20:02:28 +0800

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().

Cc Jiayuan Chen <[email protected]>
Cc Axel Rasmussen <[email protected]>
Cc Barry Song <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Kairui Song <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Muchun Song <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yuanchu Xie <[email protected]>

---

 mm/memcontrol.c |    4 ++++
 1 file changed, 4 insertions(+)
mm/memcontrol.c renamed from mm/memcontrol.c~memcg-bail-out-memorymax-when-memcg-is-dying +4 -0
@@ -4854,6 +4854,10 @@ static ssize_t memory_max_write(struct k
 		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;

_

Patches currently in -mm which might be from [email protected] are