Re: [PATCH 1/5] irq_work: Let arch tell us if it can raise irq work

Peter Zijlstra
2014-05-13T20:48:18Z

On Tue, May 13, 2014 at 09:33:29PM +0200, Frederic Weisbecker wrote:
> On Tue, May 13, 2014 at 07:09:42PM +0200, Peter Zijlstra wrote:
> > On Tue, May 13, 2014 at 04:38:37PM +0200, Frederic Weisbecker wrote:
> > > We prepare for executing the full nohz kick through an irq work. But
> > > if we do this as is, we'll run into conflicting tick locking: the tick
> > > holds the hrtimer lock and the nohz kick may do so too.
> >
> > It does? How does the tick end up holding that lock?
> >
> > Normal hrtimer callbacks run without holding the hrtimer lock -- I made
> > it so.
> >
> > This means tick_sched_timer() is called without hrtimer lock, and I
> > don't see it taking it anywhere in tick_sched_do_timer() or
> > tick_sched_handle().
>
> Check hrtimer_interrupt(), it takes the per cpu base->lock.

check __run_hrtimer() which drops base->lock over calling ->function.