Re: [PATCH] Prevent nested interrupts when the IRQ stack is nearoverflowing v2

From: Ingo Molnar
Date: Thu Mar 25 2010 - 15:02:21 EST



* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> On Thu, 2010-03-25 at 19:21 +0100, Peter Zijlstra wrote:
> > On Thu, 2010-03-25 at 11:01 -0700, Linus Torvalds wrote:
> > > Are there any cases around
> > > that still have busy-loop delays based on real-time in their irq handlers?
> > > I simply don't know.
> >
> > I recently found a few in drivers/net/ there's all kinds of funny stuff
> > in there.. not sure how common the matching hardware is though.
> >
> > One thing we could do is instrument jiffies to yell when its used from
> > hardirq context and fix up these things.
>
> Also, Arjan mentioned he wanted to sweep the kernel for jiffies users and
> convert them to timer interfaces..

Dynticks found most of the loop-for-jiffies-in-handlers cruft: an IRQ handler
hitting the idle loop and then spinning for jiffies, with dynticks enabled,
would spin forver because there's no timer irq.

That is because in dynticks mode we dont reactivate the tick when we go into
an irq handler (that has hit the idle task). So any looping on jiffies will
loop forever. We only reactivate the tick when we go out of idle.

We had a few bugs of that kind in the early days of dynticks - they were not
particularly numerous and all were fixed.

Thanks,

Ingo
--
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/