Received: by 10.223.185.116 with SMTP id b49csp807856wrg; Tue, 20 Feb 2018 08:11:57 -0800 (PST) X-Google-Smtp-Source: AH8x2272+23/SLFIJ6cENUvxWsX8rtxS5PA+NH6bIdZmtRCAfBm0LJ9PTbeSReonyZKU9XxPiXoj X-Received: by 2002:a17:902:a512:: with SMTP id s18-v6mr123376plq.296.1519143117539; Tue, 20 Feb 2018 08:11:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519143117; cv=none; d=google.com; s=arc-20160816; b=LgMUDkmjXSivuxk10ksEsOBaDupVM3ub2KJAsRro5rBi/NopNQAXt4BNA+r71rpsO4 8B8uSE9apm448fFKaYB4QBIU9zpIE3FrD8MRQaZ4ErfBFRaYPBkrQocLqgeGYSV/7GO2 iaZAmpk+LhVZmQ6QaRpf2UeYZFy7LQB9gXuV+FRCHoIXZVCS153SJJ23kzThXVzTtWcy v28Ea5V/LbS3jQCHHDORI9abf+Sb19UED6NjNzxsWHEcNDZu98GoqOyznyE3GffiXx5T 9vw6OxAnxsdXYcuH7WeKMPYSKfT/2UJ7Cqye1NijuZEJ4NF+rbpbFalIsUuWEGSWC2sS 9vXg== 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:arc-authentication-results; bh=e7S0ZUCBSEy8dWm/2JGyVtbIzvTBEpLvsF+qZZmxJv4=; b=Us7HdzLgEVY0L9d+shv0y5ZYowrrd8M4tvaLZS1+btUcOi9AH6g3zBHs9/FjcSMVNJ FGJvMc1uYTUGO3EVJr7RITXMXSa0AIM9Bt4Wjbhb13OzrnUAk4ZkReQT6t9pCS8UY0M4 Zqy3/GwLmGx/mYu8o7UHTdqoMPvcfKRqov392UqVMnkTlU6FcGGVcACWqAXpg0PHzT9I TtkZ5bbrfl21+CbsNje1ISJt1JpxnYPMXJo8A18q5cpFjPH6q0EHyeBEK44Jo2+V9BuB FIxXUb4RYyJoysrgsNJcAwqnSMTnKliqqdcurOMooZZYekovlyOB5rfBHhot6Esv7n3E IdvA== 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 r69si4904529pgr.678.2018.02.20.08.11.42; Tue, 20 Feb 2018 08:11:57 -0800 (PST) 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 S1752765AbeBTQK5 (ORCPT + 99 others); Tue, 20 Feb 2018 11:10:57 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46264 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbeBTQK4 (ORCPT ); Tue, 20 Feb 2018 11:10:56 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1KFxpZr132418 for ; Tue, 20 Feb 2018 11:10:56 -0500 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g8m3xgf8q-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 20 Feb 2018 11:10:55 -0500 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Feb 2018 11:10:53 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 20 Feb 2018 11:10:48 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1KGAmYq43974832; Tue, 20 Feb 2018 16:10:48 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96EF1B204D; Tue, 20 Feb 2018 12:13:06 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.85.154.79]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 5B5E1B2056; Tue, 20 Feb 2018 12:13:06 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id D5F8D16C2E7F; Tue, 20 Feb 2018 08:11:10 -0800 (PST) Date: Tue, 20 Feb 2018 08:11:10 -0800 From: "Paul E. McKenney" To: Andrea Parri Cc: Peter Zijlstra , Alan Stern , Akira Yokosawa , Kernel development list , mingo@kernel.org, Will Deacon , boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, Jade Alglave , Luc Maranget , Patrick Bellasi Subject: Re: [PATCH] tools/memory-model: remove rb-dep, smp_read_barrier_depends, and lockless_dereference Reply-To: paulmck@linux.vnet.ibm.com References: <20180217151413.GA3785@andrea> <20180219174413.GV25201@hirez.programming.kicks-ass.net> <20180220144813.GF3617@linux.vnet.ibm.com> <20180220151752.GA1900@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180220151752.GA1900@andrea> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18022016-0052-0000-0000-000002BB3856 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008564; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00992540; UDB=6.00504256; IPR=6.00771886; MB=3.00019657; MTD=3.00000008; XFM=3.00000015; UTC=2018-02-20 16:10:51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022016-0053-0000-0000-00005BC15ACF Message-Id: <20180220161110.GK3617@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-20_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802200200 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 20, 2018 at 04:17:52PM +0100, Andrea Parri wrote: > On Tue, Feb 20, 2018 at 06:48:13AM -0800, Paul E. McKenney wrote: > > On Mon, Feb 19, 2018 at 06:44:13PM +0100, Peter Zijlstra wrote: > > > On Mon, Feb 19, 2018 at 12:14:45PM -0500, Alan Stern wrote: > > > > Note that operations like atomic_add_unless() already include memory > > > > barriers. > > > > > > It is valid for atomic_add_unless() to not imply any barriers when the > > > addition doesn't happen. > > > > Agreed, given that atomic_add_unless() just returns 0 or 1, not the > > pointer being added. Of course, the __atomic_add_unless() function > > that it calls is another story, as it does return the old value. Sigh. > > And __atomic_add_unless() is called directly from some code. All of > > which looks to be counters rather than pointers, thankfully. > > > > So, do we want to rely on atomic_add_unless() always being > > invoked on counters rather than pointers, or does it need an > > smp_read_barrier_depends()? > > alpha's implementation of __atomic_add_unless() has an unconditional smp_mb() > before returning so, as far as dependencies are concerned, these seem fine. Very good! Thanx, Paul