Received: by 10.223.185.116 with SMTP id b49csp753014wrg; Tue, 20 Feb 2018 07:20:28 -0800 (PST) X-Google-Smtp-Source: AH8x225KyAdxLtZNa2wdbY504jMgaati9nbTs1xTk4YrBAluALtIJeVOvTSEWnPIIAxHh25Fncjc X-Received: by 2002:a17:902:5716:: with SMTP id k22-v6mr18115895pli.229.1519140028183; Tue, 20 Feb 2018 07:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519140028; cv=none; d=google.com; s=arc-20160816; b=bH9X2D0/+BmyjT6m5dLCdqAkLSow/LrPXpOZRrqD85+OyAyrS8z/ht8VOq/pZbytce P6o3bKANFJz2cK1hbsuyUTLT/Chi53uJPCtOSOkJO+dMwvEIHRh0Zwmnqg37IdfawhrB CDZHmj2I3EBCDMSaioeqCVEgjao/2NxLyauk4JzbnpcM4oMxtvwCtux0Ff9u2bHDC3aQ HM6WlY65oMZyldzblkK5JGjyibiNicmX+gpVXJdMg2FMDYJlscZRVsEOpxKgJz5LIB95 utgIm9lVxtuf/zkj14Fhsj8v/iZcXfqxx1zNBxCuz2lc3Aqz18HDeSSz5PK0bKnnbnnf kVMQ== 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:arc-authentication-results; bh=+TLylIcYZlYkr88VHRqh+ZGy+8Av9OqaQCxYdhrbqp8=; b=JqBotRzMIFjwcUzlh1CJLyrlejy0tnOABRyL5wu9zThphTH4KHSHaQMBECkNcbhJsV nyS1R+8Z4dmwclfuQXNrnwiPrgVn9wYgcbGAOTUhqz8ldmws+XPXCYVr3gFY41G9TDwd w9iWsd4rYZs4+GyTfK6Ot2bDOrQhKvzPZLEyPd/vU52Lndq3sOBK1pitL3xmf0oam1VD Mh4WYKkBFjHJ9n93O3XfC43cwqFGlMrEhjEuaP8AZlS0tdILltaop6uwIzuSgxfVoXhk LHbWC5mMsnUXk2T2TDauKDn69uc5QIWEwFuVl4rxfWMOVZ6T09YgFg3bhCUXDS/607Lr 8fpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mQpFxrT5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si858288pgv.163.2018.02.20.07.20.13; Tue, 20 Feb 2018 07:20:28 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mQpFxrT5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752612AbeBTPSD (ORCPT + 99 others); Tue, 20 Feb 2018 10:18:03 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34661 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbeBTPSA (ORCPT ); Tue, 20 Feb 2018 10:18:00 -0500 Received: by mail-wr0-f196.google.com with SMTP id m5so15428575wrg.1 for ; Tue, 20 Feb 2018 07:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+TLylIcYZlYkr88VHRqh+ZGy+8Av9OqaQCxYdhrbqp8=; b=mQpFxrT5OPyV4YE9R7Mdgm04AYMUIEXnIMCHK+WTJf0CcSKxxtBn52U2FnaCPFEuhT JO1gqyRJL4P6Vq92DSFX0tcl7qe4cGkBpfN9bYWBxla+2zHCttUp4xnNbJ3iyce/w+fI RicLP/aejNpTOZBzurr4iuDMuCPLV5qLmWs5NMoYggauPdTxYCni35suffU9auhFBzZH IoAdD0urEw+WXpPMuZpGuT8rS84Q/ZxRnSt7+DuHn1IjBXre0e+fCal/hvFCHzwDrHH4 VusIe/K+VS79JNNs1VHvXGYOKE65Woc+YVamZZBEUKPcDzWSeePRziREKU2RTlv857i2 b8Ww== 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=+TLylIcYZlYkr88VHRqh+ZGy+8Av9OqaQCxYdhrbqp8=; b=esTKLZBDSBKFIKK/2/haV/zwvY/3wVugLDptlqYb/oKA9GgTb2LhuejkXpw7bFua1Z 6JPjVmeA2+wyWAZfNRsiRCA8jLk9tChbCkaWssnE6A9hVQexxjh6sNbDInO8eUXKXbT9 IM0ymgY3NUIigcpioOPn7/j50iEy2aquPwcLAWELHVz0T3dwwV5Z4thgqtXf7FOIuw/n 8+/rXDNUMxbWYPU+v+9vXoEjxw9/MOHoCCkLaevMBkoPtGo3spu8ucWyqMDYcfs2Stst bYJZXJ5o7aNrDTLqwG17M8W7w8Hei8zm/hnsdBSesV89pCkWceNKBMrAk2g5UFDUskBd JtDw== X-Gm-Message-State: APf1xPBZFEtlme6hL9BAVdmyNcfa6+LNry5ltR+ijn+ssZgWav0gCANM hqY1hJeGfYlveVcwj7Ui5yA= X-Received: by 10.223.158.196 with SMTP id b4mr1331825wrf.112.1519139879502; Tue, 20 Feb 2018 07:17:59 -0800 (PST) Received: from andrea (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id v63sm41434517wrc.69.2018.02.20.07.17.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 07:17:58 -0800 (PST) Date: Tue, 20 Feb 2018 16:17:52 +0100 From: Andrea Parri To: "Paul E. McKenney" 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 Message-ID: <20180220151752.GA1900@andrea> References: <20180217151413.GA3785@andrea> <20180219174413.GV25201@hirez.programming.kicks-ass.net> <20180220144813.GF3617@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180220144813.GF3617@linux.vnet.ibm.com> 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 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. Andrea > > Thanx, Paul >