Re: [RFC] 4KB stack + irq stack for x86

Linus Torvalds (torvalds@transmeta.com)
Wed, 5 Jun 2002 13:55:15 -0700 (PDT)


On 5 Jun 2002, Andi Kleen wrote:
> >
> > Ah, you're right. If anyone uses current_thread_info from IRQ context
> > it will set the flags in the wrong structure. However, it actually
> > works because nobody does that currently: all of the _thread_flag users
>
> preemptive kernels do use current_thread_info() for every spinlock.
> this required me to change its implementation on x86-64 from stack
> arithmetic to access the base register.

Note that this part is ok, as long as we make sure that the irq stack gets
initialized with a preempt_count > 0 (we must not preempt an interrupt
handler anyway, it wouldn't work), _and_ we make sure that taking the
interrupt also increments the "process native" preempt_count (so that
anybody looking at that preempt_count to determine whether it could be
preempted will also get a "nope, don't preempt me").

So that part doesn't look like a fundamental problem to me. It's just a
"need to be careful" thing.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/