Re: test_and_set_bit() not atomic forever? [cli/sti in char/vt.c [patch]]

Mike (ford@omnicron.com)
Sun, 31 May 98 14:35:59 -0700


> > As second since it' s declared _not_ atomic in Linux, why i386 implement
> > it atomic?
>
> Because in i386 port it _IS_ atomic, so in arch/i386 you can assume
> that test_and_set_bit is atomic. Strange, is not it? Should be
> documented somewhere.

I think this is an undesirable philosophy. Atomic and non-atomic
operations should both be available, and the calling code should use the
appropriate one. There should be an arch-dependent efficient
implementation of both types, even if they are the same on a particular
arch.

That way even an x86-only driver can make its assumptions explicit, and
if it is extended to support additional arch's it will be that much
easier and safer.

-=] Ford [=-

"Look over there!... A dry ice (In Real Life: Mike Ditto)
factory -- a good place to get ford@omnicron.com
some thinking done." http://www.omnicron.com/~ford/ford.html
- Talking Heads, "Cities"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu