Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1814323imm; Mon, 3 Sep 2018 10:07:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbM1xzt1tvTAQDKiUBS4MjF62g+y+KQB/2aC9TG8Y3/n1uu3zWGVhbb151Y0djqK4KWDSLO X-Received: by 2002:a17:902:82c5:: with SMTP id u5-v6mr29099798plz.83.1535994433494; Mon, 03 Sep 2018 10:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535994433; cv=none; d=google.com; s=arc-20160816; b=PLJUbVZePlc8NtrRKMEdBq5tz21lSO+vYfsgzRFAYUbi5MRreYjUQYMyjvbs+UN6+j QP3/2cBa8th9nfW/5BAmLdPvrz+/g5ZP/6G5FBhxRbU5lkU3Zu3cYLSyvj3s75t+h1kz PQTljhwyoJ14XXkFm0yf/hKlAF9GVViMPkSCOwplojZYQPggY6uC9Z+0NQvCcdTS4eNy ndmsPo/R0Th57mM73x/ZKSonIaJfyzo2puyh/ITQfjqcK7/FWv89x8DScHbJnXYa53Hw j0cw8jdDm4kL1RIKrLMjxsUfLzcS6syAZFOoHYumTwzvU0gswLdJNyyJPhOl0yXjDPnD e56w== 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:arc-authentication-results; bh=HF0HninqCIesVOpTJdF+JsgDHytL4WeUQS9kGnwAnQ4=; b=0wMAC46cyKheYnFLbZvZ2yjcacPZv0xtWXBJgdel6dvegDljkR1MJHF2bEYHRV+huu alQT3vySlrDZoXRJQktEklhunBmOvaJvURd2u3U48IsYFhHcGq4XZBQdnlsbj4Ns77x/ vmVEXZqOHTYCcHpHruLTopX7mekeQGA37pxvZ+xI0Yo7hNZTyT3Xt/m9bvh5fLp20pJv nwPuV5ksUoJhhVR9cW0oNp/UVlxy1WxZFVcJ9UNmnMxtfokQVv8MtFxNM2Rbsi2/ofJG FW/s/tdy40QbRQLtWmUrwAIv44odK8Y0bhAfGMfzoUScxerWU7Q60pVTE/QyKAAa00eE 1QHw== 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 o7-v6si16993927pgi.53.2018.09.03.10.06.58; Mon, 03 Sep 2018 10:07:13 -0700 (PDT) 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 S1729568AbeICV0i (ORCPT + 99 others); Mon, 3 Sep 2018 17:26:38 -0400 Received: from foss.arm.com ([217.140.101.70]:59256 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728032AbeICV0h (ORCPT ); Mon, 3 Sep 2018 17:26:37 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D4E5118A; Mon, 3 Sep 2018 10:05:36 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A6F033F5BC; Mon, 3 Sep 2018 10:05:36 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 69EC21AE3046; Mon, 3 Sep 2018 18:05:50 +0100 (BST) Date: Mon, 3 Sep 2018 18:05:50 +0100 From: Will Deacon To: Andrea Parri Cc: Alan Stern , Andrea Parri , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com Subject: Re: [PATCH RFC LKMM 1/7] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire Message-ID: <20180903170550.GM6954@arm.com> References: <20180831091641.GA3634@andrea> <20180831160640.GG30626@arm.com> <20180831182845.GA4673@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831182845.GA4673@andrea> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 08:28:46PM +0200, Andrea Parri wrote: > > > Yes, it's true that implementing locks with atomic_cmpxchg_acquire > > > should be correct on all existing architectures. And Paul has invited > > > a patch to modify the LKMM accordingly. If you feel that such a change > > > would be a useful enhancement to the LKMM's applicability, please write > > > it. > > > > Yes, please! That would be the "RmW" discussion which Andrea partially > > quoted earlier on, so getting that going independently from this patch > > sounds like a great idea to me. > > That was indeed one of the proposal we discussed. As you recalled, that > proposal only covered RmWs load-acquire (and ordinary store-release); in > particular, I realized that comments such as: > > "The atomic_cond_read_acquire() call above has provided the > necessary acquire semantics required for locking." > > [from kernel/locking/qspinlock.c] > > (for example) would still _not have "generic validity" _if we added the > above po-unlock-rf-lock-po term... (which, again, makes me somehow uncon- > fortable); Would to have _all_ the acquire be admissible for you? I think you've missed some words here, but if you're asking if I'd be ok strengthening all acquire operations, then the answer is no. See the huge amount of previous discussion. Will