Re: [RFC] should VM_BUG_ON(cond) really evaluate cond
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2011-10-28 01:35:12
Also in:
lkml
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2011-10-28 01:35:12
Also in:
lkml
On Thu, Oct 27, 2011 at 6:25 PM, Andi Kleen [off-list ref] wrote:
Seems reasonable too. In fact we usually should have memory barriers for this anyways which obsolete the volatile.
No we shouldn't. Memory barriers are insanely expensive, and pointless
for atomics - that aren't ordered anyway.
You may mean compiler barriers.
That said, removing the volatile entirely might be a good idea, and
never mind any barriers at all. The ordering for atomics really isn't
well enough specified that we should care. So I wouldn't object to a
patch that just removes the volatile entirely, but it would have to be
accompanied with quite a bit of testing, in case some odd case ends up
depending on it. But nothing *should* be looping on those things
anyway.
Linus