Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp40276imm; Thu, 12 Jul 2018 13:44:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpceA+ZpKsgVgqkFwXfqZvDDOtd42601ZDYAfJPnivzLu5fG/RL0tGmMtOAlDOdO5ao50fMk X-Received: by 2002:a62:9b57:: with SMTP id r84-v6mr3965800pfd.6.1531428281820; Thu, 12 Jul 2018 13:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531428281; cv=none; d=google.com; s=arc-20160816; b=AlIld7uNKSrd9jBWouDyWmkXfmgyvhJjyM15/WH/RKJ/OJJKJ9DHR9ZcEVimPNGo4t ygd3zN215/dOKXV865G9ejcC6lZGhoP/CIYUkMdNpdl5rO5Kv+Tz5iuSiDJJhZcDrXmd JXLbcb7DOwRou9rywLdUZwlkQhuo3wQCCzTxA4Fzy5D4tRY462N9Wd3DQ04pTEqDHXIp n4IThAGFOE/IkJTqBR9dUUxXIMnMUdHWUJOE0Coot9IZR4AC+eLQ+Rh5dEeqH/mpofDP hNPZHJ573kNWeR9mxMkcViPyL/7JvKO5iF/dIYQmrdh1rsICdn02TmaaoenlWixuPSnN i06w== 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=AH++gJLJriqUPaHi0vKiLalRfW3TmdXG3t36rce3/K8=; b=BnURLGx2hGJnaS5ns3RCAai7I2kBezhv3rixbGZvr5I57Wiad04yG+tXpXm13l8yed 82iU+r5opp2WwGi89jL+EQFH36AzcLafMttHdE/OJdVoiqhDoWjSahr8/q7rX7R4Tya9 zTkS44dZU1zLngcQSi6GY7kWFMJpKV15TQugtFu4+XzxR/VjQ3RtUzxmN6I0lWSkOcAu B2nZhzAwyKSpxczBYUaEgw3nFilRKglLKJlN7p4FduY3b0vOJeU6aMjatAEeP4vuo669 M6BiJ9D4PdzvivXymgYLbhb3H6jK3G66edWBGKrifbzlbvpWuNm1hcyHhurUL5uP+WuL Z5Hg== 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 r25-v6si21226913pge.104.2018.07.12.13.44.25; Thu, 12 Jul 2018 13:44:41 -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 S1732461AbeGLUzB (ORCPT + 99 others); Thu, 12 Jul 2018 16:55:01 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:55156 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726966AbeGLUzB (ORCPT ); Thu, 12 Jul 2018 16:55:01 -0400 Received: (qmail 553 invoked by uid 2102); 12 Jul 2018 16:43:46 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 12 Jul 2018 16:43:46 -0400 Date: Thu, 12 Jul 2018 16:43:46 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Andrea Parri cc: Peter Zijlstra , Will Deacon , "Paul E. McKenney" , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Kernel development list , Linus Torvalds Subject: Re: [PATCH v2] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire In-Reply-To: <20180712175228.GB3533@andrea> 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 Thu, 12 Jul 2018, Andrea Parri wrote: > > It seems reasonable to ask people to learn that locks have stronger > > ordering guarantees than RMW atomics do. Maybe not the greatest > > situation in the world, but one I think we could live with. > > Yeah, this was one of my main objections. Does this mean you don't think you could live with it? > > > Hence my proposal to strenghten rmw-acquire, because that is the basic > > > primitive used to implement lock. > > > > That was essentially what the v2 patch did. (And my reasoning was > > basically the same as what you have just outlined. There was one > > additional element: smp_store_release() is already strong enough for > > TSO; the acquire is what needs to be stronger in the memory model.) > > Mmh? see my comments to v2 (and your reply, in part., the part "At > least, it's not a valid general-purpose implementation".). > > > > > Another, and I like this proposal least, is to introduce a new barrier > > > to make this all work. > > > > This apparently boils down to two questions: > > > > Should spin_lock/spin_unlock be RCsc? > > > > Should rmw-acquire be strong enough so that smp_store_release + > > rmw-acquire is RCtso? > > > > If both answers are No, we end up with the v3 patch. If the first > > answer is No and the second is Yes, we end up with the v2 patch. The > > problem is that different people seem to want differing answers. > > Again, maybe you're confonding v2 with v1? Oops, yes, I was. v1 was the version that made RMW updates be RCtso. v2 and v3 affected only locking, the difference being that v2 used unlock-rf-lock-po and v3 used po-unlock-rf-lock-po. Alan