From: Shakeel Butt <shakeel.butt@linux.dev>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
Michal Koutny <mkoutny@suse.com>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Christian Brauner <brauner@kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Suren Baghdasaryan <surenb@google.com>,
"T . J . Mercier" <tjmercier@google.com>,
Usama Arif <usama.arif@linux.dev>,
Meta kernel team <kernel-team@meta.com>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 00/11] cgroup: don't hold cgroup_mutex for cgroup.kill and cgroup.freeze
Date: Tue, 1 Dec 2026 10:15:45 -0800 [thread overview]
Message-ID: <aw8OQ2CWiv42U0El@linux.dev> (raw)
In-Reply-To: <20261201095532.6e638bcaea0119ef81c69c54@linux-foundation.org>
On Tue, Dec 01, 2026 at 09:55:32AM -0800, Andrew Morton wrote:
> On Mon, 30 Nov 2026 09:34:14 -0800 Shakeel Butt <shakeel.butt@linux.dev> wrote:
>
> > cgroup.kill and cgroup.freeze take cgroup_mutex and hold it while they
> > walk every task of the subtree. cgroup.kill is how userspace OOM
> > killers, service managers and container runtimes stop a workload, often
> > when the system is already under pressure. Waiting for cgroup_mutex
> > makes the kill as slow as the slowest cgroup operation on the machine.
>
> I gave this series a fairly thorough workout on my LLM-driven live
> kernel test setup.
>
> I told it "if you hit a bug, fix it and keep going". It seems to have
> found four issues, fixed them and then everything worked OK. Its fixes
> sped a few things up nicely. I'll send those 4 patches in reply to the
> patches which they patch.
>
Thanks a lot for the testing and the fixes.
Three of the four fixes match changes I already have for v3, after the
sashiko review of v1:
- the NULL check in the nonleaf freezer selftest (7/11);
- EBUSY for a switch to threaded while a kill of the cgroup, or of a
cgroup below it, is running (10/11);
- refusing cgroup.kill below a threaded cgroup (10/11). Mainline has
this bug too, so v3 also adds it as a separate fix for stable.
Skipping empty branches in the task pass of the freeze walk (11/11) is
new to me, and the numbers look good. I'll fold it into the freeze patch
with your Co-developed-by and Signed-off-by, if that's OK with you.
v3 will also fix two more issues that sashiko found in v2. The fork path
decides whether its SIGKILL is forced from the parent instead of the
cgroup.kill writer, and the task pass of the freeze walk can visit a
cgroup that was created below a subtree it skipped.
The populated freeze rows are a bit slower. The freeze walk now takes
css_set_lock for each task to check which cgroup it is in, and I'll look
at whether that can be avoided.
With v3, the four fix patches won't be needed on top.
Thanks,
Shakeel
prev parent reply other threads:[~2026-12-01 18:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 17:34 [PATCH v2 00/11] cgroup: don't hold cgroup_mutex for cgroup.kill and cgroup.freeze Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 01/11] cgroup: don't lose a task in css_task_iter when a migration fails Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 02/11] cgroup: kill a child forked while cgroup.kill runs Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 03/11] cgroup/freezer: check own tasks and descendants for the frozen state Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 04/11] cgroup/freezer: don't update the frozen state of removed cgroups Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 05/11] cgroup/freezer: test the freeze trap bit under siglock Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 06/11] selftests/cgroup: test cgroup.procs reads across a failed migration Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 07/11] selftests/cgroup: test the frozen state of a cgroup with tasks and children Shakeel Butt
2026-12-01 17:36 ` sashiko-bot
2026-12-01 17:55 ` Andrew Morton
2026-11-30 17:34 ` [PATCH v2 08/11] selftests/cgroup: test cgroup.kill in a threaded cgroup Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 09/11] cgroup: factor out cgroup_kn_break_active() and cgroup_kn_unbreak_active() Shakeel Butt
2026-11-30 17:34 ` [PATCH v2 10/11] cgroup: don't hold cgroup_mutex for cgroup.kill Shakeel Butt
2026-12-01 17:36 ` sashiko-bot
2026-12-01 17:55 ` Andrew Morton
2026-12-01 17:56 ` Andrew Morton
2026-11-30 17:34 ` [PATCH v2 11/11] cgroup/freezer: don't hold cgroup_mutex for cgroup.freeze Shakeel Butt
2026-12-01 17:36 ` sashiko-bot
2026-12-01 17:56 ` Andrew Morton
2026-12-01 17:55 ` [PATCH v2 00/11] cgroup: don't hold cgroup_mutex for cgroup.kill and cgroup.freeze Andrew Morton
2026-12-01 18:15 ` Shakeel Butt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aw8OQ2CWiv42U0El@linux.dev \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=brauner@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=oleg@redhat.com \
--cc=roman.gushchin@linux.dev \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=tjmercier@google.com \
--cc=usama.arif@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox