From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932614AbbJNQe6 (ORCPT ); Wed, 14 Oct 2015 12:34:58 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:50297 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932113AbbJNQe4 (ORCPT ); Wed, 14 Oct 2015 12:34:56 -0400 Date: Wed, 14 Oct 2015 18:34:23 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Dmitry Vyukov , Paul McKenney , tip-bot for Andrey Ryabinin , "linux-tip-commits@vger.kernel.org" , kasan-dev , Ingo Molnar , Kostya Serebryany , Borislav Petkov , Andrey Ryabinin , Andrew Morton , LKML , Linus Torvalds , Thomas Gleixner , Sasha Levin , Denys Vlasenko , Wolfram Gloger , Andrey Konovalov , "H. Peter Anvin" , Alexander Potapenko Subject: Re: [tip:locking/urgent] compiler, atomics: Provide READ_ONCE_NOCHECK () Message-ID: <20151014163423.GI3816@twins.programming.kicks-ass.net> References: <1444750088-24444-2-git-send-email-aryabinin@virtuozzo.com> <20151014154532.GV3910@linux.vnet.ibm.com> <20151014160146.GW3910@linux.vnet.ibm.com> <20151014161615.GG3816@twins.programming.kicks-ass.net> <20151014162055.GH3816@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2015 at 09:23:33AM -0700, Andy Lutomirski wrote: > On Wed, Oct 14, 2015 at 9:20 AM, Peter Zijlstra wrote: > > On Wed, Oct 14, 2015 at 06:18:58PM +0200, Dmitry Vyukov wrote: > >> > >> Well, if another thread writes it byte-by-byte, it pretty much does > >> not matter how you read it. > >> Note that I said "at least one access is not atomic". If both are > >> atomic, then this is, of course, legal. And KTSAN considers > >> READ/WRITE_ONCE as atomic operations. > > > > OK, then I'm confused on what exactly the annotation does, but less > > worried. > > The annotation says "hey, KASAN (etc), don't worry if you think that > the memory being accessed is out of bounds". Presumably KTSAN is okay > with the operation because it's atomic, but KASAN dislikes it because > it's accessing memory that is out of bounds from the perspective of a > C program. There's going to be more of that.. > I'd still rather find a way to just delete get_wchan, but whatever. :-)