Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3404052yba; Mon, 8 Apr 2019 18:38:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKRYRlYdPDy4Pq+s24I0aKkLGX6Fq+g2LikegfYN8lJEJyLHgxsbt5Nvw5s9Uds97zqfi7 X-Received: by 2002:a17:902:22f:: with SMTP id 44mr30267304plc.175.1554773899278; Mon, 08 Apr 2019 18:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554773899; cv=none; d=google.com; s=arc-20160816; b=NLRyd84wO5vAd6yVQ3IjPRdSB+pGL5XwXhmAWTnjOJaGfTrc594Tk/48kr7n+KLLx7 t3OaGcHDE9oSwEbwgaLjIbFxU1RWh0/YknI6PfD1QLIrx1oIyA6ZnSQopKFT71wKvEe2 hpU9k+HNdcHkJxF4MydxjBkFVLE0Uzc2La1E5cp9lBum+Db3NcD3Zb9VwwSSVgPYvUCd O0WDdt96+AqzCu3fmcKnvWCbSUlZdEPc9QW5XRbf05npi9wojD3Nut18Dg6mX7MJwgdd uAoAAdSR0GWCb1tQABIv3SgtZJulCo+hRML9HhHE2A/DZ+1Zo1nDKX1XEu4SNDdeys9W p4gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MlsT9tOGZ2BXFxxEd8ABFVkuey5JJzy4naMf4YJabpY=; b=zpaVqNtILmackSJ3/oPapasRnlRyT8e4BefXHKp25Ykg2BlJN+btLh2uic5uAgannh jDRBtcIp8u6+4zt/NSvCEkaBiZrSp88Ea0WJihjJxecgKSQ158ORLeHJtdQhpOj3oB2j SOPzC8O3xT3BYGGE6GZ4d8IsQ6d9OQoAGMBlxSbqUijzK8hn/tVq+HOZ1F2+ymxjgcps mmffz9BcG8d+G3bzzAsoeKKVetlobBwMD9niwzn2VmjLtPAi5wCxM32fsC4rnP0bhLkd 4H2t55SaxfoSGu0V4mdDsNyXvN3W4rWqXwY7xNMRSLLzCvpGS4ILdRfoMxUY61sdWoYY mu/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JeKVTZ6x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63si29369935pfc.183.2019.04.08.18.38.03; Mon, 08 Apr 2019 18:38:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JeKVTZ6x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbfDIBgb (ORCPT + 99 others); Mon, 8 Apr 2019 21:36:31 -0400 Received: from mail-pg1-f182.google.com ([209.85.215.182]:44557 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbfDIBgb (ORCPT ); Mon, 8 Apr 2019 21:36:31 -0400 Received: by mail-pg1-f182.google.com with SMTP id i2so8304973pgj.11 for ; Mon, 08 Apr 2019 18:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MlsT9tOGZ2BXFxxEd8ABFVkuey5JJzy4naMf4YJabpY=; b=JeKVTZ6xNBJDl68tRoD8BANJBconB58a3lH69tJq3hhnLOWMZDT2FplobGhmTUPXkw uVksAcR6aXKWGtIRBppayNfW8//FiJuagerUeFF+7fontezlvjSgNFNWY/vouyUwK+ZJ Exmlabism4Jm/oiIsQwek2kgnmxHyiD2oWS6o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MlsT9tOGZ2BXFxxEd8ABFVkuey5JJzy4naMf4YJabpY=; b=AgjBQbPPTCP+jtgC+j38nFDZ3Xgr2D8bhFxuq7oaegovo3YqoWKmsR07w8NS6N2b4I 1brjCmsj54oQ27bYWfQI4WYS78ZwkWpN45N/lBoL+jxWLnF6X19PFDAagulB09Mar0X/ wy4t7At+Afevn9vgqCIGPwIoAvi9AsIZOX/E+SqgOM2twphhRDrP3smSFxU/3ckmRuro H0Y5p1CS143R0je1ruKnQ/6DVhU00wNgPqUhrVpbdJTptXr/vCuuX5eK3cnimMatoh80 uu2PTroibvO118OOtinf+KQbuzRjGFmtj+WU18Wyg3tsKz40cs8kqrVvRY3npEkrxTKt yL9g== X-Gm-Message-State: APjAAAUUKEc4UqWcJ1DsuVXSrPhm6XzPFn/17Xb1vlFnZg2foYx57eq1 2GEAVq84jfIRC6YRLPSQ8TB3FA== X-Received: by 2002:a65:6489:: with SMTP id e9mr31457965pgv.364.1554773790202; Mon, 08 Apr 2019 18:36:30 -0700 (PDT) Received: from andrea ([63.64.74.251]) by smtp.gmail.com with ESMTPSA id c189sm48181257pfg.24.2019.04.08.18.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 18:36:29 -0700 (PDT) Date: Tue, 9 Apr 2019 03:36:18 +0200 From: Andrea Parri To: Alan Stern Cc: LKMM Maintainers -- Akira Yokosawa , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , "Paul E. McKenney" , Peter Zijlstra , Will Deacon , Daniel Kroening , Kernel development list Subject: Re: Adding plain accesses and detecting data races in the LKMM Message-ID: <20190409013618.GA3824@andrea> References: <20190408055117.GA25135@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > The formula was more along the line of "do not assume either of these > > cases to hold; use barrier() is you need an unconditional barrier..." > > AFAICT, all current implementations of smp_mb__{before,after}_atomic() > > provides a compiler barrier with either barrier() or "memory" clobber. > > Well, we have two reasonable choices: Say that > smp_mb__{before,after}_atomic will always provide a compiler barrier, > or don't say this. I see no point in saying that the combination of > Before-atomic followed by RMW provides a barrier. ;-/ I'm fine with the first choice. I don't see how the second choice (this proposal/patch) would be consistent with some documentation and with the current implementations; for example, 1) Documentation/atomic_t.txt says: Thus: atomic_fetch_add(); is equivalent to: smp_mb__before_atomic(); atomic_fetch_add_relaxed(); smp_mb__after_atomic(); [...] 2) Some implementations of the _relaxed() variants do not provide any compiler barrier currently. Andrea