public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/for-next v3 0/3] cgroup/cpuset: Fix partition related locking issues
@ 2026-02-02 20:11 Waiman Long
  2026-02-02 20:11 ` [PATCH/for-next v3 1/3] cgroup/cpuset: Clarify exclusion rules for cpuset internal variables Waiman Long
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Waiman Long @ 2026-02-02 20:11 UTC (permalink / raw)
  To: Chen Ridong, Tejun Heo, Johannes Weiner, Michal Koutný,
	Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
	Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
	Shuah Khan
  Cc: cgroups, linux-kernel, linux-kselftest, Waiman Long

 v3:
  - Add a new patch to clarify the locking rules for internal variables
  - Defer all housekeeping_update() calls with associated
    rebuild_sched_domains*() calls to either workqueue or task_work.

 v2:
  - Change patch 1 to use workqueue instead of task run as it is a
    per-cpu kthread that performs the cpuset shutdown and bringup work.
  - Simplify and streamline some of the code.

After booting the latest cgroup for-next debug kernel with the latest
cgroup changes as well as Federic's "cpuset/isolation: Honour kthreads
preferred affinity" patch series [1] merged on top and running the
test-cpuset-prs.sh test, a circular locking dependency lockdep splat
was reported. See patch 2 for details.

To fix this issue, a new top level cpuset_top_mutex is added and the
call to housekeeping_update() is deferred to either a task_work or to
a workqueue.

With these changes in place, the cpuset test ran to completion with no
failure and no lockdep splat.

[1] https://lore.kernel.org/lkml/20260125224541.50226-1-frederic@kernel.org/

Waiman Long (3):
  cgroup/cpuset: Clarify exclusion rules for cpuset internal variables
  cgroup/cpuset: Defer housekeeping_update() calls from CPU hotplug to
    workqueue
  cgroup/cpuset: Call housekeeping_update() without holding
    cpus_read_lock

 kernel/cgroup/cpuset.c                        | 211 ++++++++++++++----
 kernel/sched/isolation.c                      |   4 +-
 kernel/time/timer_migration.c                 |   3 +-
 .../selftests/cgroup/test_cpuset_prs.sh       |  13 +-
 4 files changed, 174 insertions(+), 57 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2026-02-04  4:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02 20:11 [PATCH/for-next v3 0/3] cgroup/cpuset: Fix partition related locking issues Waiman Long
2026-02-02 20:11 ` [PATCH/for-next v3 1/3] cgroup/cpuset: Clarify exclusion rules for cpuset internal variables Waiman Long
2026-02-02 20:11 ` [PATCH/for-next v3 2/3] cgroup/cpuset: Defer housekeeping_update() calls from CPU hotplug to workqueue Waiman Long
2026-02-02 20:18   ` Peter Zijlstra
2026-02-02 20:32     ` Waiman Long
2026-02-02 20:48       ` Peter Zijlstra
2026-02-03  0:55         ` Waiman Long
2026-02-04  3:27   ` Chen Ridong
2026-02-04  4:51     ` Waiman Long
2026-02-02 20:11 ` [PATCH/for-next v3 3/3] cgroup/cpuset: Call housekeeping_update() without holding cpus_read_lock Waiman Long
2026-02-04  2:44   ` Chen Ridong
2026-02-04  4:48     ` Waiman Long
2026-02-04  2:51   ` Chen Ridong
2026-02-04  4:47     ` Waiman Long

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