Re: per interrupt stack [was Re: Strange interrupt behaviour]

Andi Kleen (ak@muc.de)
Thu, 16 Jul 1998 15:41:24 +0200


On Thu, Jul 16, 1998 at 03:16:32PM +0200, Andrea Arcangeli wrote:
> On Thu, 16 Jul 1998, Andi Kleen wrote:
>
> > Right. Currently in the usual paths current is only used to compute
> > smp_processor_id() early in do_IRQ. This is no problem because the old
> > stack is probably still there. For later interrupts it makes not much sense
>
> Yes.
>
> > to compute current. So either outlaw it (add a check to current for a few
>
> If I unserstood well Ingo said that some kernel code send a signal to the
> current process inside the interrupt handler (I can imagine during C^c) so
> we should change current-> with irq_current-> inside the interrupt handler
> and catch the start of the old stack from irq_current (this sound simple).

Umm, no. The paths that sends signals to processes (SIGSEGV, SIGBUS etc.)
have their own handlers and are not dispatched through the usual do_IRQ().
You'll see that if you follow the interrupt entry code in entry.S.

This means your patch never touched them. On the other hand it might be
a good idea to give them their own stacks too - simply to increase locality
(this needs profiling)

Also for Ctrl-C - C-c is of course not send to current. It is send to the
session leader of the terminal session associated with the tty C-c occured on.

>
> > releases to catch it), or alternatively give the interrupts a special
> ^^^^^^^^^^^^^^^^^^^^
> Yes to catch the old current during the irq_current migration.
>
> > task_structure that stays static - an "interrupt thread". This thread is
> > not scheduled, it just exists to have a current during interrupt processing.
>
> Hmm changing current to irq_current inside the irq_handlers sound very
> simpler and cleaner to me.

Have to check if none of the SMP locking routines (spinlocks etc.) access
smp_processor_id(), otherwise it'll break. If it turns out that they do
the fake current is probably a good idea still, because it avoids to define
interrupt/non interrupt versions then.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html