Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2742994pxj; Sun, 6 Jun 2021 12:25:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwF0nAcJTRTXrKvYzdf185P/tjCr2UmaIg3dn+RTGCSwjoabRpeuMyqukjI0A6XXk5qq3Ww X-Received: by 2002:aa7:c913:: with SMTP id b19mr16024487edt.323.1623007519911; Sun, 06 Jun 2021 12:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623007519; cv=none; d=google.com; s=arc-20160816; b=uHpXUJi5XN6zZaqzhD9Mni+Go5cXxePNaDVIMqM6FV7y+n9Gnj/4KBweuUifc2+q3J r7sdkz3LJfpyki85WfqpQ8THgBzw2YgtgBUAYnspNOyjDu+grY8zn1ffIlEo5MNB+rsA oreCgb7WidXBF8q4onTz+4hwm4t8icOsfaNGjTxKCDVU/DUoW/mSDFUP8PhbI5qtySJX pDXSgfZb6p7gf6LCLQ9jTBSQ7/QDPC/STOhr/0U6QAYn/ANaCIvbOyf905xcRe+1NJ7c W3MXWIok+0YscTIUMbAR7GBdCYY2lN7G09iPAVI4jjLI7YDCC/MsEQMDrxVGnXBlFxz1 X7YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SxzQ9kXsLpYpGaBDNbZGNnlILKugyXAISeA2/rdzd6k=; b=NI4OvdtxopiBlmcG+IP+Oa4/8W+NLJZCH/sur+CQheZAPaHhKAq3Ctno/7i2duuHDg O+Q38jdkWoMdZHzQu+b4fjCiPd6MS4JoNQoEMo0wYw8Hnbj+Cbhll+DyfVR6c6Hw05x2 XW2ZqZY+tWNGUQC95jky9LU9pXcJoCyQR4O8bwOEOYHMtNd3A7zFdMx3QNIgo1qvh0Ig Gtr39OGAdzm0J9qRjrsC5PGM2ZZdZyfD9CgW2hjoa6pYKiTyGyQeXkTXyk2ay6QxELhC BWiT7P9tBK3ygJsXGpuODn+ojTRrXrD+TeyQ84ifJBCCrne/CgeTRo1Rm0/t/SvRyYdW n2Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HxIYzEou; 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 j24si9302207ejo.639.2021.06.06.12.24.57; Sun, 06 Jun 2021 12:25:19 -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=@linux-foundation.org header.s=google header.b=HxIYzEou; 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 S230128AbhFFTZO (ORCPT + 99 others); Sun, 6 Jun 2021 15:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbhFFTZN (ORCPT ); Sun, 6 Jun 2021 15:25:13 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4DBC061787 for ; Sun, 6 Jun 2021 12:23:10 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id v8so22398851lft.8 for ; Sun, 06 Jun 2021 12:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SxzQ9kXsLpYpGaBDNbZGNnlILKugyXAISeA2/rdzd6k=; b=HxIYzEoug2HZb7ZqR/KRiqAwIk7rncw5YLe1/7eduA90vqFUIDVWcI9D3JZejt77sN T69H48eefkSR15ldviHrWBCMVFE2lB5hCWH8whL1cEmmIu6Ujv/RNLwnp7jVoWdMGZ4i ZV3dofdUOCvm4jTYUiLHeIGrvq/KEAZeyZygs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SxzQ9kXsLpYpGaBDNbZGNnlILKugyXAISeA2/rdzd6k=; b=pFLGFehwszDM/55G2B686Y7SaIR80GCSskCkcGGydHKRY9AeJfhoSNYypthi4z9uIn WrTwRhNGN84ZXuz//yp1CFWwbDW7fj/G3Y/Evxx39pmtb4H5QaoLYWsSUiCW6Et2XLJj H6cb7+Ec8pbi1wOcIse5+rfSMk2s2t3xrJnCA/5PVWQqud42ML2XNXCIpmWkFshHfxAi G3zMDMyljm2TlX/YscPNmhfnKCSf5rAcZVJIEncS9QLLxPd/RhdXIKuZqldyBnK35VwW 8jMxEx+nx88gJFdbgUlncNG74R9eX+SgKC9iTJOg1tS5Br9j4h5H3nnOXutxCfqWG8H1 xprg== X-Gm-Message-State: AOAM533reosBbNdc2JP/i5tQjiX1hlmFwoniCOC6Ubvqfg190+8rmV8I eNTCk8LSsW76jOW8zHM+vYJ0Ohm4h2kbGQ6HHNE= X-Received: by 2002:a19:d601:: with SMTP id n1mr9433615lfg.481.1623007382074; Sun, 06 Jun 2021 12:23:02 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id r7sm1499790ljc.113.2021.06.06.12.23.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Jun 2021 12:23:01 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id o8so19043523ljp.0 for ; Sun, 06 Jun 2021 12:23:01 -0700 (PDT) X-Received: by 2002:a2e:c52:: with SMTP id o18mr11849195ljd.411.1623007380966; Sun, 06 Jun 2021 12:23:00 -0700 (PDT) MIME-Version: 1.0 References: <20210604205600.GB4397@paulmck-ThinkPad-P17-Gen-1> <20210604214010.GD4397@paulmck-ThinkPad-P17-Gen-1> <20210605145739.GB1712909@rowland.harvard.edu> <20210606001418.GH4397@paulmck-ThinkPad-P17-Gen-1> <20210606012903.GA1723421@rowland.harvard.edu> <20210606185922.GF7746@tucnak> In-Reply-To: <20210606185922.GF7746@tucnak> From: Linus Torvalds Date: Sun, 6 Jun 2021 12:22:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] LKMM: Add volatile_if() To: Jakub Jelinek Cc: Alan Stern , Segher Boessenkool , "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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 6, 2021 at 11:59 AM Jakub Jelinek wrote: > > I think just > #define barrier() __asm__ __volatile__("" : : "i" (__COUNTER__) : "memory") > should be enough Oh, I like that. Much better. It avoids all the issues with comments etc, and because it's not using __COUNTER__ as a string, it doesn't need the preprocessor games with double expansion either. So yeah, that seems like a nice solution to the issue, and should make the barriers all unique to the compiler. Linus