On Mon, Sep 01, 2008 at 11:38:29AM +0200, Andi Kleen wrote:
So that I lose the #else above, and so that irq_enter() and irq_exit()
look something like the following (with additional adjustments to suit)?
Makes a lot of sense to me...
And it has the very nice side effect of allowing me to have a separate
rcu_irq_enter() and rcu_nmi_enter(), trivializing the RCU-dynticks
interface!!! Very cool, thank you very much!!!
Thanx, Paul
void irq_enter(void)
{
#ifdef CONFIG_NO_HZ
int cpu = smp_processor_id();
if (idle_cpu(cpu) && !in_interrupt())
tick_nohz_stop_idle(cpu);
#endif
__irq_enter();
#ifdef CONFIG_NO_HZ
if (idle_cpu(cpu)) {
rcu_irq_enter();
tick_nohz_update_jiffies();
}
#endif
}
void irq_exit(void)
{
account_system_vtime(current);
trace_hardirq_exit();
sub_preempt_count(IRQ_EXIT_OFFSET);
if (!in_interrupt() && local_softirq_pending())
invoke_softirq();
#ifdef CONFIG_NO_HZ
/* Make sure that timer wheel updates are propagated */
if (idle_cpu(smp_processor_id())) {
if (!in_interrupt() && !need_resched())
tick_nohz_stop_sched_tick(0);
rcu_irq_exit();
}
#endif
preempt_enable_no_resched();
}
--