Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbcKYVJC (ORCPT ); Fri, 25 Nov 2016 16:09:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46624 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751549AbcKYVIz (ORCPT ); Fri, 25 Nov 2016 16:08:55 -0500 Date: Fri, 25 Nov 2016 23:08:48 +0200 From: "Michael S. Tsirkin" To: Christian Borntraeger Cc: Peter Zijlstra , Mark Rutland , Dmitry Vyukov , Boqun Feng , LKML , Davidlohr Bueso , dbueso@suse.de, jasowang@redhat.com, KVM list , netdev , Paul McKenney , virtualization@lists.linux-foundation.org, Linus Torvalds Subject: Re: [PATCH 0/3] virtio/vringh: kill off ACCESS_ONCE() Message-ID: <20161125230735-mutt-send-email-mst@kernel.org> References: <20161125112203.GA26611@leverpostej> <32dfca07-59f3-b75a-3154-cf6b6c8538f0@de.ibm.com> <20161125122356.GB26611@leverpostej> <20161125124044.GN3092@twins.programming.kicks-ass.net> <20161125124404.GI3174@twins.programming.kicks-ass.net> <20161125145512.GA4014@Boquns-MacBook-Pro.local> <20161125161004.GA30181@leverpostej> <20161125161709.GQ3092@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 25 Nov 2016 21:08:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 32 On Fri, Nov 25, 2016 at 05:49:45PM +0100, Christian Borntraeger wrote: > On 11/25/2016 05:17 PM, Peter Zijlstra wrote: > > On Fri, Nov 25, 2016 at 04:10:04PM +0000, Mark Rutland wrote: > >> On Fri, Nov 25, 2016 at 04:21:39PM +0100, Dmitry Vyukov wrote: > > > >>> 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? > > > > > 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(). > >