From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CA79C433E1 for ; Fri, 17 Jul 2020 14:26:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 480772070E for ; Fri, 17 Jul 2020 14:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbgGQO0e (ORCPT ); Fri, 17 Jul 2020 10:26:34 -0400 Received: from netrider.rowland.org ([192.131.102.5]:46107 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726198AbgGQO0e (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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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