Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2108192imm; Tue, 10 Jul 2018 13:26:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd0hHGqn3BS6O4rV1e2ufDVTLxsE9DQA+r/3M4TaBe+QWJfCcf9pc2FvwgjJyFUxvTdQi0z X-Received: by 2002:a62:3481:: with SMTP id b123-v6mr27164954pfa.4.1531254393574; Tue, 10 Jul 2018 13:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531254393; cv=none; d=google.com; s=arc-20160816; b=YSwVYC1pXzXLYgtT/Rlq5TWHSewXiq6RzXKfhDj48aBPCL1ziUZBr7QyqLofhyjsje bxw6tPbCKlae+UvdiBUcU+kmKyv6+qxjMsOv3DQyWLtc87TCck2OBDB/WPdgAvyfciPk vGlUNy596xJQHgQ0fbZMNZuEc10yyQNkWavoPjFx+jGF/ldGU8+zJjjj0e3BByXDug1x hToSS9MvX9PQc1P61GAH7LLvyVwwouvyvUd5wwNzmOLLiAwSR6HxczbZ03EW3M7mH58G 9dlGasPjzJ/uZb4knwo0IdH2QhqDtr6QvoakdWT52klznmR9PkHGSWjoaejPkNz7FZqF UZzQ== 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=qLL23h//YSM8uI8eADKR39d7MkAAlq2kPPc5Y/FR9J0=; b=nzgbt1rIrFzPYNYtwC6altEo2S7D8YbO0fzm8/Zz/xzLSe26Pd9sIu/6GSIdFef4AR R3O+KOR6IoqkUzMSTgLXODKqSHUCjVVc+zWFXmskuby3w+2X59+b6j+sGRyzY6bt7nPJ LOvMHKB349DX6OyWvRTKWn8YQcyzwqNcx92NNDmfhR4xFI0CEagHKROralFfXaTXWJMI gHh11leJAH62b9d14kxVyoSUbtjytK5/QGThjQiwWq/EjVsNDxjJ1oXbW7eQItg+pijd fk6ivBW8aUaEOq16QUvgk2VzEcHBmOP2bYZ9yE7BIlLXDN+pTfQqj7y4SF/Q1W6nTJI1 DcoA== 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 d36-v6si17603995pla.484.2018.07.10.13.26.18; Tue, 10 Jul 2018 13:26:33 -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 S1732780AbeGJUZP (ORCPT + 99 others); Tue, 10 Jul 2018 16:25:15 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:34854 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1732246AbeGJUZO (ORCPT ); Tue, 10 Jul 2018 16:25:14 -0400 Received: (qmail 6900 invoked by uid 2102); 10 Jul 2018 16:24:34 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Jul 2018 16:24:34 -0400 Date: Tue, 10 Jul 2018 16:24:34 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Paul E. McKenney" cc: LKMM Maintainers -- Akira Yokosawa , Andrea Parri , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Will Deacon , Kernel development list Subject: Re: [PATCH v3] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire In-Reply-To: <20180710195853.GC3593@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, 10 Jul 2018, Paul E. McKenney wrote: > On Tue, Jul 10, 2018 at 02:18:13PM -0400, Alan Stern wrote: > > More than one kernel developer has expressed the opinion that the LKMM > > should enforce ordering of writes by locking. In other words, given > > the following code: > > > > WRITE_ONCE(x, 1); > > spin_unlock(&s): > > spin_lock(&s); > > WRITE_ONCE(y, 1); > > > > the stores to x and y should be propagated in order to all other CPUs, > > even though those other CPUs might not access the lock s. In terms of > > the memory model, this means expanding the cumul-fence relation. > > > > Locks should also provide read-read (and read-write) ordering in a > > similar way. Given: > > > > READ_ONCE(x); > > spin_unlock(&s); > > spin_lock(&s); > > READ_ONCE(y); // or WRITE_ONCE(y, 1); > > > > the load of x should be executed before the load of (or store to) y. > > The LKMM already provides this ordering, but it provides it even in > > the case where the two accesses are separated by a release/acquire > > pair of fences rather than unlock/lock. This would prevent > > architectures from using weakly ordered implementations of release and > > acquire, which seems like an unnecessary restriction. The patch > > therefore removes the ordering requirement from the LKMM for that > > case. > > > > All the architectures supported by the Linux kernel (including RISC-V) > > do provide this ordering for locks, albeit for varying reasons. > > Therefore this patch changes the model in accordance with the > > developers' wishes. > > > > Signed-off-by: Alan Stern > > It now applies, thank you very much! > > Is this something that you are comfortable pushing into the upcoming > merge window, or should I hold off until the next one? Given the concerns that Andrea raised, and given that neither Peter, Will, nor Daniel has commented on v.3 of the patch, I think we should hold off for a little while. Alan