Linux cgroups development
 help / color / mirror / Atom feed
* [PATCHSET cgroup/for-7.4] cgroup: Make the offline drain interruptible
@ 2026-09-02 23:03 Tejun Heo
  2026-09-02 23:03 ` [PATCH 1/3] cgroup: Return -ENODEV consistently for a dead cgroup Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tejun Heo @ 2026-09-02 23:03 UTC (permalink / raw)
  To: Johannes Weiner, Michal Koutny
  Cc: cgroups, linux-kernel, syzbot+bb2e19a1190a556c01b1, Tao Yu,
	Tejun Heo

Hello,

syzbot has been reporting "task hung in cgroup_subtree_control_write".

The underlying problem is an indefinite wait in a place where indefinite
waits should not happen. A task past exit_signals() can block in its exit
path for as long as, say, a FUSE daemon takes to answer a flush.

That wait is interruptible in name only. Once a thread group is exiting,
prepare_signal() drops every signal sent to it, so nothing can wake the
task. It still shows as TASK_INTERRUPTIBLE, and the hung task detector only
looks at TASK_UNINTERRUPTIBLE, so the stuck task never appears in any
report.

Since 1dffd95575eb ("cgroup: Defer kill_css_finish() in
cgroup_apply_control_disable()"), a disabled css offlines only after every
such task pinning it has exited, and the re-enable path waits for that
offline in TASK_UNINTERRUPTIBLE. The writer inherits the unkillable wait,
sits in D state, and is the only thing the hung task report shows.

This patchset makes the drain interruptible so that the writer can be
killed. The wait in the exit path remains a separate problem.

Tao Yu posted a patch that rejects the re-enable with -EBUSY while csses are
dying:

 https://lore.kernel.org/all/20260901012342.855056-1-tao1.yu@intel.com/

That fails re-enables that would have succeeded and keys off a counter that
also covers removed cgroups and offlined-but-pinned csses, so this takes the
interruptible wait instead.

 0001-cgroup-Return-ENODEV-consistently-for-a-dead-cgroup.patch
 0002-cgroup-Return-ERR_PTR-from-cgroup_kn_lock_live.patch
 0003-cgroup-Make-the-offline-drain-interruptible.patch

0001 unifies the errno the interface file writers return for a removed
cgroup. 0002 makes cgroup_kn_lock_live() return ERR_PTR so that it can
report the interrupted drain. 0003 is the actual change.

This is against v7.3-rc1 (cee9395acd80) and also available in the following
git branch:

 https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git cgroup-drain-interruptible

diffstat follows.

 kernel/cgroup/cgroup-internal.h |  2 +-
 kernel/cgroup/cgroup-v1.c       | 16 ++++---
 kernel/cgroup/cgroup.c          | 98 ++++++++++++++++++++++++-----------------
 kernel/cgroup/debug.c           | 10 ++---
 4 files changed, 74 insertions(+), 52 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-02 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 23:03 [PATCHSET cgroup/for-7.4] cgroup: Make the offline drain interruptible Tejun Heo
2026-09-02 23:03 ` [PATCH 1/3] cgroup: Return -ENODEV consistently for a dead cgroup Tejun Heo
2026-09-02 23:03 ` [PATCH 2/3] cgroup: Return ERR_PTR from cgroup_kn_lock_live() Tejun Heo
2026-09-02 23:03 ` [PATCH 3/3] cgroup: Make the offline drain interruptible Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox