[PATCH 3/3] sched_ext: Use WARN_ON_ONCE to check whether scx_kick_syncs is NULL
From: Zhao Mengmeng
Date: Wed Apr 08 2026 - 23:24:18 EST
From: Zhao Mengmeng <zhaomengmeng@xxxxxxxxxx>
Since we already add checks in scx_kick_cpu() to prevent the race,
replace pr_warn_once with WARN_ON_ONCE to capture future race conditions.
Signed-off-by: Zhao Mengmeng <zhaomengmeng@xxxxxxxxxx>
---
kernel/sched/ext.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 0a2a3c6dc7cc..cc03924842e1 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -7702,10 +7702,8 @@ static void kick_cpus_irq_workfn(struct irq_work *irq_work)
unsigned long *ksyncs;
s32 cpu;
- if (unlikely(!ksyncs_pcpu)) {
- pr_warn_once("kick_cpus_irq_workfn() called with NULL scx_kick_syncs");
+ if (WARN_ON_ONCE(!ksyncs_pcpu))
return;
- }
ksyncs = rcu_dereference_bh(ksyncs_pcpu)->syncs;
--
2.43.0