Thread (25 messages) flat view 25 messages, 5 authors, 2011-11-02

Re: [RFC] should VM_BUG_ON(cond) really evaluate cond

From: Ben Hutchings <hidden>
Date: 2011-10-28 03:29:41
Also in: lkml

On Fri, 2011-10-28 at 04:52 +0200, Eric Dumazet wrote:
Le vendredi 28 octobre 2011 à 02:44 +0100, Ben Hutchings a écrit :
quoted
Whether or not it needs to provide any ordering guarantee, atomic_read()
must never read more than once, and I think that requires the volatile
qualification.  It might be clearer to use the ACCESS_ONCE macro,
however.
Where this requirement comes from ?
That is the conventional behaviour of 'atomic' operations, and callers
may depend on it.
Maybe then introduce atomic_read_once() for users really needing it :)

ACCESS_ONCE will force the read/move instruction I try to avoid :(
[...]

I'm sure you can find some other way to avoid it.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help