Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp497926ybg; Sun, 26 Jul 2020 11:12:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwspk9Zh0Sb6yRyPXExUCnr3vmnP3ohgC7ULIaAmLXdqPkEPs2UaZ79cgiGAb1uENdCiJ7g X-Received: by 2002:a17:906:e2d6:: with SMTP id gr22mr7308198ejb.455.1595787130027; Sun, 26 Jul 2020 11:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595787130; cv=none; d=google.com; s=arc-20160816; b=WcN2C636eS9VtzIAXKr1Buap9kN4stxuwduWn84bNPII6Qf8s3md0MwyP5x21T/0lZ swy0UYMgbDqYEdzsYkDHUD9EpeEiesavYkQVc0DtQXMql0zZGkji8AEdIWhgoEE4oELp ktHgBCeEo0S+7onFNCxFvFqqgXPJtmrwVliyOT7bczo905tyyCbcMZXEhKk0RP+lBSvP WMGMRI3uGnHH7H1JIVaciEc0pHMWSDWV5UVBdFYKWRErBF3vZ9OZvMeX+97pl+CJ1oV6 EuEK6fnXSy37vMKICZa4CVZzhKL9LZ0ELe0l7nJQ1J+lX2XeI88TpyV9I/eTN3zj/eMu ysAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=NcspvM2zECf20Ixoqc8LAWCi5L3GTHnysxHjK9LRx80=; b=Vhizikw2YaS1II81lx33mPI4U1EnJ3/PBun9KXy9aQTLmF97AoVWoCkJgqztkavQ4z C21vbaqW2eJ8ZRGmbwJNixR2etDBetz639tA+2OmMD5Z5L2yZ8vpnojTU1OuQen79CHA 84tdK7bmDO455iiR3K8lQ3VhKfXdnkJf57uiaPdQ7qF74NzuNHxu6V2Y6xWm6PoVAEHe PVz9ULCb5n0clpSwkDg1ECeDMVHRQh3GBSNHngjkt5GPBKJvkSKikLsH3h9lRMuvWxx5 gIlzNxiEJaW65OM6SegsqQsC/a9502h689cCM/ISqIV78Hs3euis87POsZTfJnr1WsTz lZ2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CgW/KPae"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re6si4132203ejb.381.2020.07.26.11.11.47; Sun, 26 Jul 2020 11:12:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CgW/KPae"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726760AbgGZSJL (ORCPT + 99 others); Sun, 26 Jul 2020 14:09:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:50942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbgGZSJK (ORCPT ); Sun, 26 Jul 2020 14:09:10 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-111-31.bvtn.or.frontiernet.net [50.39.111.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E69AF2065C; Sun, 26 Jul 2020 18:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595786949; bh=Q7TO0N1+oTCeRGZGoE/LoIwunP2SQ2HQ4NLKLhqxPbY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=CgW/KPaePH20C7T7aOquo6ZfIlGhSTVOwJpC2XbwRQBLT9eEqeV5fW2AyOT1FZL4S byivPvMZ4eXTlTmA+8h4uc6Pw29b3dS8DpmCNrI6UpL+8Qy7wTP50QMQRdEnLWZfkc U5vFyG0QLhOLOO4L1tQwBbEeBXkrqegRysfsYe5o= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id D003F3523102; Sun, 26 Jul 2020 11:09:09 -0700 (PDT) Date: Sun, 26 Jul 2020 11:09:09 -0700 From: "Paul E. McKenney" To: peterz@infradead.org Cc: Marco Elver , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , kasan-dev , LKML , jakub@redhat.com, hjl.tools@gmail.com Subject: Re: [PATCH] kcsan: Add option to allow watcher interruptions Message-ID: <20200726180909.GE9247@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200220185855.GY2935@paulmck-ThinkPad-P72> <20200220213317.GA35033@google.com> <20200725145623.GZ9247@paulmck-ThinkPad-P72> <20200725174430.GH10769@hirez.programming.kicks-ass.net> <20200725193909.GB9247@paulmck-ThinkPad-P72> <20200725201013.GZ119549@hirez.programming.kicks-ass.net> <20200725202131.GM43129@hirez.programming.kicks-ass.net> <20200725220750.GC9247@paulmck-ThinkPad-P72> <20200726115242.GA119549@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200726115242.GA119549@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 26, 2020 at 01:52:42PM +0200, peterz@infradead.org wrote: > On Sat, Jul 25, 2020 at 03:07:50PM -0700, Paul E. McKenney wrote: > > On Sat, Jul 25, 2020 at 10:21:31PM +0200, peterz@infradead.org wrote: > > > On Sat, Jul 25, 2020 at 10:10:13PM +0200, peterz@infradead.org wrote: > > > > On Sat, Jul 25, 2020 at 12:39:09PM -0700, Paul E. McKenney wrote: > > > > > > > > This gets me the following for __rcu_read_lock(): > > > > > > > > > > 00000000000000e0 <__rcu_read_lock>: > > > > > e0: 48 8b 14 25 00 00 00 mov 0x0,%rdx > > > > > e7: 00 > > > > > e8: 8b 82 e0 02 00 00 mov 0x2e0(%rdx),%eax > > > > > ee: 83 c0 01 add $0x1,%eax > > > > > f1: 89 82 e0 02 00 00 mov %eax,0x2e0(%rdx) > > > > > f7: c3 retq > > > > > f8: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) > > > > > ff: 00 > > > > > > > > > > One might hope for a dec instruction, but this isn't bad. We do lose > > > > > a few instructions compared to the C-language case due to differences > > > > > in address calculation: > > > > > > > > > > 00000000000000e0 <__rcu_read_lock>: > > > > > e0: 48 8b 04 25 00 00 00 mov 0x0,%rax > > > > > e7: 00 > > > > > e8: 83 80 e0 02 00 00 01 addl $0x1,0x2e0(%rax) > > > > > ef: c3 retq > > > > > > > > Shees, that's daft... I think this is one of the cases where GCC is > > > > perhaps overly cautious when presented with 'volatile'. > > > > > > > > It has a history of generating excessively crap code around volatile, > > > > and while it has improved somewhat, this seems to show there's still > > > > room for improvement... > > > > > > > > I suppose this is the point where we go bug a friendly compiler person. > > > > Sounds very good! Do you have someone specific in mind? > > Jakub perhaps?, Cc'ed > > > > Having had a play with godbolt.org, it seems clang isn't affected by > > > this particular flavour of crazy, but GCC does indeed refuse to fuse the > > > address calculation and the addition. > > > > So there is hope, then! > > > > And even GCC's current state is an improvement. Last I messed with this, > > the ACCESS_ONCE()++ approach generated a load, a register increment, > > and a store. > > > > Do you still have the godbolt.org URLs? I would be happy to file > > a bugzilla. > > https://godbolt.org/z/rP8rYM Thank you! Now creating a GCC bugzilla account. For some strange reason, my old ibm.com account no longer functions. ;-) Thanx, Paul