From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y Date: Tue, 30 Jun 2020 22:20:59 +0200 Message-ID: <20200630202059.GE4817@hirez.programming.kicks-ass.net> References: <20200630173734.14057-1-will@kernel.org> <20200630173734.14057-19-will@kernel.org> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pAld+PmSm3uQ9OLHyA9LsKDVn58a/UVYkn4lwoGnumM=; b=eAS27j4l5VKQ8En/OF9eH/i5RP +zf93Ed62vvzDVNpm3OQPePdECVVSJpOKoPHPo0qto2p1L5df+7KSwptQDd/nIrdnpM5pzrhFjqJW Gay6KM35iiIdnoVMtvL/4zFrkRmS8yLmL8kAueTKNarZQya4QhxBswEHfzITY6U2oKozvVDs84Yl7 8YFxk3ukDS3ImbkleuGENzLAnxsGWZJK4RrZ92k+myKvwxG+jTKqc4UERDxZlwKgkAJCQy/4cc2Xk 2MFT8Aygu1X6cIf9AXIRkGnOEsa+DHSPoHT2y4I+azRP5RQAjvGtlG/6aByC0gvgXiSJN2XicZtSl 46R2yNXA==; Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Marco Elver Cc: Will Deacon , LKML , Sami Tolvanen , Nick Desaulniers , Kees Cook , "Paul E. McKenney" , Josh Triplett , Matt Turner , Ivan Kokshaysky , Richard Henderson , Alan Stern , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Boqun Feng , Catalin Marinas , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, virtualization@lists.linux-foundation.org On Tue, Jun 30, 2020 at 09:47:30PM +0200, Marco Elver wrote: > I do wonder, though, if there is some way to make the compiler do > something better for us. Clearly, implementing real > memory_order_consume hasn't worked out until today. But maybe the > compiler could promote dependent loads to acquires if it recognizes it > lost dependencies during optimizations. Just thinking out loud, it > probably still has some weird corner case that will break. ;-) I'd be very hesitant to let the compiler upgrade the ordering for us, specifically because we're not using C11 crud and are using a lot of inline asm.