Re: [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups.

Ingo Molnar
2002-07-21T23:48:56Z

On Sun, 21 Jul 2002, george anzinger wrote:

> > > - to remove the preemption count increase/decrease code from the lowlevel
> > > IRQ assembly code.
>
> IMHO this is unwise as the system NEEDS to exit to user (or
> system) space when preempt_count is zero with a garuntee
> that TIF_NEED_RESCHED is 0. [...]

my comment was too compact - the bumping of the preemption count did not
get removed, it's just the dualness that got removed. Both the lowlevel
entry code and the irq_enter() code used to do the same thing - now only
irq_enter() does it.

in the latest patch irq_enter() is done early in do_IRQ(), and irq_exit()
is done before returning from do_IRQ().

> [...] To do this from irq.c means that it must exit with interrupts off
> and the the low level code needs to keep them off till the irtn. [...]

yes, we are very careful to keep irqs disabled in do_IRQ(), both before
and after calling the handler.

> [...] But this is where we test TIF_NEED_RESCHED, and if it is set,
> schedule() is called and should be called with preempt_count != 0, to
> avoid stack overflow interrupt loops. And, schedule() returns with the
> interrupt system on (even if we, unwisely, call it with it off).

yes, in this case schedule() is called with a nonzero preempt count
(PREEMPT_ACTIVE), to keep it from recursing into itself.

> > It seems to me that call to irq_enter() must be shifted from
> > handle_IRQ_event() to do_IRQ().
>
> Even then...

could you check out the latest patch, can you still see any hole in it?
All the above scenarios should be handled correctly.

Ingo