Commit cceb874
committed
sched_ext: Defer sub_kset base put to scx_sched_free_rcu_work
scx_sub_enable_workfn() pins parent->kobj before dropping scx_sched_lock,
but that does not pin parent->sub_kset. Concurrent disable can
kset_unregister and free sub_kset before scx_alloc_and_add_sched()
dereferences it.
Split sub_kset teardown: kobject_del() at disable keeps sysfs removal; defer
kobject_put() to scx_sched_free_rcu_work so the memory survives. A racing
child sees state_in_sysfs=0 with valid memory, sysfs_create_dir() fails, and
the existing exit_kind gate in scx_link_sched() turns it away with -ENOENT.
Fixes: 411d3ef ("sched_ext: Unregister sub_kset on scheduler disable")
Signed-off-by: Tejun Heo <tj@kernel.org>1 parent b273b75 commit cceb874
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4821 | 4821 | | |
4822 | 4822 | | |
4823 | 4823 | | |
| 4824 | + | |
| 4825 | + | |
4824 | 4826 | | |
4825 | 4827 | | |
4826 | 4828 | | |
| |||
5861 | 5863 | | |
5862 | 5864 | | |
5863 | 5865 | | |
5864 | | - | |
| 5866 | + | |
5865 | 5867 | | |
5866 | 5868 | | |
5867 | 5869 | | |
| |||
5995 | 5997 | | |
5996 | 5998 | | |
5997 | 5999 | | |
5998 | | - | |
| 6000 | + | |
5999 | 6001 | | |
6000 | 6002 | | |
6001 | 6003 | | |
| |||
0 commit comments