Re: [PATCH 0/3] virtio/vringh: kill off ACCESS_ONCE()

From
Michael S. Tsirkin <mst@redhat.com>
Date
2016-11-25 21:09:02
Also in
kvm, lkml, virtualization
Reply to
Christian Borntraeger, 2016-11-25
On Fri, Nov 25, 2016 at 05:49:45PM +0100, Christian Borntraeger wrote:
On 11/25/2016 05:17 PM, Peter Zijlstra wrote:
quoted
On Fri, Nov 25, 2016 at 04:10:04PM +0000, Mark Rutland wrote:
quoted
On Fri, Nov 25, 2016 at 04:21:39PM +0100, Dmitry Vyukov wrote:
quoted
quoted
What are use cases for such primitive that won't be OK with "read once
_and_ atomically"?
I have none to hand.
Whatever triggers the __builtin_memcpy() paths, and even the size==8
paths on 32bit.

You could put a WARN in there to easily find them.
There were several cases that I found during writing the *ONCE stuff.
For example there are some 32bit ppc variants with 64bit PTEs. Some for
others (I think sparc). And the mm/ code is perfectly fine with these
PTE accesses being done NOT atomic.
In that case do we even need _ONCE at all?
Are there assumptions these are two 32 bit reads?

quoted
The advantage of introducing the SINGLE_{LOAD,STORE}() helpers is that
they compiletime validate this the size is 'right' and can runtime check
alignment constraints.

IE, they are strictly stronger than {READ,WRITE}_ONCE().
Thread (34 messages) 34 messages, 9 authors, last reply 2016-11-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help