Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3948104yba; Tue, 9 Apr 2019 08:03:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyxegj3IjqEbUSigpO5O11mcYYmXKnW9z7OQYcRbgH1px8z7ObgeVbtzS5tLHobX2Oo78a X-Received: by 2002:a17:902:a506:: with SMTP id s6mr36343771plq.164.1554822207762; Tue, 09 Apr 2019 08:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554822207; cv=none; d=google.com; s=arc-20160816; b=MjeOOKcILUHdt7Vn9w0hLOxu28NSB95QIjAkp3Q9Mk6OiJbYBWgaBQSBAWhAvcfX2b 16u6EfMgE+UyjDLWn9b1tEeLu5UsQGH/ADegEFwMM9Wh4u8kk2PJFxZdlS2ui56gYUcQ 0e1TRMC9yu0BcFcBh2Q0WcOiGUMwh6d45apsRLU0xIx7s9tTSyK3s3zBR8mQAInTmJoW 3rWzTGeNWwS7a9AgQgpMemiX7OU6eMueD7P0BWDjg3n8qDOMosuzDPKJPcekhepfEG2s qH2xSxc/Nt1tlG0OLdTDhBarLo2qF0rmY6yH4i/II7ij0pEm3GxHaR3DcNhe6Jnxe1HZ ODHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=7XKksEqWydQ8TYgvWrJHFcLliJxLmnLLBjJmCB4UGEw=; b=HiJGPRSXs+QUt15wDambXhm2hDOZrTiImoODY0r6O2W7e9bRQb6YniTVEZgjyhdzqy SukS8jpg9B8T6Ujjx0uQ3Vv+XRlOr9DvJy051Z5UwHeFMy4zg55TT+A1DNdfHL/z1QBe 4BGibqF14WIhrX0TisdCvOWZ8ZJb2+ioC3HOk6iHoGr905Ysu7DsKbKMfKJ/dMX8Goub h673x1GaEt5u5ZtaOfDlD6yG94UIqCTS6BM9Japq5waFnc+67lfdg9ozPX76ez8q4ggb dvcPZ0YCKCu+9IH97hTr3igudgOc3z1cASGISSbCoAC1Ah1ww85gTlsWqoN0KTRIleZ0 Vh9A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si26165849pgq.213.2019.04.09.08.03.10; Tue, 09 Apr 2019 08:03:27 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbfDIPBn (ORCPT + 99 others); Tue, 9 Apr 2019 11:01:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53070 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726372AbfDIPBm (ORCPT ); Tue, 9 Apr 2019 11:01:42 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x39EuQfX131763 for ; Tue, 9 Apr 2019 11:01:41 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rrv9rvwth-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 09 Apr 2019 11:01:38 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Apr 2019 16:01:37 +0100 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 9 Apr 2019 16:01:32 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x39F1VTv27787500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Apr 2019 15:01:31 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59F1CB2071; Tue, 9 Apr 2019 15:01:31 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3AC18B2064; Tue, 9 Apr 2019 15:01:31 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.188]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 9 Apr 2019 15:01:31 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 3AD7516C3620; Tue, 9 Apr 2019 08:01:32 -0700 (PDT) Date: Tue, 9 Apr 2019 08:01:32 -0700 From: "Paul E. McKenney" To: Andrea Parri Cc: Alan Stern , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Will Deacon , Daniel Kroening , Kernel development list Subject: Re: Adding plain accesses and detecting data races in the LKMM Reply-To: paulmck@linux.ibm.com References: <20190408055117.GA25135@andrea> <20190409013618.GA3824@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190409013618.GA3824@andrea> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19040915-0060-0000-0000-0000032A8347 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010896; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000284; SDB=6.01186627; UDB=6.00621498; IPR=6.00967387; MB=3.00026363; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-09 15:01:36 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040915-0061-0000-0000-000048E38D87 Message-Id: <20190409150132.GB14111@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-09_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=481 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904090094 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 09, 2019 at 03:36:18AM +0200, Andrea Parri wrote: > > > 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. But don't all implementations of smp_mb__before_atomic() and smp_mb__after_atomic() currently supply a compiler barrier? Thanx, Paul