Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3891436ybv; Sun, 16 Feb 2020 08:17:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzkKJIHg44jLANuiR8cABW7m9oZ2fiznQ9ZqxQUfq/A5Ke2cm5+a6c8vQSNJV5FQF2UdCUo X-Received: by 2002:a9d:171a:: with SMTP id i26mr4988407ota.202.1581869827185; Sun, 16 Feb 2020 08:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581869827; cv=none; d=google.com; s=arc-20160816; b=uMs6FK0Qz2VttD3Wv91tgpmo6x8n08aVfdIYsCKmCvrnPgaG7DWRHiUcpxCW1RyL6k J8Nean4pzku4ULHGg7L0k1Da5rULdsMW8EoJds4VsNwtt7HKuXZtxU0YgMT5ONC30ZDe vvdYRGkiSLk9PtV5dAx8do2Kt5huq9WZaO3WgZdjDz/AcjVJjKTjWumnjYc2wKLszJs9 GNmePWPoA6CZIMIDPojlINib8D9ch4O2Hz6zcHKE8QSi0vmqt+I33lPNYnFYx8tIUZAC DYM5SleN/06Zx+xnwd0Q4e/kponVmENiywdIwcrVoAuod4VrF6NYe1qn9z/RbyAzyaMZ kA8A== 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; bh=/MlzgwBW2yXqhhe8p4Q7w38WhHhbzkiUxLCYlieYEGk=; b=PzO/e36R0DS9I2i0qZp5Bi+sVGN+tlB0xWYSWMSSNJUbPNwA7vtNQ8zNCaCIAGN3LI hTrIO1KQiK0EWMV6+wmKdvT642GkQsw8GweihJ+v6IKUyr7VVJMRhVoTxhl2bs2dZ4GO SXXmqpmjK+2hF0dnSKCxUff6BrIF75EVn03useIlO3G9Mq67cMU24SnvwSYwEVfbLfXp YhEH0A9v+dDo3RM2zjXwfopdrMdBluDO1Aytt+GBHBU/esTB28zxS49yUMY5IXgZTTIP K9nPs4J4u44si89Wg2qsj8Ohc93kA/bF1ctwbgc+Pf70k9K9jpGOGg/8AIgz+eyfy1ur oVuA== 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 r22si5661483otn.192.2020.02.16.08.16.54; Sun, 16 Feb 2020 08:17:07 -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 S1728423AbgBPQQw (ORCPT + 99 others); Sun, 16 Feb 2020 11:16:52 -0500 Received: from netrider.rowland.org ([192.131.102.5]:47093 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728239AbgBPQQv (ORCPT ); Sun, 16 Feb 2020 11:16:51 -0500 Received: (qmail 31448 invoked by uid 500); 16 Feb 2020 11:16:50 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 16 Feb 2020 11:16:50 -0500 Date: Sun, 16 Feb 2020 11:16:50 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: "Paul E. McKenney" cc: Boqun Feng , , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , , Subject: Re: [RFC 0/3] tools/memory-model: Add litmus tests for atomic APIs In-Reply-To: <20200216120625.GF2935@paulmck-ThinkPad-P72> 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 Sun, 16 Feb 2020, Paul E. McKenney wrote: > On Sun, Feb 16, 2020 at 01:43:45PM +0800, Boqun Feng wrote: > > On Sat, Feb 15, 2020 at 07:25:50AM -0800, Paul E. McKenney wrote: > > > On Fri, Feb 14, 2020 at 10:27:44AM -0500, Alan Stern wrote: > > > > On Fri, 14 Feb 2020, Boqun Feng wrote: > > > > > > > > > A recent discussion raises up the requirement for having test cases for > > > > > atomic APIs: > > > > > > > > > > https://lore.kernel.org/lkml/20200213085849.GL14897@hirez.programming.kicks-ass.net/ > > > > > > > > > > , and since we already have a way to generate a test module from a > > > > > litmus test with klitmus[1]. It makes sense that we add more litmus > > > > > tests for atomic APIs into memory-model. > > > > > > > > It might be worth discussing this point a little more fully. The > > > > set of tests in tools/memory-model/litmus-tests/ is deliberately rather > > > > limited. Paul has a vastly more expansive set of litmus tests in a > > > > GitHub repository, and I am doubtful about how many new tests we want > > > > to keep in the kernel source. > > > > > > Indeed, the current view is that the litmus tests in the kernel source > > > tree are intended to provide examples of C-litmus-test-language features > > > and functions, as opposed to exercising the full cross-product of > > > Linux-kernel synchronization primitives. > > > > > > For a semi-reasonable subset of that cross-product, as Alan says, please > > > see https://github.com/paulmckrcu/litmus. > > > > > > For a list of the Linux-kernel synchronization primitives currently > > > supported by LKMM, please see tools/memory-model/linux-kernel.def. > > > > > > > So how about I put those atomic API tests into a separate directory, say > > Documentation/atomic/ ? > > > > The problem I want to solve here is that people (usually who implements > > the atomic APIs for new archs) may want some examples, which can help > > them understand the API requirements and test the implementation. And > > litmus tests are the perfect tool here (given that them can be > > translated to test modules with klitmus). And I personally really think > > this is something the LKMM group should maintain, that's why I put them > > in the tools/memory-model/litmus-tests/. But I'm OK if we end up > > deciding those should be put outside that directory. > > Good point! > > However, we should dicuss this with the proposed beneficiaries, namely > the architecture maintainers. Do they want it? If so, where would > they like it to be? How should it be organized? > > In the meantime, I am more than happy to accept litmus tests into the > github archive. > > So how would you like to proceed? I think it makes sense to put Boqun's tests under Documentation/ rather than tools/. After all, their point is to document the memory model's requirements for operations on atomic_t's. They aren't meant to be examples or demos showing how to use herd or write litmus tests. Alan