From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from bombadil.infradead.org ([65.50.211.133]:50297 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbdCCR2c (ORCPT ); Fri, 3 Mar 2017 12:28:32 -0500 Date: Fri, 3 Mar 2017 15:57:17 +0100 From: Peter Zijlstra To: Christian Borntraeger Cc: Arnd Bergmann , kasan-dev , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Networking , Linux Kernel Mailing List , linux-media@vger.kernel.org, linux-wireless , kernel-build-reports@lists.linaro.org, "David S . Miller" , Paul McKenney Subject: Re: [PATCH 02/26] rewrite READ_ONCE/WRITE_ONCE Message-ID: <20170303145717.GJ6536@twins.programming.kicks-ass.net> (sfid-20170303_182900_994436_B691737F) References: <20170302163834.2273519-1-arnd@arndb.de> <20170302163834.2273519-3-arnd@arndb.de> <76790664-a7a9-193c-2e30-edaee1308cb0@de.ibm.com> <2adc6ff4-5dc5-8f1d-cce1-47f3124a528f@de.ibm.com> <20170303144938.GF6557@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20170303144938.GF6557@twins.programming.kicks-ass.net> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, Mar 03, 2017 at 03:49:38PM +0100, Peter Zijlstra wrote: > On Fri, Mar 03, 2017 at 09:26:50AM +0100, Christian Borntraeger wrote: > > Right. The main purpose is to read/write _ONCE_. You can assume a somewhat > > atomic access for sizes <= word size. And there are certainly places that > > rely on that. But the *ONCE thing is mostly used for things where we used > > barrier() 10 years ago. > > A lot of code relies on READ/WRITE_ONCE() to generate single > instructions for naturally aligned machined word sized loads/stores > (something GCC used to guarantee, but does no longer IIRC). > > So much so that I would say its a bug if READ/WRITE_ONCE() doesn't > generate a single instruction under those conditions. > > However, every time I've tried to introduce stricter > semantics/primitives to verify things Linus hated it. See here for the last attempt: https://marc.info/?l=linux-virtualization&m=148007765918101&w=2