Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3924278ybl; Mon, 13 Jan 2020 05:06:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxiLP2iIADD/GXS6++mlOjO4bFJbj8lqaj1nfeskDLZWX6+EWNzgcJpW2E3U+bypHB8zcdI X-Received: by 2002:a05:6830:147:: with SMTP id j7mr13214796otp.44.1578920816052; Mon, 13 Jan 2020 05:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578920816; cv=none; d=google.com; s=arc-20160816; b=Z7pxeSh0/JVGUm88uW991cNNYCUtTuOO6gwt1AH3n+5rresSciFp+LbsXGEiWoEyiD yqzMLx5o4n+tFyQRsqW2rfa36P9O2oUnthaNPas+9w1qaHoX6LGEKb3i88ST6am4+U7Z 2F7vPx+WdwGih57GiG1phIeEEBnIk3TBwXJv7GYHFbolQ5PCL/TuR8ddjjsyir2APhg0 62NFtWAFWQZfycgGcQUuNsd/yMmOHrSHIOkSRoGlosDYHLHudldSn439XOrNGT7N8vUn wUbO0bzNlZeLdIcwLD90UWT4aVdwNrqTHW5V7/RvO5PQb/+xp+vDGhghAVTDp/IBbLuw KlqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=AWTbi2cgEI4uxJGuoGqZSDMmk6XmHPZTYgk/U4NsIp4=; b=1Lbj1Jv0jvqBasguA/kBsjPhhXiF7GoNBV0nSGScYxYsjNQvDQhWklydUOVC8QfKxk m3koMEwQ0Vp6iYaKa53x5rOhtR29CcwLfjWtTb42UH7a8Oju6Dv2GvgBZdvJmaYyes6V SAGfM9RgzfVIiiiQ1A6rpBb05bN/EbD6SF0Hu1UeDjTB7zkAKODOj1t7kdT7uLgVY9FG A4EJiyc9uGHxkS4xSzYzbQBZJUd+7UbtVoo/xowX8g4hNZJEQ5K3HPN0EPrSKYU3WOqu xOs319uR3ZO7VwSfMggbV6R/307L5fdgRbMfNFTRKk/6HgaUu/14wj8jCIhsj2XyNOyd vTtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t125si5343514oih.183.2020.01.13.05.06.43; Mon, 13 Jan 2020 05:06:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728769AbgAMNEB (ORCPT + 99 others); Mon, 13 Jan 2020 08:04:01 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:40195 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbgAMNEB (ORCPT ); Mon, 13 Jan 2020 08:04:01 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MEVJq-1iti7w3NCE-00G04S; Mon, 13 Jan 2020 14:03:59 +0100 Received: by mail-qt1-f181.google.com with SMTP id g1so8941152qtr.13; Mon, 13 Jan 2020 05:03:58 -0800 (PST) X-Gm-Message-State: APjAAAWCFSNQ1Q4E4kjOTf4HO1jGXHbo2GpDQVXZXV1mQRx8hfNOwIk1 Szk1kpSSTnhglI6ewYhNw6eh284iL3JpvXCcJP8= X-Received: by 2002:ac8:47d3:: with SMTP id d19mr13626947qtr.142.1578920637682; Mon, 13 Jan 2020 05:03:57 -0800 (PST) MIME-Version: 1.0 References: <20200110165636.28035-1-will@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 13 Jan 2020 14:03:41 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 0/8] Rework READ_ONCE() to improve codegen To: Linus Torvalds Cc: Will Deacon , "linux-kernel@vger.kernel.org" , linux-arch , Android Kernel Team , Michael Ellerman , Peter Zijlstra , Segher Boessenkool , Christian Borntraeger , Luc Van Oostenryck Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:maIhxSVsvJZGSYRWgJ+4V38fF6YeStUy48VybSPlgFgP1JyKGr6 Ub7zz3shDsXosbuv7IHqU+wlX03r5MZw4T+YcKrhqoqFpeczcxestZtYEkEtSnYxyaM4QPW DkmIWJFra5EDRDgQBk+R5dMQWwMRlM3pVzJF3BZMI9uU8jfDfHNl3GCcvtMKSWbOrBO0DqV vdak92mO4zStkY7hV/XWg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vnUSi9YgTdI=:Q3ODEJlx7TOUea5RffFqF2 Ghd0fjf86pSLMTdYUmQcz2Zge0dRiPAWdwGP5AhO6+isct9Ju6hEr5oD3EI3kxmSMWmF6mE3R oc6tyI/TEJQ+wElQyoJsjJRgDDRS2lhdrSK7s7hfVeWfiMKyu1Z0nqt5gPwpXhY+fR7lhm+DL k+ZShW+NDkMC8nJkdbKpIWtz3/ty7SLKAWPlpLs7nhuPAgbF6olWBM1WV8oP/EXyYmaMnv4dh jphNJfIG2StfBoQBLG7xO2BRgO2u4KcOIrhjO8CfNAh//pC6KH3BgDMPr1LgK+81mJZ2gIBeV mEs2W1S0M5jN0NdYBtiJr+YfjAEmWjONRQeBBox/jsh07mzWwa93qSTF2WWJ9D+vWiY7vciFj sy4FITZTuVTt4b3xd/fUHYSdKWX1MwE5rNYpCls/LFO1oQB7SQClVr8CLTuQcIGXsra1fGFOS r+XkW+A1MclJ3Ws0oGl2SFsftVdPO4Q+zWkVeDYR+qKj4KLoceG14SrgaXB1FsOdhztypg+EX xiAj5mMkKSbZSb3slNcSgRFAzEqyUtt3LnN2er0IlfQM8JyTozknz/IE7NW3AgSw3q8mmV0YO GCP9u2fDCpvnl2wa5e6TOLa6g0dZlHRZcCshprPSfGCvFf/xOAkAbHAt1U00/nUbbZ7uMsLZY CbbERH7NBRUCTSyxaF5fiyaNAmrNYak50E20a9kDy9R6UUVIdF03a9DmuXf4pocaMurfilSNS iOAoad30dL3dpMcY1DV63rRvBuW0u44RnDF/XeGvm2h1j9o1gk0FoDLxZAHVo4Vv9JejzCvGb SoVDBv3XnsN7EZCbm1RzrAR+7zRknFayRPp2WifdLbzaeFkjIGe3odkxW1OOwS9+FN3rTXUd4 lZwy28m1tUgjTn/YOOtw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 10, 2020 at 9:15 PM Linus Torvalds wrote: > > On Fri, Jan 10, 2020 at 11:47 AM Arnd Bergmann wrote: > > > > Isn't the read_barrier_depends() the only reason for actually needing > > the temporary local variable that must not be volatile? > > > > If you make alpha provide its own READ_ONCE() as the first > > step, it would seem that the rest of the series gets much easier > > as the others can go back to the simple statement from your > > Hmm.. The union still would cause that "take the address of a volatile > thing on the stack" problem, wouldn't it? And that was what caused > most of the issues. Ah, I was missing that there is still the union in smp_load_acquire(), I only saw that the one in READ_ONCE() is needed only on alpha. The number of files using smp_load_acquire() is fairly small though, so we could consider changing it to pass both source and destination as macro arguments and use typeof(dest) instad of typeof(source) to avoid the volatile pointer access. > I think the _real_ issue is how KASAN forces that odd pair of inline > functions in order to have the annotations on the accesses. But the inline functions (I assume you mean __write_once_size and __read_once_size_nocheck?) are completely removed after Will's series, so those no longer cause harm, right? Arnd