]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched_ext: Fix scx_kick_pseqs corruption on concurrent scheduler loads
authorAndrea Righi <arighi@nvidia.com>
Mon, 13 Oct 2025 20:36:34 +0000 (22:36 +0200)
committerTejun Heo <tj@kernel.org>
Tue, 14 Oct 2025 20:29:17 +0000 (10:29 -1000)
commit05e63305c85c88141500f0a2fb02afcfba9396e1
treefc206e537b2672c403e51ec132c271dda17c7af9
parent14c1da3895a116f4e32c20487046655f26d3999b
sched_ext: Fix scx_kick_pseqs corruption on concurrent scheduler loads

If we load a BPF scheduler while another scheduler is already running,
alloc_kick_pseqs() would be called again, overwriting the previously
allocated arrays.

Fix by moving the alloc_kick_pseqs() call after the scx_enable_state()
check, ensuring that the arrays are only allocated when a scheduler can
actually be loaded.

Fixes: 14c1da3895a11 ("sched_ext: Allocate scx_kick_cpus_pnt_seqs lazily using kvzalloc()")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c