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

Patrik Rak (patrik@raxoft.cz)
Wed, 13 Jan 1999 09:20:33 +0100 (CET)


On Tue, 12 Jan 1999, 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.

It's not correct. Of course I assumed proper usage, i.e., that B already
disabled it. Please re-read the lock-up scenario.

It is a scholar example of resource competition which requires mutual
exclusion if the resources are to remain consistent. The problem is
"hidden" in the fact that once the processor B decreases the count
to zero and thus decides it is going to set the bit in the mask, it will
do it, and nothing is going to prevent it, even if A would use
disable_bh() gazillion times meanwhile...

Patrik

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