Commit 1602165
committed
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]1 parent 568894e commit 1602165
1 file changed
+17
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4456 | 4456 | | |
4457 | 4457 | | |
4458 | 4458 | | |
4459 | | - | |
4460 | | - | |
| 4459 | + | |
| 4460 | + | |
4461 | 4461 | | |
4462 | | - | |
4463 | | - | |
4464 | 4462 | | |
| 4463 | + | |
| 4464 | + | |
4465 | 4465 | | |
4466 | | - | |
4467 | | - | |
4468 | | - | |
4469 | | - | |
4470 | 4466 | | |
4471 | 4467 | | |
4472 | 4468 | | |
4473 | 4469 | | |
| 4470 | + | |
| 4471 | + | |
| 4472 | + | |
| 4473 | + | |
| 4474 | + | |
| 4475 | + | |
4474 | 4476 | | |
4475 | 4477 | | |
4476 | 4478 | | |
| |||
4488 | 4490 | | |
4489 | 4491 | | |
4490 | 4492 | | |
| 4493 | + | |
4491 | 4494 | | |
4492 | 4495 | | |
4493 | | - | |
| 4496 | + | |
4494 | 4497 | | |
4495 | | - | |
4496 | | - | |
4497 | | - | |
4498 | | - | |
4499 | | - | |
| 4498 | + | |
| 4499 | + | |
| 4500 | + | |
| 4501 | + | |
| 4502 | + | |
4500 | 4503 | | |
4501 | 4504 | | |
4502 | | - | |
4503 | | - | |
4504 | | - | |
4505 | | - | |
4506 | | - | |
4507 | | - | |
4508 | 4505 | | |
4509 | 4506 | | |
4510 | 4507 | | |
| |||
0 commit comments