diff options
author | Tejun Heo <tj@kernel.org> | 2024-09-27 10:02:40 -1000 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2024-09-27 10:02:40 -1000 |
commit | 160216568cddc9d6e7f36133ba41d25459d90de4 (patch) | |
tree | 06422edf2450cfdaf6654ad61b0bcb3060d31cc8 /kernel/uid16.c | |
parent | 568894edbe48f0878f787ed533dc9dbfd09c0fbe (diff) |
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 <tj@kernel.org>
Reported-and-tested-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Link: http://lkml.kernel.org/r/8cd0ec0c4c7c1bc0119e61fbef0bee9d5e24022d.camel@linux.ibm.com
Diffstat (limited to 'kernel/uid16.c')
0 files changed, 0 insertions, 0 deletions