Re: Race condition in 2.4 tasklet handling

From: Anton Blanchard
Date: Sat Aug 23 2003 - 12:55:30 EST



Hi,

> Adding smp_mb__after_test_and_set_bit() at the end of
> tasklet_trylock() should remedy the situation. As
> smp_mb__{before|after}_test_and_set_bit() don't exist yet, I'm
> attaching a patch which adds smp_mb__after_clear_bit(). The patch is
> against 2.4.21.

No, the atomic and bitop operations that return values (like
test_and_set_bit) must have barriers. Is x86 missing these?

> P.S. Please comment on the addition of
> smp_mb__{before|after}_test_and_set_bit().

Only the atomic and bitops that dont return values (set_bit, atomic_inc
etc) might require ordering depending on use.

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