public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/6] cgroup/cpuset: Fix partition related locking issues
@ 2026-02-12 16:46 Waiman Long
  2026-02-12 16:46 ` [PATCH v5 1/6] cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del() Waiman Long
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Waiman Long @ 2026-02-12 16:46 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

 v5:
  - Reapply on top of the latest upstream linux tree.
  - Add a new fix patch for a cpuset bug found during testing.
  - Add a patch to not update isolated_cpus when calling from CPU
    hotplug. As a result, CPU hotplug won't need to call
    housekeeping_update() at all and the corresponding wq deferral
    patch is dropped.

 v4:
  - https://lore.kernel.org/lkml/20260206203712.1989610-1-longman@redhat.com/

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 5 for details.

To fix this issue, the cpuset code is modified to not doing any
update to isolated_cpus when calling from CPU hotplug. In addition,
the housekeeping_update() call, when needed, is deferred to task_work
so that it can be called without holding a cpus_read_lock. A new top
level cpuset_top_mutex is also added to have more exclusion control.

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 (6):
  cgroup/cpuset: Fix incorrect change to effective_xcpus in
    partition_xcpus_del()
  cgroup/cpuset: Clarify exclusion rules for cpuset internal variables
  cgroup/cpuset: Set isolated_cpus_updating only if isolated_cpus is
    changed
  cgroup/cpuset: Don't update isolated_cpus from CPU hotplug
  cgroup/cpuset: Call housekeeping_update() without holding
    cpus_read_lock
  cgroup/cpuset: Eliminate some duplicated rebuild_sched_domains() calls

 kernel/cgroup/cpuset.c                        | 313 ++++++++++++++----
 kernel/sched/isolation.c                      |   4 +-
 kernel/time/timer_migration.c                 |   4 +-
 .../selftests/cgroup/test_cpuset_prs.sh       |  21 +-
 4 files changed, 259 insertions(+), 83 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2026-02-21 19:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 16:46 [PATCH v5 0/6] cgroup/cpuset: Fix partition related locking issues Waiman Long
2026-02-12 16:46 ` [PATCH v5 1/6] cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del() Waiman Long
2026-02-13  0:52   ` Chen Ridong
2026-02-12 16:46 ` [PATCH v5 2/6] cgroup/cpuset: Clarify exclusion rules for cpuset internal variables Waiman Long
2026-02-13  1:35   ` Chen Ridong
2026-02-12 16:46 ` [PATCH v5 3/6] cgroup/cpuset: Set isolated_cpus_updating only if isolated_cpus is changed Waiman Long
2026-02-13  2:06   ` Chen Ridong
2026-02-12 16:46 ` [PATCH v5 4/6] cgroup/cpuset: Don't update isolated_cpus from CPU hotplug Waiman Long
2026-02-13  3:28   ` Chen Ridong
2026-02-13 15:28     ` Waiman Long
2026-02-13  6:56   ` Chen Ridong
2026-02-21 19:18     ` Waiman Long
2026-02-12 16:46 ` [PATCH v5 5/6] cgroup/cpuset: Call housekeeping_update() without holding cpus_read_lock Waiman Long
2026-02-13  7:47   ` Chen Ridong
2026-02-21 19:20     ` Waiman Long
2026-02-12 16:46 ` [PATCH v5 6/6] cgroup/cpuset: Eliminate some duplicated rebuild_sched_domains() calls Waiman Long

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