Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp26365ybb; Fri, 27 Mar 2020 15:19:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuTNfgyVzxMYvm7FDrJSj3zUS8YzCpku989cUpT9NvewbWsDwTg1PmiJmwgiEqe6RU7t/Ij X-Received: by 2002:a05:6830:1da6:: with SMTP id z6mr653055oti.124.1585347590838; Fri, 27 Mar 2020 15:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585347590; cv=none; d=google.com; s=arc-20160816; b=xC1C0UXHaLbuLa193HXJmAEu7/R66Ti0BOHnmY81Y4J1A15YbUnA2kkWiUfZQkLVkb 6uYdcshYM1645VTyyHI7Ha/B4SYgqODbzW3g1/hJnehX9/PBerdzcZVdTqDu6URanfZ8 gyL6+AGkV7HpnIoqSNhK9iiz6h2FF/HfQlwlrtp1XDMu/VmARmTyWyyrjnlKy8umGFus Qj+QJOMSUO9BxZfoLGuJL2CCninto0VzHbfO5pxYZZz5UCKb2UwTMgTQRgH2ROPfRcIS yvbiH513Y/UjvJYmFmmwEtd4xYiQsKYBNyjSw/L1exHgpp5CUPpSKUkFSnEOBHHvVsvf jwUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=N7gy/G5yt4C6gRMEJcBMgk3+X7PiFDeDUNz7oegRXTc=; b=u6ep7wqRGR586Zhztk1Qyfk8NMdVbEFiDF2uPP1p7m+9wa4XnGIi3uZircvpYPkxe5 HkxPyJsB1ukXBwsEeT/QGanbrJ2gYQ8f6+hrGUkz+ois/bDUpBSOqH2JAGCiTcQoansl IFZfotEZOZ9kaVKZtuSw6YyQkfuyWzn8ftypgHOeNPBwMLa3MQvhgFfJwU8yDoi/xZkz xDwOZtleqVXjAkmgmhqS6QYgr220CY/EvhfSFG0TCecHEUeRojISw7wh9d4I/MV+jIRV Nh3rpE/uBSvN6ysbl2nFMb09AsQKXQw1sy1OJzGCxDlNTzoobbCC8faEfJs78VPolIta dnsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=jCyHDDxn; 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 a66si2984821otb.65.2020.03.27.15.19.25; Fri, 27 Mar 2020 15:19:50 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=jCyHDDxn; 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 S1727716AbgC0WSp (ORCPT + 99 others); Fri, 27 Mar 2020 18:18:45 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:34807 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727620AbgC0WSp (ORCPT ); Fri, 27 Mar 2020 18:18:45 -0400 Received: by mail-qk1-f195.google.com with SMTP id i6so12614538qke.1 for ; Fri, 27 Mar 2020 15:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=N7gy/G5yt4C6gRMEJcBMgk3+X7PiFDeDUNz7oegRXTc=; b=jCyHDDxnBfF/r4/912n+KwCBdRCnAbq0UBj3G8+HIjnKd+Ah5x2L8MCROJ0t5AuUPH uKyWVUP4P9eeMqpOMjdj3SNpUA/MFPTTunwWKdvArGIEWmn/VzLWo2z/kSo5iGXUlQ6W FOdWDHLQsBtkpt0t9NzbPsKeForxOVVJckPG8= 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:user-agent; bh=N7gy/G5yt4C6gRMEJcBMgk3+X7PiFDeDUNz7oegRXTc=; b=d/tdP3FNrAYmfqxBMMDyJiguGp9bJRLM+WfLTPpXOL9fQ7fOQ1xcjoHZnLMUrQFvue d81pGgry0NZQcik6RtyyChVNC5z5C4E44Q8sCsVF+uMtkVyIXDn5fnHUSPUJmdzszZPO 7/F3/KEifpQyq6+MPMVWDWKeaJUfhW7ForDZo2ULRdwq1O43cL+ZhHsMXs+HNN+7QKoq sXPM4OFuFPKcT4eNfE4H2XgPw4cA3Z65nGKZj4ao+jCDybqYvlbHyBKez0/sp53eTKOu dcZWm329GpRsLkWr7Sm1JZ+Kw1y88tlQ5ZcvF3+Ts/mMJXKrRWv9PJhNrSEDmweIrZn7 YGOA== X-Gm-Message-State: ANhLgQ2OeK8VBenMBG2EyARNTVk6wUPesHxWFNrfrsV6hmNAg+zHyDAI Qt16FdfwzNjGJdCupeciU1R2gA== X-Received: by 2002:a37:992:: with SMTP id 140mr1664796qkj.36.1585347524268; Fri, 27 Mar 2020 15:18:44 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id d201sm4559968qke.59.2020.03.27.15.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 15:18:43 -0700 (PDT) Date: Fri, 27 Mar 2020 18:18:43 -0400 From: Joel Fernandes To: Boqun Feng Cc: linux-kernel@vger.kernel.org, Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron , linux-arch@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v4 0/4] Documentation/litmus-tests: Add litmus tests for atomic APIs Message-ID: <20200327221843.GA226939@google.com> References: <20200326024022.7566-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200326024022.7566-1-boqun.feng@gmail.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 10:40:18AM +0800, 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. And based on the previous discussion, I create a > new directory Documentation/atomic-tests and put these litmus tests > here. > > This patchset starts the work by adding the litmus tests which are > already used in atomic_t.txt, and also improve the atomic_t.txt to make > it consistent with the litmus tests. > > Previous version: > v1: https://lore.kernel.org/linux-doc/20200214040132.91934-1-boqun.feng@gmail.com/ > v2: https://lore.kernel.org/lkml/20200219062627.104736-1-boqun.feng@gmail.com/ > v3: https://lore.kernel.org/linux-doc/20200227004049.6853-1-boqun.feng@gmail.com/ For full series: Reviewed-by: Joel Fernandes (Google) One question I had was in the existing atomic_set() documentation, it talks about atomic_add_unless() implementation based on locking could have issues. It says the way to fix such cases is: Quote: the typical solution is to then implement atomic_set{}() with atomic_xchg(). I didn't get how using atomic_xchg() fixes it. Is the assumption there that atomic_xchg() would be implemented using locking to avoid atomic_set() having issues? If so, we could clarify that in the document. thanks, - Joel > > Changes since v3: > > * Merge two patches on atomic-set litmus test into one as per > Alan. (Alan, you have acked only one of the two patches, so I > don't add you acked-by for the combined patch). > > * Move the atomic litmus tests into litmus-tests/atomic to align > with Joel's recent patches on RCU litmus tests. > > I think we still haven't reach to a conclusion for the difference of > atomic_add_unless() in herdtools, and I'm currently reading the source > code of herd to resovle this. This is just an updated version to resolve > ealier comments and react on Joel's RCU litmus tests. > > Regards, > Boqun > > [1]: http://diy.inria.fr/doc/litmus.html#klitmus > > Boqun Feng (4): > tools/memory-model: Add an exception for limitations on _unless() > family > Documentation/litmus-tests: Introduce atomic directory > Documentation/litmus-tests/atomic: Add a test for atomic_set() > Documentation/litmus-tests/atomic: Add a test for > smp_mb__after_atomic() > > Documentation/atomic_t.txt | 24 +++++++------- > ...ter_atomic-is-stronger-than-acquire.litmus | 32 +++++++++++++++++++ > ...c-RMW-ops-are-atomic-WRT-atomic_set.litmus | 24 ++++++++++++++ > Documentation/litmus-tests/atomic/README | 16 ++++++++++ > tools/memory-model/README | 10 ++++-- > 5 files changed, 91 insertions(+), 15 deletions(-) > create mode 100644 Documentation/litmus-tests/atomic/Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus > create mode 100644 Documentation/litmus-tests/atomic/Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus > create mode 100644 Documentation/litmus-tests/atomic/README > > -- > 2.25.1 >