Received: by 10.223.185.116 with SMTP id b49csp745420wrg; Tue, 20 Feb 2018 07:13:19 -0800 (PST) X-Google-Smtp-Source: AH8x225u95WxhoH1qmYfdQtU29/l2Pfkwix6Uvpuj7g5YXFwjOOPqK1/c2kyrKj8dVC/4mD/U++z X-Received: by 10.99.121.5 with SMTP id u5mr12910666pgc.444.1519139599235; Tue, 20 Feb 2018 07:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519139599; cv=none; d=google.com; s=arc-20160816; b=W/R786+ISN/3g3bDmYP5h5hvT3Ew1fDIPEdChtm6Td/1+fwuLQ91XASEUtR3x3AKjr DYHF/4prkVMLLT1SZSw1vlLMA9qpXzkiIxxy8KhYhyRcf+kKtinnwpTNuos/jMAEBLJ0 bNfcOZ35BPIPRqVwdo/caK7Es2ScxAKOrRLnfZnQJikfsmV2bXgtv1jFNWG1JvtHcVZW VEpDBEzzYDPIJIvIV4ihGPukdpmCld65i7rVlGStPdmhZYwh7KH0PfVHlfIj/TVVjzV7 O7olwaCKVEMMT7BYcV9tUl91uMaYgakc1Fc/R5v2lalOFVcZlITbvAvJN4NGIPHSgeQt Q7sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=BHDOmQQAvbo5HTvljEE5HIbjcKbv7YcrZi0VSX3sR6I=; b=BUp0xVteDDNUR/Cb/OUuhUixIgrbYCqhV4eu8tLZXU9JyE21HWrrIgoK9nbdEgyBym qFdqoRz8BwhFXNGEJMcHTVNObKo03zQLPf535dveR/R/8CnGUClIH7boXXUG5mZj3bq1 OMDyDEiXF/BBKChjXez+/OPgXKwqogBAB5T7cqj6T6wyiyW7HK+peoxvLH63K5tcFBOQ 70b0nyXwIlTbsSbEwP4DZ9/rdDd84gSdjja+wg3Mj2O5b7XsBRhdEGAgLiTC08lxYToG vOMGBEx1HySwhLbIbiMuiaSJnNmhcUOZskOvgdviYDfHoqd8wL6lGsqZht5y7MiYHzgE iOkA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a18si5097057pgn.669.2018.02.20.07.13.02; Tue, 20 Feb 2018 07:13:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752212AbeBTPLI (ORCPT + 99 others); Tue, 20 Feb 2018 10:11:08 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:58930 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751973AbeBTPLH (ORCPT ); Tue, 20 Feb 2018 10:11:07 -0500 Received: (qmail 2034 invoked by uid 2102); 20 Feb 2018 10:11:06 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Feb 2018 10:11:06 -0500 Date: Tue, 20 Feb 2018 10:11:06 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Paul E. McKenney" cc: Peter Zijlstra , Andrea Parri , Akira Yokosawa , Kernel development list , , Will Deacon , , , , Jade Alglave , Luc Maranget , Patrick Bellasi Subject: Re: [PATCH] tools/memory-model: remove rb-dep, smp_read_barrier_depends, and lockless_dereference In-Reply-To: <20180220144939.GG3617@linux.vnet.ibm.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Feb 2018, Paul E. McKenney wrote: > On Mon, Feb 19, 2018 at 09:28:44PM +0100, Peter Zijlstra wrote: > > On Mon, Feb 19, 2018 at 11:41:23AM -0800, Paul E. McKenney wrote: > > > On Mon, Feb 19, 2018 at 12:14:45PM -0500, Alan Stern wrote: > > > > This leaves us with a question: Do we want to change the kernel by > > > > adding memory barriers after unsuccessful RMW operations on Alpha, or > > > > do we want to change the model by excluding such operations from > > > > address dependencies? > > > > > > I vote for adding the barrier on Alpha. However, I don't know of any > > > code in the Linux kernel that relies on read-to-read address dependency > > > ordering headed by a failing RMW operation, so I don't feel all that > > > strongly about this. > > > > Right, but not knowing doesn't mean doesn't exist, and most certainly > > doesn't mean will never exist. > > Fair enough, safety first! > > > > > Note that operations like atomic_add_unless() already include memory > > > > barriers. > > > > > > And I don't see an atomic_add_unless_relaxed(), so we are good on this > > > one. So far, anyway! ;-) > > > > Not the point, add_unless() is a conditional operation, and therefore > > doesn't need to imply anything when failing. > > Plus it doesn't return a pointer, so there is no problem with dereferences. > Unless someone wants to use its return value as an array index and rely > on dependency ordering to the array, but I would NAK that use case. You may not get the chance to NAK it. We need to be consistent. Array indexing is indeed a form of address dependency, so either we assert that the dependency is enforced when the array index is derived from a failed atomic operation, or else we assert that failed atomic operations do not create address dependencies. Alan