For built with PREEMPT_RT kernels, the scx_disable_irq_workfn() is called from per-cpu irq_work kthreads context, this means that when call the scx_dump_state() in the scx_disable_irq_workfn() to output current->comm/pid, it always output current irq_work kthread's comm/pid. this commit therefore use the IRQ_WORK_INIT_HARD() to initialize sch->disable_irq_work to make scx_disable_irq_workfn() is called from hardirq context.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -6589,7 +6589,7 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops, · 6588 unmodified lines | |||
| 6589 | 6589 | ||
| 6590 | sch->slice_dfl = SCX_SLICE_DFL; | 6590 | sch->slice_dfl = SCX_SLICE_DFL; |
| 6591 | atomic_set(&sch->exit_kind, SCX_EXIT_NONE); | 6591 | atomic_set(&sch->exit_kind, SCX_EXIT_NONE); |
| 6592 | init_irq_work(&sch->disable_irq_work, scx_disable_irq_workfn); | 6592 | sch->disable_irq_work = IRQ_WORK_INIT_HARD(scx_disable_irq_workfn); |
| 6593 | kthread_init_work(&sch->disable_work, scx_disable_workfn); | 6593 | kthread_init_work(&sch->disable_work, scx_disable_workfn); |
| 6594 | timer_setup(&sch->bypass_lb_timer, scx_bypass_lb_timerfn, 0); | 6594 | timer_setup(&sch->bypass_lb_timer, scx_bypass_lb_timerfn, 0); |
| 6595 | 6595 | ||