Skip to contentSkip to conversation

linsched: add check on invoke "tick_nohz_irq_exit" in "irq_exit"

RFC PATCH In review Michael Wang 1 participant 1 message Apr 16, 2012

lore
Share & tools
lore
#0 lore raw

RFC PATCH 2/4 linsched: add check on invoke "tick_nohz_irq_exit" in "irq_exit"

From: Michael Wang <[email protected]>

"tick_nohz_irq_exit" will make sure the tick timer reprogram correctly after cpu enter idle.

With out this check, after the interrupt, tick timer will be enabled even cpu is still in idle, this will cause inaccuracy if cpu do load balance in next tick.

---
 arch/linsched/kernel/irq.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/linsched/kernel/irq.c +4 -0
index a800bbd..d5d16e5 100644
@@ -1,6 +1,7 @@
 #include <linux/interrupt.h>
 #include <asm/hardirq.h>
 #include <linux/sched.h>
+#include <linux/tick.h>
 
 unsigned long linsched_irq_flags = ARCH_IRQ_ENABLED;
 
@@ -81,6 +82,9 @@ void irq_exit(void)
 	sub_preempt_count(IRQ_EXIT_OFFSET);
 	if (!in_interrupt() && local_softirq_pending())
 		do_softirq();
+
+	if (idle_cpu(smp_processor_id()) && !in_interrupt() && !need_resched())
+		tick_nohz_irq_exit();
 }
 
 void local_bh_enable_ip(unsigned long ip)
Signature · 1 line
1.7.1