Re: in_interrupt race

Paul Mackerras (paulus@samba.org)
Tue, 23 Apr 2002 09:22:55 +1000 (EST)


george anzinger writes:

> > On Sat, 2002-04-20 at 06:27, Paul Mackerras wrote:
> > > One idea I had is to use a couple of bits in
> > > current_thread_info()->flags to indicate whether local_irq_count and
> > > local_bh_count are non-zero for the current cpu. These bits could be
> > > tested safely without having to disable preemption.
>
> Preemption lock is implied by either of these being != 0, so this seems
> consistant, but why not the whole counter?

Putting local_bh_count in the thread_info struct is easy and I have
done that locally here.

Putting local_irq_count in the thread_info struct means we would have
to do irqs_running() differently. There is a brlock allocated for
BR_GLOBALIRQ_LOCK, which is used on some architectures. Using that
would probably help.

Paul.
-
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/