Re: [patch] spinlocks: remove 'volatile'

Nick Piggin
2006-07-08T10:45:19Z

Linus Torvalds wrote:

> It's not that "volatile" is the "portable way". It's that "volatile" is
> fundamentally not sufficient for the job.

However it does seem to be good for some things, as you say.

The volatile casting in atomic_* and *_bit seems to be a good idea
(now that I think about it) [1].

Because if you had a barrier there, you'd have to reload everything
used after an atomic_read or set_bit, etc.

But it might be nice to wrap that in something rather than use
volatile directly. force_reload(wordptr); maybe?

[1] Even though I still can't tell the exact semantics of these
operations eg. why do we need volatile at all? why do we have
volatile in the double underscore (non-atomic) versions?

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com