sched_ext: Sync error_irq_work before freeing scx_sched
Subsystems (2)
Tejun Heo
reviewerPATCH 1/1 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.
--- kernel/sched/ext.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/sched/ext.c +2 -0
@@ -3471,7 +3471,9 @@ static void scx_sched_free_rcu_work(struct rcu_work *rwork)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 )
--
2.48.0
Quoted 6 lines · Tejun Heo
By the time
scx_sched_free_rcu_work()runs, thescx_schedis no longer reachable. However, a previously queuederror_irq_workmay still be pending or running. Ensure it completes before proceeding with teardown.Fixes bff3b5aec1b7 ("sched_ext: Move disable machinery into scx_sched")Signed-off-by Tejun Heo <[email protected]>
Good catch.
Thanks,
-Andrea
Quoted 20 lines
--- kernel/sched/ext.c | 2 ++ 1 file changed, 2 insertions(+)kernel/sched/ext.c +2
-1@@ -3471,7 +3471,9 @@ static void scx_sched_free_rcu_work(struct rcu_work *rwork)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 ) --2.48.0
Quoted 6 lines · Tejun Heo
By the time
scx_sched_free_rcu_work()runs, thescx_schedis no longer reachable. However, a previously queuederror_irq_workmay still be pending or running. Ensure it completes before proceeding with teardown.Fixes bff3b5aec1b7 ("sched_ext: Move disable machinery into scx_sched")Signed-off-by Tejun Heo <[email protected]>
Applied to sched_ext/for-6.18-fixes.
Thanks.
Signature · 1 line
tejun