Re: 2.6.16-mm1

From: Andi Kleen
Date: Thu Mar 23 2006 - 22:45:28 EST


> The above patch records the most-recent caller of local_irq_disable() in a
> global variable, then prints that out in the lost-ticks handler. But how
> do we know that the global didn't get overwritten between the most-recent
> local_irq_enable() and the call to handle_lost_ticks()?

Because the overdue timer interrupt will trigger one instruction later.

>
> I guess the code assumes that the local_irq_enable() will result in
> insta-entry into the timer IRQ handler. Which is probably good enough, as
> interrupts from other sources won't be pending most times.

Yes. Actually irq 0 has higher priority than most interrupts,
but not all.


>
> So why did we lose three ticks after __do_sortirq()'s local_irq_disable()?
> Dunno.

It's a mistery. I put the patches in to trace a pattern.

But you're right they should at least be using per cpu variables
instead of globals which can be corrupted by other CPUs.

> (Is there any point in do_softirq() doing local_irq_save() instead of
> local_irq_disable()? __do_softirq() will unconditionally enable anyway..)

The interrupt handling in there is quite messy and has some other
wards too. Could probably take a good cleanup. Problem is that
it will need a lot of editing of architectures to do properly.

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