Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4242077ybv; Sun, 16 Feb 2020 17:28:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxdhaZb5AeqHfFrseErQXjj1EGOuzEIPmFbap9ZaRFUv4di3uSIML2qzSIkpBTRzfCl6LqD X-Received: by 2002:a05:6808:8ee:: with SMTP id d14mr8136765oic.138.1581902886027; Sun, 16 Feb 2020 17:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581902886; cv=none; d=google.com; s=arc-20160816; b=Q0QHKevNTEsYtuVi9E+/8FZFXZlwIzatJ8bthyAASeJ8MKG6jaSou1le29fXBoUWMD dm6Rexe17oUuy+iiviVQfrrC2J6gUGIUA8ee5IIH2s2WOIqSK4LZ6OHw4nxa0/oN4hlL fuKWM0LxvjKZrrhn0XsEz1HfE+CR6zqknYNXms/vT8hWcBwGNWL1tfV6VMDtv1jUECfH Q41G8cVF0Fkly2GI23W2ZeowNvSPvXIz9EjP3imLvZZU+0rir3iNCIwu0NcgWtKeg/23 zAZZOsd2TzvoNjabjkGqhedI1CH5MxfHMhIV0IjdZp7ts1kUvZ8pY4gZSQTFul1HIzVz Qn7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=pIJUz3o4BsZGq1UIMsmYwN7b8ilICIwNhuoVh3JXiCY=; b=j/WfgDnnTdEsWRhzP+U0wlpwlJJNbu9RzXq5IRGeUW/tGAQyp01NRKPNL+3yWLcVEx KkPw0Qd6ScWckltD3stImtfNNad7QNAAwslNMFGhQpd9rZELNulmjFVU7we6K1cjbTn4 n3DfTkVr8j0l+Dw+nRtkBEYYPeU68pdsKAEFT64axwocdXXv+FMKNbGMrsb9ALzZa6xj ZOT/srq8TBYb7uXNR/gIpYDi8R0u46RsTmague3yi/2IncabsEufDhocYtzocmd21NTe Q/vaiKdkmJ4HVhcd55P8JIJMdNb9mjaQx0VoLHlyTwbBX5vUwoOhntDfTDWxn7eORyY7 G66A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ma+QHFqF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c130si6129664oib.182.2020.02.16.17.27.53; Sun, 16 Feb 2020 17:28:06 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ma+QHFqF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbgBQB1q (ORCPT + 99 others); Sun, 16 Feb 2020 20:27:46 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:34790 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbgBQB1q (ORCPT ); Sun, 16 Feb 2020 20:27:46 -0500 Received: by mail-qk1-f193.google.com with SMTP id c20so14780417qkm.1; Sun, 16 Feb 2020 17:27:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pIJUz3o4BsZGq1UIMsmYwN7b8ilICIwNhuoVh3JXiCY=; b=ma+QHFqFrc9AuZgbISiDDrvyIWMA/cPNT0roCMfoM/VrgPEp+1Ov/ODLR2agNyvKfy Nw2Ec225uxFgP3HH/MUGjKxYM3g43Xij/EDtCxdqxSVnIBX91JCBhzcLnur3sFa2+uU7 XgJX6360S1TQV0GB9M1ClN7McbZGoBI1uYyuD33KTeLE677m40YuET4kUnQymfKQ6hMp +QBrmBO5Sx2Rtn/kQxiiXoNxMgume4ktzsd5pwRfyqjpHU7X6PB1y/A/Fwz3GjACcnQz lySvxqze4lmVOlx3AbQywsKK0McifSwhoIEZQNQ8pavKoLCB3chNMIHkq21bb8WwrqnU Oe7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pIJUz3o4BsZGq1UIMsmYwN7b8ilICIwNhuoVh3JXiCY=; b=LM6XSoUcd7D296u5mW/2qSYRwyC0dp1RpsA/4oFuhiPJ18txpfaU+X0HQAqB67C43/ QPg0S36NLl2udzOphoozpw8YR49i2Vh6C0GskKb93RYKl9aPbmR9g9Vvjp56F8NmCx9w YK+MCn0hINjDq4sdoRVK3Jz5bpmvYpn3GmFUPAYEKz3nlOis3OCZgAUl/ahcO4lOlLUl j3hkPFt5jNtGbw2piBDqkDwYQM/XL2zQ4YrPML4GMnrHwNbKQwCOqDTNqmwrg7H2jMhX XkS50+KUkC6KLn9imQk+7Z4qNl07HKPOCl+y+8hJUrBQHdiRmm93IIrI4+l4hFr0LH/t Y29w== X-Gm-Message-State: APjAAAVpRpSFbJcYW4r8U02WxgM0e0RE5AaOka459tvZ7XMWiJpL8Jbw 7njQ+LxpkxWP5ljKwe5KeXg= X-Received: by 2002:a37:a08f:: with SMTP id j137mr12017923qke.467.1581902863525; Sun, 16 Feb 2020 17:27:43 -0800 (PST) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id z1sm8012011qtq.69.2020.02.16.17.27.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Feb 2020 17:27:42 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 302BD21CDA; Sun, 16 Feb 2020 20:27:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 16 Feb 2020 20:27:41 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeehgdeffecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucffohhmrghinh epkhgvrhhnvghlrdhorhhgpdhgihhthhhusgdrtghomhdpuggvfhdrshhonecukfhppeeh vddrudehhedrudduuddrjedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihht hidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrg hilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Received: from localhost (unknown [52.155.111.71]) by mail.messagingengine.com (Postfix) with ESMTPA id 0358F30606E9; Sun, 16 Feb 2020 20:27:35 -0500 (EST) Date: Mon, 17 Feb 2020 09:27:34 +0800 From: Boqun Feng To: Alan Stern Cc: "Paul E. McKenney" , linux-kernel@vger.kernel.org, Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , linux-arch@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [RFC 0/3] tools/memory-model: Add litmus tests for atomic APIs Message-ID: <20200217012734.GB69864@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> References: <20200216120625.GF2935@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 16, 2020 at 11:16:50AM -0500, Alan Stern wrote: > 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? > > Paul, Well, I was simply motivated by the discuss on microblaze's atomic implementation (which I pasted the link in this cover letter): https://lore.kernel.org/lkml/20200213085849.GL14897@hirez.programming.kicks-ass.net/ , please see the last paragraph, Michal asking Peter for some tests. So I think there is at least some one wanting this ;-) > > In the meantime, I am more than happy to accept litmus tests into the > > github archive. > > Thanks ;-) > > So how would you like to proceed? I think we are still at the discussion stage, so I'm happy to see suggestions on where to put the litmus tests and which litmus tests should be included. > > 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, Got it. I will create the Documentation/atomic directory and put the litmus tests there in the next version. Thank you both! Regards, Boqun > Alan >