[RFC PATCH 04/12] entry: Skip inactive IRQ-return reschedule calls
Karl Mehltretter
kmehltretter at gmail.com
Wed Oct 21 22:16:46 PDT 2026
irqentry_exit_to_kernel_mode_preempt() calls the dynamic reschedule helper
when preemption is enabled even if the preempt count is nonzero. The helper
returns immediately, but its call and return remain traceable after hardirq
context has been removed.
Check the preempt count in the inline caller and avoid the inactive call.
Keep the existing check in the helper for its other callers. This does not
change whether IRQ return schedules.
Assisted-by: LLM
---
include/linux/irq-entry-common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/irq-entry-common.h b/include/linux/irq-entry-common.h
index 3ee80e926a17a..24c2b9fdff4f4 100644
--- a/include/linux/irq-entry-common.h
+++ b/include/linux/irq-entry-common.h
@@ -487,7 +487,7 @@ static inline void irqentry_exit_to_kernel_mode_preempt(struct pt_regs *regs,
if (regs_irqs_disabled(regs) || state.exit_rcu)
return;
- if (IS_ENABLED(CONFIG_PREEMPTION))
+ if (IS_ENABLED(CONFIG_PREEMPTION) && !preempt_count())
irqentry_exit_cond_resched();
}
--
2.39.5 (Apple Git-154)
More information about the linux-arm-kernel
mailing list