diff options
| author | Tejun Heo <[email protected]> | 2024-09-27 20:02:40 +0000 |
|---|---|---|
| committer | Tejun Heo <[email protected]> | 2024-09-27 20:02:40 +0000 |
| commit | 160216568cddc9d6e7f36133ba41d25459d90de4 (patch) | |
| tree | 06422edf2450cfdaf6654ad61b0bcb3060d31cc8 /rust/helpers/mutex.c | |
| parent | sched_ext: Add scx_cgroup_enabled to gate cgroup operations and fix scx_tg_on... (diff) | |
| download | kernel-160216568cddc9d6e7f36133ba41d25459d90de4.tar.gz kernel-160216568cddc9d6e7f36133ba41d25459d90de4.zip | |
sched_ext: Decouple locks in scx_ops_disable_workfn()
The disable path uses three big locks - scx_fork_rwsem, scx_cgroup_rwsem and
cpus_read_lock. Currently, the locks are grabbed together which is prone to
locking order problems. With the preceding scx_cgroup_enabled change, we can
decouple them:
- As cgroup disabling no longer requires modifying a static_key which
requires cpus_read_lock(), no need to grab cpus_read_lock() before
grabbing scx_cgroup_rwsem.
- cgroup can now be independently disabled before tasks are moved back to
the fair class.
Relocate scx_cgroup_exit() invocation before scx_fork_rwsem is grabbed, drop
now unnecessary cpus_read_lock() and move static_key operations out of
scx_fork_rwsem. This decouples all three locks in the disable path.
Signed-off-by: Tejun Heo <[email protected]>
Reported-and-tested-by: Aboorva Devarajan <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'rust/helpers/mutex.c')
0 files changed, 0 insertions, 0 deletions
