Re: bitops atomicity question

David S. Miller (davem@jenolan.rutgers.edu)
Tue, 26 Aug 1997 00:28:51 -0400


Date: Mon, 25 Aug 1997 16:56:54 +0200
From: Pavel Machek <pavel@Elf.mj.gts.cz>

If these are expected to be atomic then generic code will fail on
sparc32 /SMP.

Truth is, these interfaces were all designed long ago and their only
purpose was to make big operations interrupt safe. Then SMP came
along.

Really, true SMP safe bit flag operations are so expensive that Linus
and myself want to add an extra set of interfaces that say "yes, I
_do_ need this to be SMP atomic".

Finally, you want portability. For that, protect flag updates in
userland using mutex's provided by pthreads library. Those are
portable and _do_ work on all platforms as expected.

Later,
David "Sparc" Miller
davem@caip.rutgers.edu