Commit efeeaac9 authored by Tejun Heo's avatar Tejun Heo
Browse files

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: bff3b5ae ("sched_ext: Move disable machinery into scx_sched")
Acked-by: default avatarAndrea Righi <arighi@nvidia.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 54e96258
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)