Re: SMP problem with (en|dis)able_bh().

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Tue, 12 Jan 1999 14:11:35 +0000


On Tue, Jan 12, 1999 at 02:36:43AM +0000, Alan Cox wrote:
> > Now imagine the situation when processor A is going to disable bottom
> > halves, while B is going to enable it. Now it might go like this (note
> > that many other similar scenarios are possible):
>
> Processor B can only be enabling it if it has already disabled it. In that
> circumstance it seems correct.

Not really; the counters are there so that A is allowed to disable it
_at the same time_ as B. The race condition is: disabled already due to
B. B calls enable_bh(). A calls disable_bh(). The bottom half ends up
enabled.

My dreamy self thinks that incrementing before clearing the bit in
disable_bh(), instead of after, should fix this, but someone wider-eyed
should have a think about it.

-- Jamie

-
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.tux.org/lkml/