summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2025-09-03 11:33:28 -1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-02 22:18:03 +0900
commit09a75f371298a7142ad2eb0af04a571d4cf57e50 (patch)
tree42355f70e4760f7baddbe55377afd72e6fed81c5
parentb7d86707660cf8220fb4f3292477ae3a8ef2297e (diff)
downloadlinux-09a75f371298a7142ad2eb0af04a571d4cf57e50.tar.gz
linux-09a75f371298a7142ad2eb0af04a571d4cf57e50.tar.bz2
linux-09a75f371298a7142ad2eb0af04a571d4cf57e50.zip
sched_ext: Keep bypass on between enable failure and scx_disable_workfn()
[ Upstream commit 4a1d9d73aabc8f97f48c4f84f936de3b265ffd6f ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--kernel/sched/ext.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index f89894476e51..14724dae0b79 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -4763,7 +4763,7 @@ err_unlock:
err_disable_unlock_all:
scx_cgroup_unlock();
percpu_up_write(&scx_fork_rwsem);
- scx_bypass(false);
+ /* we'll soon enter disable path, keep bypass on */
err_disable:
mutex_unlock(&scx_enable_mutex);
/*