From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0FAC3D5C0C for ; Thu, 2 Jul 2026 23:48:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783036099; cv=none; b=VUraK/V5qkxuKuGakufl50zNAWJbSA9mvj+i2/7UwzLxw+JeBxIEPMqWKhLliuY6AWyQMTz5/3CP4yT4dU5OobSI1iSmE0rfcCEJIk9x27lRpW+zw2mVdSpkScGvPqBxcWdVRNFBDQFr9hCQWoXZhb1T72TamvhE0qwsPysXWcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783036099; c=relaxed/simple; bh=mijfk2eEGdG5ncwouFHRGrkdewskpb8fyCuZ6MRC5B8=; h=Date:To:From:Subject:Message-Id; b=TplgBGvp84sxp3KY9DVABbE/zDFyP0vZiEgdaOigfXKJLcqy79OQSLtxrd91fjn7mD4yZIWj7gioMLFfVcL53YJtCyd5f/PuzechGyOXrBxcqUwwJqHrMPFfFpCXnN51/pR3mfaduNEzvDMRuZnzbnq1B3reSi3UAxhpv8vNmCA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=MMfZR8an; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="MMfZR8an" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 611041F000E9; Thu, 2 Jul 2026 23:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783036097; bh=p4Au+pA2L6T1pGSQgCGQpmuPjHJEKkUn9Px/1Z4LOUs=; h=Date:To:From:Subject; b=MMfZR8ankh6leO/wKwJOXLsu03kKE6NoO+rnG7R+Ar5qMmXfYPp0xor4RDeITkk3H G1ZwjHwvYi/FGE6gMYnfIStcQSBovT+cNsKESpTENgGcbtC6MCSB6jjaQssg0R23kz lHNl3jbufUmboKGMK46yAPlh9k7DiHhQ4TzGexWs= Date: Thu, 02 Jul 2026 16:48:17 -0700 To: mm-commits@vger.kernel.org,yuanchu@google.com,yingfu.zhou@shopee.com,weixugc@google.com,shakeel.butt@linux.dev,roman.gushchin@linux.dev,muchun.song@linux.dev,mhocko@kernel.org,ljs@kernel.org,kasong@tencent.com,jiayuan.chen@linux.dev,hannes@cmpxchg.org,david@kernel.org,baohua@kernel.org,axelrasmussen@google.com,jiayuan.chen@shopee.com,akpm@linux-foundation.org From: Andrew Morton Subject: + memcg-bail-out-memorymax-when-memcg-is-dying.patch added to mm-new branch Message-Id: <20260702234817.611041F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: memcg: bail out memory.max when memcg is dying has been added to the -mm mm-new branch. Its filename is memcg-bail-out-memorymax-when-memcg-is-dying.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/memcg-bail-out-memorymax-when-memcg-is-dying.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Jiayuan Chen 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(). Link: https://lore.kernel.org/20260702120235.376752-3-jiayuan.chen@linux.dev Signed-off-by: Jiayuan Chen Reported-by: Zhou Yingfu Acked-by: Johannes Weiner Cc: Jiayuan Chen Cc: Axel Rasmussen Cc: Barry Song Cc: David Hildenbrand Cc: Kairui Song Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- mm/memcontrol.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/mm/memcontrol.c~memcg-bail-out-memorymax-when-memcg-is-dying +++ a/mm/memcontrol.c @@ -4849,6 +4849,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 jiayuan.chen@shopee.com are mm-damon-core-split-a-fraction-of-regions-when-nr_regions-exceeds-max-2.patch mm-damon-tests-core-kunit-test-split-above-max_nr_regions-2.patch memcg-bail-out-memoryhigh-when-memcg-is-dying.patch memcg-bail-out-memorymax-when-memcg-is-dying.patch memcg-bail-out-proactive-reclaim-when-memcg-is-dying.patch memcg-v1-bail-out-reclaim-when-memcg-is-dying.patch