Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3347801pxj; Mon, 7 Jun 2021 08:28:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHjezSPh+gdwQoaiw2UIY4w+3WyzjYpOJZ+YKcWBnJkoZpmaEC13BIQdXEsxNEBX6GJwxT X-Received: by 2002:a17:907:779a:: with SMTP id ky26mr18271189ejc.293.1623079718712; Mon, 07 Jun 2021 08:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623079718; cv=none; d=google.com; s=arc-20160816; b=bO7b031Ec5u2d7CBO133e1ukrfppZ+ztSPIV1obmKJ+r4HmALBwl4VhTSo88XkAuaR j3mm+bCEGkdFdAyj4g3mmjfNMZTwB+BfuV5GCvV8Aa4fmAS7VJrlSQQccNnmQuThFmH3 5c3PLZNox9CCyzxsuv7tSsBmbB8xhEJdgdDfggJxz/nywJij+0kmsGSf/5PDOoYdUl0R c9npFTjBu3eN775QH/9rJcRHeHX8zmC353XILAY9BGol3H/bgWo5qECEr0UhjBmD+943 K+3ZSod6ZOUQr+WNyxgb9h5idHGlf3HBxyluxk8yb3nG8bStvBa+db17LVDfwKywnB0V 5xBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6RNtnbps7gTMIhv7bEWCrO2YabzJMAxWYJuKrPvSZuI=; b=kphI6MHfTNKJ/+1FS7zLmAd4SKb2j2zDWOfepOVJ9esxpeIeI59+4TbnlQbUV1T/ZL NF64mNERJm7wPKecDmVEuStjlt0j731Mfp4M6hbG8q9gfb9A0Y9g5KrJgppWIarViNk0 FbQtpcAEaNVWKK58uIFkpvOeVb8d38vLUWVAqelt/cA6I7r/0YGj79sfJB39gBt5AsMC mMc+FShZmnjU5WMhMwTZQVcI9oYRWTuMKJFR/Sa1/SAjRnLTEOVybhpXDuzOZq6YoD1T jX2jml+0uPhz1Oe7s7czbZ5lP1zsDGbhaTTFgNCtnl2JHr0lkemRVKDFjrtUi5h39Hxz K3uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oHt5JgAG; 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 cr15si307711ejc.258.2021.06.07.08.28.15; Mon, 07 Jun 2021 08:28:38 -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=k20201202 header.b=oHt5JgAG; 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 S230254AbhFGP3F (ORCPT + 99 others); Mon, 7 Jun 2021 11:29:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:35828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230212AbhFGP3E (ORCPT ); Mon, 7 Jun 2021 11:29:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D884461159; Mon, 7 Jun 2021 15:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623079632; bh=PmI+g6d05m0O1sqZS4bQGeSBmZdKbeu/jEjTNOkKCYQ=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=oHt5JgAGzA238x0WeyI4F9gAMj3YSneDaQjSKfEyPbjJh28qL6IajagjMr3ToutrF roYSM2gIMvKWeXJMdRfwfBCf25YMHRPvwJjTFnoaDWEyOdscbggyQZzc3glQMbwvSp /WQdZnB1/PUMLno/OY50ga9ltb1JdG68204vhmqG8f48VzhXHEhfTM9QcbRNmlvetQ tEZh/LIhGHH10fR1xoFHwl2nDaE/nPLCz2GoO1FNgIkPOzJHprNX+eHy9GzAb+azN4 8RDA2PBiPmGTIf1r8ob656BQpIprsnpgIFhoT/IIXnbvClyatXfNGM7T8JPQJa4NlX BiTzmlZw0YpKQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B15AF5C0395; Mon, 7 Jun 2021 08:27:12 -0700 (PDT) Date: Mon, 7 Jun 2021 08:27:12 -0700 From: "Paul E. McKenney" To: Segher Boessenkool Cc: Linus Torvalds , Alan Stern , 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: <20210607152712.GR4397@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20210606012903.GA1723421@rowland.harvard.edu> <20210606115336.GS18427@gate.crashing.org> <20210606184021.GY18427@gate.crashing.org> <20210606195242.GA18427@gate.crashing.org> <20210606202616.GC18427@gate.crashing.org> <20210606233729.GN4397@paulmck-ThinkPad-P17-Gen-1> <20210607141242.GD18427@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210607141242.GD18427@gate.crashing.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 09:12:42AM -0500, Segher Boessenkool wrote: > On Sun, Jun 06, 2021 at 04:37:29PM -0700, Paul E. McKenney wrote: > > > > The barrier() thing can work - all we need to do is to simply make it > > > > impossible for gcc to validly create anything but a conditional > > > > branch. > > > > > > And the only foolproof way of doing that is by writing a branch. > > [ ... ] > > > > I am saying that if you depend on that some C code you write will result > > > in some particular machine code, without actually *forcing* the compiler > > > to output that exact machine code, then you will be disappointed. Maybe > > > not today, and maybe it will take years, if you are lucky. > > > > > > (s/forcing/instructing/ of course, compilers have feelings too!) > > > > OK, I will bite... > > > > What would you suggest as a way of instructing the compiler to emit the > > conditional branch that we are looking for? > > You write it in the assembler code. > > Yes, it sucks. But it is the only way to get a branch if you really > want one. Now, you do not really need one here anyway, so there may be > some other way to satisfy the actual requirements. Hmmm... What do you see Peter asking for that is different than what I am asking for? ;-) Thanx, Paul