Received: by 10.223.185.116 with SMTP id b49csp898001wrg; Wed, 21 Feb 2018 08:41:20 -0800 (PST) X-Google-Smtp-Source: AH8x227pFr/4gCaN+E7CB8jF+2dvVJxnHV2MplZkP4a6dCHiPJlFpF/Lq/foHSB8eOGh21ZjlIk2 X-Received: by 10.99.5.197 with SMTP id 188mr3186237pgf.196.1519231280342; Wed, 21 Feb 2018 08:41:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519231280; cv=none; d=google.com; s=arc-20160816; b=wQEYUegNG0mHwngPk+9WCnnyx1f9GaoLjUhmqy1UwEuMmgaIoLd/F9FPpQFGoBL8of LTLvfqDOaXWFZTKHTrTtqbypPQ1d3esPRlTDKxricDukop18inarRLYKQTJHsSOLazmB 6IcQz/ir3v7ofK5yexJeyYWtLbFSQRiz3QEufkgPG5x9lmxwT7n6o1q8YyCfpmoAd8cU RkSUZUYlyqxtEENDvf7Iq+DPw8C6BLZfg1QEaAo7cDcZcM1Np+UmWpx78VJAuxjytydy wWIe4UvfNvN+rFDgnsHkNyDBvMIUfIT4Fvb02W6Jqk4JNe1Ip1xO73EMKihYiZh1hus7 nZMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=/SCtzlJrzhUzV84AEmaMikfhCLF8P8T+OUYNrQM8g+Q=; b=Ge2OUvTC+eQ3e1geTooeODuc1l+oZq7+qaJFqM5Q2ih119a9dPFDrtQlnjRa4dHPUr TApHPFtuiggikAhafVvL5zath/tjEvrBPBGQt5EkvSSPMmQsvLNVXwod08jGaceVgrZj GGx4kTgtBgE3GBkOgfE/8+RPqjzAgGu8QVNfxUfmYL3OZMqmz2E21sc1EiEP4UEAaLNk u8sCD4Y1MRjLFwCAFTBXYJVR8lmudq9wry5y0weGy0SkK694ZxUJuRhkBrg1IbzQBlZU cfghI5YyTOYvutVEKKibkzTae7ffWUzpA81axzdFvT+5OXC00g6H0aoJg4FxtNLE8jXS t80Q== 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 k11si2439492pgq.254.2018.02.21.08.41.05; Wed, 21 Feb 2018 08:41:20 -0800 (PST) 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 S1753578AbeBUKoX (ORCPT + 99 others); Wed, 21 Feb 2018 05:44:23 -0500 Received: from terminus.zytor.com ([198.137.202.136]:36785 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751920AbeBUKoW (ORCPT ); Wed, 21 Feb 2018 05:44:22 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1LAhxLi002822; Wed, 21 Feb 2018 02:43:59 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1LAhxL8002819; Wed, 21 Feb 2018 02:43:59 -0800 Date: Wed, 21 Feb 2018 02:43:59 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Alan Stern Message-ID: Cc: paulmck@linux.vnet.ibm.com, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, stern@rowland.harvard.edu, mingo@kernel.org, linux-kernel@vger.kernel.org Reply-To: peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, paulmck@linux.vnet.ibm.com, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, stern@rowland.harvard.edu In-Reply-To: <1519169112-20593-10-git-send-email-paulmck@linux.vnet.ibm.com> References: <1519169112-20593-10-git-send-email-paulmck@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] tools/memory-model: Add a S lock-based external-view litmus test Git-Commit-ID: 556bb7d252ae42d4653557325670e665087c38ad X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 556bb7d252ae42d4653557325670e665087c38ad Gitweb: https://git.kernel.org/tip/556bb7d252ae42d4653557325670e665087c38ad Author: Alan Stern AuthorDate: Tue, 20 Feb 2018 15:25:10 -0800 Committer: Ingo Molnar CommitDate: Wed, 21 Feb 2018 09:58:15 +0100 tools/memory-model: Add a S lock-based external-view litmus test This commit adds a litmus test in which P0() and P1() form a lock-based S litmus test, with the addition of P2(), which observes P0()'s and P1()'s accesses with a full memory barrier but without the lock. This litmus test asks whether writes carried out by two different processes under the same lock will be seen in order by a third process not holding that lock. The answer to this question is "yes" for all architectures supporting the Linux kernel, but is "no" according to the current version of LKMM. A patch to LKMM is under development. Signed-off-by: Alan Stern Signed-off-by: Paul E. McKenney Acked-by: Peter Zijlstra Cc: Linus Torvalds Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: nborisov@suse.com Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/1519169112-20593-10-git-send-email-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- ...ce.litmus => ISA2+pooncelock+pooncelock+pombonce.litmus} | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus b/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus similarity index 55% copy from tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus copy to tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus index 10a2aa0..7a39a0a 100644 --- a/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus +++ b/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus @@ -1,11 +1,11 @@ -C Z6.0+pooncelock+pooncelock+pombonce +C ISA2+pooncelock+pooncelock+pombonce.litmus (* * Result: Sometimes * - * This example demonstrates that a pair of accesses made by different - * processes each while holding a given lock will not necessarily be - * seen as ordered by a third process not holding that lock. + * This test shows that the ordering provided by a lock-protected S + * litmus test (P0() and P1()) are not visible to external process P2(). + * This is likely to change soon. *) {} @@ -31,10 +31,11 @@ P1(int *y, int *z, spinlock_t *mylock) P2(int *x, int *z) { int r1; + int r2; - WRITE_ONCE(*z, 2); + r2 = READ_ONCE(*z); smp_mb(); r1 = READ_ONCE(*x); } -exists (1:r0=1 /\ z=2 /\ 2:r1=0) +exists (1:r0=1 /\ 2:r2=1 /\ 2:r1=0)