aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/ext.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2025-10-09 13:56:23 -1000
committerTejun Heo <tj@kernel.org>2025-10-13 08:25:55 -1000
commitefeeaac9ae9763f9c953e69633c86bc3031e39b5 (patch)
tree629c016e78edb8ce691147d24b481418a069c2f5 /kernel/sched/ext.c
parentsched_ext: Mark scx_bpf_dsq_move_set_[slice|vtime]() with KF_RCU (diff)
downloadlinux-efeeaac9ae9763f9c953e69633c86bc3031e39b5.tar.gz
linux-efeeaac9ae9763f9c953e69633c86bc3031e39b5.zip
sched_ext: Sync error_irq_work before freeing scx_sched
By the time scx_sched_free_rcu_work() runs, the scx_sched is no longer reachable. However, a previously queued error_irq_work may still be pending or running. Ensure it completes before proceeding with teardown. Fixes: bff3b5aec1b7 ("sched_ext: Move disable machinery into scx_sched") Acked-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/sched/ext.c')
-rw-r--r--kernel/sched/ext.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index fc353b8d69f7..a79dfd0f743a 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3471,7 +3471,9 @@ static void scx_sched_free_rcu_work(struct work_struct *work)
struct scx_dispatch_q *dsq;
int node;
+ irq_work_sync(&sch->error_irq_work);
kthread_stop(sch->helper->task);
+
free_percpu(sch->pcpu);
for_each_node_state(node, N_POSSIBLE)