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

Andrea Arcangeli (andrea@e-mind.com)
Wed, 13 Jan 1999 23:48:19 +0100 (CET)


On Mon, 11 Jan 1999, Patrik Rak wrote:

> There is a problem with (en|dis)able_bh(). The problem is that if these
> calls are not protected by some other locking mechanism, things might not
> work correctly on SMP machines.

Yes, I seen the subtle mask race the day after I fixed the running bug
(making bh_mask_count atomic_t). atomic_t seems far enough in real world
though.

I just fixed the subtle race with a `slow' spinlock here. The new spinlock
make atomic the bh_mask_count and bh_mask settings. Obviously with a
spinlock bh_mask_count return to be a simple int. I should have posted my
patch here some weeks ago. Browse or ask if you need it.

I can't se a way to fix the thing without using a spinlock. To see the
subtle race you can imagine an mdelay(1000) between the atomic_t operation
and the bh_mask setting (or the reverse).

Andrea Arcangeli

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