Re: [RFC] Strange code in cpu_idle()

From: Zwane Mwaikambo
Date: Mon Dec 06 2004 - 09:41:55 EST


On Mon, 6 Dec 2004, Dipankar Sarma wrote:

> > > So I would say that the rcu_read_lock() in cpu_idle() is having no
> > > effect, because any timer interrupt from cpu_idle() will mark a
> > > quiescent state notwithstanding. What am I missing here?
> >
> > What about the hardirq_count check since we're coming in from the timer
> > interrupt?
>
> Look at the hardirq_count check closely - it only checks for reentrant
> hardirqs. If the idle task gets interrupted by a timer interrupt,
> the RCU quiscent state counter for the cpu will get incremented.
> So, rcu_read_lock() in cpu_idle() is bogus.

Ah crafty, the only reason it 'works' right now then is because we exit
the pm_idle callback shortly after processing the timer interrupt which
marks the processor as quiescent.

Thanks for pointing that out,

Zwane

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/