Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3471609pxj; Mon, 7 Jun 2021 11:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIHJyvMtmZXV8YUhObrQ1RimiBtl2BE+lEXi17mIp4MHWN4LedowpFMUtzgGIhubtPfMZC X-Received: by 2002:aa7:d857:: with SMTP id f23mr22008372eds.41.1623090335636; Mon, 07 Jun 2021 11:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623090335; cv=none; d=google.com; s=arc-20160816; b=EjUlGyRGdFVVC1CLkg5nq3wiBdMlnjWIb/tKR+inOdA5hOK2L8UNGuUwMGos+0kax+ dvqVOjXEDlp/HXK/gxzXOFBBL+3gUMZPnJC3FUI2fnHREdneWDUXUNkp/R2vyPHHw2NX bknH256nNsbl3FSYVRuOQUOc1mQU9YoMpHx0lNwlnW6/4Cj0E4xiYKCEseVVHe5v81Z3 UaN+p7VUOSwvasTiCJEKR/aA4h+M/alYx1najBb3SZm7gF6FCKFWqosK5pj5b9uhPVJj hXtbTrhVuup8oBGksSWZqfJI/kQWqrh6weh0GAKi2KhGiOaAnp5IqlmM+93w79/9HdOm GDxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=TSLXevLyC0qtoH7JX/yF9DTJbEPLtuSh723/2tYIOJY=; b=uiJYf9xQ71qG2iTl4/9dciNqs4fmAr8NFmo4V/14cS1bcOvvlMmcyXrYr4Q8L6sXW6 Jrxpbmb6+pib6JhfD4iqRozJ9Ru0vqd+/OlSiWVUnNw79+q0TtE3k5luzCWFZSwW+Zr2 N5pMwLMlDY/hdejFaD0JqoRexgQCkUpCQireBLUTpGjhz0J/MYOtwR5rP/NDPoTokqNs SSMRCE1zn1xAco3iIF9YfWa+i+s/EvqlmWKxMM6YEf5g8D1526K7xyDG4xMz8V8ofuA2 LOhsD44N8Lzl1foSJ+abCMODV9M2Rs6OR1hSMfG5qqTo5NydsFHgihd8DXX6nVzBQgP2 zWyw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw18si13096874ejb.64.2021.06.07.11.25.11; Mon, 07 Jun 2021 11:25:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbhFGSYv (ORCPT + 99 others); Mon, 7 Jun 2021 14:24:51 -0400 Received: from gate.crashing.org ([63.228.1.57]:33191 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbhFGSYu (ORCPT ); Mon, 7 Jun 2021 14:24:50 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 157IIP9d017401; Mon, 7 Jun 2021 13:18:25 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 157IINkr017398; Mon, 7 Jun 2021 13:18:23 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 7 Jun 2021 13:18:23 -0500 From: Segher Boessenkool To: Alexander Monakov Cc: Linus Torvalds , Jakub Jelinek , Alan Stern , "Paul E. McKenney" , Peter Zijlstra , Will Deacon , Andrea Parri , Boqun Feng , Nick Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Linux Kernel Mailing List , linux-toolchains@vger.kernel.org, linux-arch Subject: Re: [RFC] LKMM: Add volatile_if() Message-ID: <20210607181823.GH18427@gate.crashing.org> References: <20210606001418.GH4397@paulmck-ThinkPad-P17-Gen-1> <20210606012903.GA1723421@rowland.harvard.edu> <20210606185922.GF7746@tucnak> <20210607175200.GG18427@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 09:07:58PM +0300, Alexander Monakov wrote: > On Mon, 7 Jun 2021, Segher Boessenkool wrote: > > > > So the barrier which is a compiler barrier but not a machine barrier is > > > __atomic_signal_fence(model), but internally GCC will not treat it smarter > > > than an asm-with-memory-clobber today. > > > > It will do nothing for relaxed ordering, and do blockage for everything > > else. Can it do anything weaker than that? > > It's a "blockage instruction" after transitioning to RTL, but before that, > on GIMPLE, the compiler sees it properly as a corresponding built-in, and > may optimize according to given memory model. And on RTL, well, if anyone > cares they'll need to invent RTL representation for it, I guess. My question was if anything weaker is *valid* :-) (And if so, why!) Segher