From: Martin Pitt <martin@piware.de>
To: Tejun Heo <tj@kernel.org>
Cc: regressions@lists.linux.dev, cgroups@vger.kernel.org,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"David Vernet" <void@manifault.com>,
"Andrea Righi" <arighi@nvidia.com>,
"Changwoo Min" <changwoo@igalia.com>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 cgroup/for-7.1-fixes sched_ext/for-7.1-fixes] cgroup: Defer css percpu_ref kill on rmdir until cgroup is depopulated
Date: Sun, 3 May 2026 15:53:44 +0200 [thread overview]
Message-ID: <afdTaEBPqzYGnO4n@piware.de> (raw)
In-Reply-To: <ad3b4597f3df81914b871618535370db@kernel.org>
Hello Tejun and all,
Tejun Heo [2026-05-01 8:31 -1000]:
> A chain of commits going back to v7.0 reworked rmdir to satisfy the
> controller invariant that a subsystem's ->css_offline() must not run while
> tasks are still doing kernel-side work in the cgroup.
> [..]
> v2: Pin cgrp across the deferred destroy work with explicit
> cgroup_get()/cgroup_put() around queue_work() and the work_fn. v1
> wasn't actually broken (ordered cgroup_offline_wq + queue_work order
> in cgroup_task_dead() saved it) but the explicit ref removes the
> dependency on those non-obvious invariants. Also note the
> pre-existing cgroup_apply_control_disable() race in the description;
> a follow-up will defer kill_css_finish() there.
>
> Fixes: 1b164b876c36 ("cgroup: Wait for dying tasks to leave on rmdir")
Tested-by: Martin Pitt <martin@piware.de>
> Could you give v2 a try? Same defer-the-percpu_ref-kill mechanism as
> v1, with an explicit cgroup_get/put around the deferred work to make
> the lifetime invariant obvious (Sashiko bot review on v1; v1 wasn't
> broken but the explicit ref removes a dependency on non-obvious
> ordering). Fix should behave identically to v1 for your reproducer.
Sorry for the delay, I haven't built a kernel in a decade and not ever for
Fedora.
I applied the patch to the Rawhide 7.1.0-0.rc1 kernel, it applies cleanly
there. (I first tried on top of 6.9.14, but there are conflicts.)
https://copr.fedorainfracloud.org/coprs/martinpitt/test-fixes/build/10419932/
Usage on Fedora 44:
dnf copr enable martinpitt/test-fixes
dnf update kernel-core kernel-modules-internal
(This assumes a cloud VM. If you use the full kernel, update the "kernel"
package as well).
I ran the cockpit-podman test that originally triggered the bug, as well as my
reduced variant, against that patched kernel for 50 rounds each, and it has
consistently succeeded.
So this works great, thanks a lot!
Martin
next prev parent reply other threads:[~2026-05-03 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 18:31 [PATCH v2 cgroup/for-7.1-fixes sched_ext/for-7.1-fixes] cgroup: Defer css percpu_ref kill on rmdir until cgroup is depopulated Tejun Heo
2026-05-03 13:53 ` Martin Pitt [this message]
2026-05-04 7:28 ` Sebastian Andrzej Siewior
2026-05-04 18:54 ` Tejun Heo
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=afdTaEBPqzYGnO4n@piware.de \
--to=martin@piware.de \
--cc=arighi@nvidia.com \
--cc=bigeasy@linutronix.de \
--cc=cgroups@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=emil@etsalapatis.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=regressions@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/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