Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2021109ybh; Fri, 17 Jul 2020 07:27:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwabJ9Z4nD2P9sZDFlPuBd1vbQRLqFeca5QVkF6nWNM7bwm1yzSykvb74X0zofkFDvPrgql X-Received: by 2002:aa7:d4c1:: with SMTP id t1mr9465624edr.253.1594996027683; Fri, 17 Jul 2020 07:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594996027; cv=none; d=google.com; s=arc-20160816; b=LDK0VFPpd/4nS614PY0Io4vvc+/YBttPnTc9u80fxP5oDg97wfstXW9fmbJ+ZyMwOG zizaLJIAEO3huhuE3OVfqQFOyQty4HUeiigleZlJPpI7Cch1++zchYe4xmk5pNkAuHIi J12xrlYwHIc6ONUNz0h5XyOHCMWhQdwMXjoOYmAe2uKgDNRWQ7LThH4U8A1JCbohrqHA WAK43OQJUslEZvhva8ulu4TnkjY8MSbe0FUibssjE0TAynNL4tGhwbTjE64jFT0A3Guy a4j1k0kP3J3eObT0hZ8H0ABxshZm6a9dXFbjy+8ixdVDWUY6i816BwgXVACnz3Nn8Mln 8Ryw== 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; bh=8Sa021ZB6WJ2VE+F+/IpJi207+rTP/aeohkJQIkX3Mk=; b=HsGdghTiQDaBARhs/X7ioY6VhcfrCCzLAK17Z4EqAyt66QSfXSLd1NCM5Ikyh3Kqdg fbEiCmdMBkb/zFCimqEFfMt3/AY473tmeCb1LgeLeFiNuYEPGB6tDoDFdPQMHHnHOwPG sWYKQuROudkclMN/3mDfzpsAb0VUQ7PK1jVp7cRYyeuncT5hJ8LJR8whIt3Q8xJsOUI0 uy/bMBpshesqKHAkbo8BlJjPeq9X/umOfD6C/2yU2CVQDFF1rcgbnHEe3r35wQDmSPWN Y5VrsQ6ddf1djIFue/7OVNSzQcGPmfl3boBSz8o4fjzqbocVH/bv5HYBz6MDNGxpXS9p guPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si5301410eds.105.2020.07.17.07.26.44; Fri, 17 Jul 2020 07:27:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726079AbgGQO0e (ORCPT + 99 others); Fri, 17 Jul 2020 10:26:34 -0400 Received: from netrider.rowland.org ([192.131.102.5]:33327 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726205AbgGQO0e (ORCPT ); Fri, 17 Jul 2020 10:26:34 -0400 Received: (qmail 1149272 invoked by uid 1000); 17 Jul 2020 10:26:32 -0400 Date: Fri, 17 Jul 2020 10:26:32 -0400 From: Alan Stern To: Eric Biggers Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, "Paul E . McKenney" , linux-fsdevel@vger.kernel.org, Akira Yokosawa , Andrea Parri , Boqun Feng , Daniel Lustig , "Darrick J . Wong" , Dave Chinner , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Will Deacon Subject: Re: [PATCH] tools/memory-model: document the "one-time init" pattern Message-ID: <20200717142632.GA1147780@rowland.harvard.edu> References: <20200717044427.68747-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200717044427.68747-1-ebiggers@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: ... > +Note that when the cmpxchg_release() fails due to another task already > +having done it, a second smp_load_acquire() is required, since we still > +need to acquire the data that the other task released. When people talk about releasing data, they usually mean something different from what you mean here (i.e., they usually mean deallocating). Likewise, acquiring data (to the extent that it means anything) would generally be regarded as meaning a simple read. I recommend changing the last phrase above to: ... since we still need a load-acquire of the data on which the other task performed a store-release. Alan Stern