The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] sched_ext: Use IRQ_WORK_INIT_HARD() to initialize sch->disable_irq_work
@ 2026-05-08 11:50 Zqiang
  2026-05-08 15:14 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Zqiang @ 2026-05-08 11:50 UTC (permalink / raw)
  To: tj, void, arighi, changwoo, yphbchou0911
  Cc: sched-ext, linux-kernel, qiang.zhang

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.

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
---
 kernel/sched/ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index d5be34e7b8ae..ef4e8e6addd1 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -6770,7 +6770,7 @@ static struct scx_sched *scx_alloc_and_add_sched(struct scx_enable_cmd *cmd,
 
 	sch->slice_dfl = SCX_SLICE_DFL;
 	atomic_set(&sch->exit_kind, SCX_EXIT_NONE);
-	init_irq_work(&sch->disable_irq_work, scx_disable_irq_workfn);
+	sch->disable_irq_work = IRQ_WORK_INIT_HARD(scx_disable_irq_workfn);
 	kthread_init_work(&sch->disable_work, scx_disable_workfn);
 	timer_setup(&sch->bypass_lb_timer, scx_bypass_lb_timerfn, 0);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sched_ext: Use IRQ_WORK_INIT_HARD() to initialize sch->disable_irq_work
  2026-05-08 11:50 [PATCH] sched_ext: Use IRQ_WORK_INIT_HARD() to initialize sch->disable_irq_work Zqiang
@ 2026-05-08 15:14 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-05-08 15:14 UTC (permalink / raw)
  To: Zqiang; +Cc: void, arighi, changwoo, yphbchou0911, sched-ext, linux-kernel

Hello,

Applied to sched_ext/for-7.1-fixes with the following Fixes: tag added:

  Fixes: f4a6c506d118 ("sched_ext: Always bounce scx_disable() through irq_work")

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-08 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 11:50 [PATCH] sched_ext: Use IRQ_WORK_INIT_HARD() to initialize sch->disable_irq_work Zqiang
2026-05-08 15:14 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox