Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Keep bypass on between enable failure and scx_disable_workfn()

scx_enable() turns on the bypass mode while enable is in progress. If
enabling fails, it turns off the bypass mode and then triggers scx_error().
scx_error() will trigger scx_disable_workfn() which will turn on the bypass
mode again and unload the failed scheduler.

This moves the system out of bypass mode between the enable error path and
the disable path, which is unnecessary and can be brittle - e.g. the thread
running scx_enable() may already be on the failed scheduler and can be
switched out before it triggers scx_error() leading to a stall. The watchdog
would eventually kick in, so the situation isn't critical but is still
suboptimal.

There is nothing to be gained by turning off the bypass mode between
scx_enable() failure and scx_disable_workfn(). Keep bypass on.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Andrea Righi <arighi@nvidia.com>

Tejun Heo 4a1d9d73 b7975c48

+1 -1
+1 -1
kernel/sched/ext.c
··· 5794 5794 err_disable_unlock_all: 5795 5795 scx_cgroup_unlock(); 5796 5796 percpu_up_write(&scx_fork_rwsem); 5797 - scx_bypass(false); 5797 + /* we'll soon enter disable path, keep bypass on */ 5798 5798 err_disable: 5799 5799 mutex_unlock(&scx_enable_mutex); 5800 5800 /*