Re: [PATCH] mm: prevent mmap_cache race in find_vma()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 3 Apr 2013, Johannes Weiner wrote:

> Who cares about the implementation, we are discussing a user here.
> ACCESS_ONCE() isolates a problem so that the users don't have to think
> about it, that's the whole point of abstraction.  ACCESS_ONCE() is an
> opaque building block that says it prevents the compiler from merging
> and refetching accesses.  That's all we care about right now.
> 

The discussion is about the implementation of ACCESS_ONCE().  Nobody, thus 
far, has said anything about this specific patch other than me when I 
acked it.  I didn't start another thread off this patch because the 
changelog is relying on the comment above ACCESS_ONCE() to say that this 
"prevents the compiler from refetching."  Some have been confused by this 
comment and accept it at face value that it's really preventing the 
compiler from doing something; in reality, it's "using gcc's 
current implementation to prevent refetching."  It's an important 
distinction for anyone who comes away from the comment believing that 
volatile-qualified pointer dereferences are forbidden to be refetched by 
the compiler.

Others have said that I've somehow discouraged its use because its somehow 
an invalid way of preventing gcc from refetching (when I've acked patches 
that do this exact thing in slub!).  I have no idea how anyone could parse 
anything I've said about discouraging its use.  I simply noted that the 
changelog could be reworded to be clearer since we're not relying on any 
standard here but rather a compiler's current implementation.  It was 
never intended to be a long lengthy thread, but the comment I made is 
correct.  I've worked with Paul to make that clearer in the comment so 
that people aren't confused in the future.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]