Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3624661pxj; Mon, 7 Jun 2021 16:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiTD2FrcB06728j+SfTSLHoEdUn9t+amaNxJpEPmQg5mYHyhOr021c47RK4vlF3YFyD0Bq X-Received: by 2002:aa7:c9c4:: with SMTP id i4mr14483792edt.299.1623106969824; Mon, 07 Jun 2021 16:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623106969; cv=none; d=google.com; s=arc-20160816; b=riUkcrswoOMC+423e+UhExeLZfCSrXWCh4ShdGLOPgUp+2c0nyCpxArEVG4IC+jzEE NEaPiGE8jVG90B6sZq4DRjR0k6rEKu8k/6hcoILy1X1d9ZPRnniOP2yNzhX+5VVQOrIj 9r8UCBNlGh0rQin7Y3gyuA5YulrDaTPm3lM0V/insnjWA9uk8qYxSAf9mwXkeW21YRGb MKDkFPks81fJboxc2s9zriZUgigR0Ra7R9yLOAyAa9ip2TBDUu+X1phS0kllnEArwgFP Q0WMT6Vry3WOm9kVCYzI49QxzUnE/nda6uY7ZOz6fAt9tRYvsXcPkAxZzu8ri7/xmbW+ MHGg== 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=aP9/wPZBtTUp80U9ea/7jFwNvj9hDc/6xxyC4iDpVKM=; b=j8+fxQtI4X7TDSqQwmEZyzLz4B22rhlT0AgTcGnkXJj4vV6MMcqrqvAP4A3vBf2lj2 6gfsxtvKjk/f6lKZct3JYfTNMactdYh0dC+Q5La8oTHAVkRk7nyKDS51EWfKUa2VuGdZ aREaEUMnT53BJa+ScO5bjSihuHPfNeLADdxpECm1KgchnK3fyWGDC9sLx4TQfyXw1+4B yTzXOKfYYZZFW58bgAlSM3XqR5Mc2Ak3izGuqzyVLyiKwyFzFKA2qWYA+U0K21uBjBqi /8w5s+nqLigmrY6530HGoYr2P5sZiAp/wDU6oiSIuuo6ZsHZtYwJ9JUVml4LhPucaFHz cEKQ== 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 m12si13452857ejq.256.2021.06.07.16.02.26; Mon, 07 Jun 2021 16:02:49 -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 S230395AbhFGXAw (ORCPT + 99 others); Mon, 7 Jun 2021 19:00:52 -0400 Received: from gate.crashing.org ([63.228.1.57]:35597 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbhFGXAv (ORCPT ); Mon, 7 Jun 2021 19:00:51 -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 157MsaMr032654; Mon, 7 Jun 2021 17:54:36 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 157MsXQq032649; Mon, 7 Jun 2021 17:54:33 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 7 Jun 2021 17:54:33 -0500 From: Segher Boessenkool To: Linus Torvalds Cc: Alexander Monakov , 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: <20210607225433.GR18427@gate.crashing.org> References: <20210605145739.GB1712909@rowland.harvard.edu> <20210606001418.GH4397@paulmck-ThinkPad-P17-Gen-1> <20210606012903.GA1723421@rowland.harvard.edu> <20210606185922.GF7746@tucnak> <20210607174206.GF18427@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 01:31:24PM -0700, Linus Torvalds wrote: > > Is it useful in general for the kernel to have separate "read" and > > "write" clobbers in asm expressions? And for other applications? > > See above. It's actually not all that uncommon that you have a "this > doesn't modify memory, but you can't move writes around it". It's > usually very much about cache handling or memory ordering operations, > and that bit test example was probably a bad example exactly because > it made it look like it's about some controlled range. > > The "write memory barroer" is likely the best and simplest example, > but it's in not the only one. Thanks for the examples! I opened so that we can easily track it. Segher