From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C273C2BA19 for ; Wed, 15 Apr 2020 19:12:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA3FF20768 for ; Wed, 15 Apr 2020 19:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586977943; bh=jjp1onkfxL2eENBHHoIekG6O8re7lZ1C80KqLCuGG6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=byJxIPrTlxzHRRyDmQV3w/zjCgWEBCtDbOOVBgSU5tRTe0ZpZMktXdi6CX3IDw7P+ V5MOypPwK+BckbO8A/9N8W2gmCzSLXCJf4yRw37EHopBMAvhAF1C+XpxFa5uE2emqY EVJtl0dyzyvV9/MsKHIjBYR8Lka8w4EzlrLEDkcw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441649AbgDOTML (ORCPT ); Wed, 15 Apr 2020 15:12:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:45914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1416863AbgDOStt (ORCPT ); Wed, 15 Apr 2020 14:49:49 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE2BE21655; Wed, 15 Apr 2020 18:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586976588; bh=jjp1onkfxL2eENBHHoIekG6O8re7lZ1C80KqLCuGG6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rjN7oLkIF9wwanZnLj1ltth3bV4vLc5Jmbn+c2pDeW+KMARtRK02YFT69nZQRmTF3 HEts7UM9xdFOwc/xXgjTeBlyaCyYprTfxORpaiBv7ve5kChGghvvPz9Y+KeQPL+9ze JCK5Nn/PkJgLAwLvNLFRu7UQmBmhccmD5dIKGmao= From: paulmck@kernel.org To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org Cc: stern@rowland.harvard.edu, parri.andrea@gmail.com, will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, "Paul E . McKenney" Subject: [PATCH lkmm tip/core/rcu 07/10] tools/memory-model: Add an exception for limitations on _unless() family Date: Wed, 15 Apr 2020 11:49:42 -0700 Message-Id: <20200415184945.16487-7-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20200415183343.GA12265@paulmck-ThinkPad-P72> References: <20200415183343.GA12265@paulmck-ThinkPad-P72> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Boqun Feng According to Luc, atomic_add_unless() is directly provided by herd7, therefore it can be used in litmus tests. So change the limitation section in README to unlimit the use of atomic_add_unless(). Cc: Luc Maranget Acked-by: Andrea Parri Reviewed-by: Joel Fernandes (Google) Signed-off-by: Boqun Feng Signed-off-by: Paul E. McKenney --- tools/memory-model/README | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/memory-model/README b/tools/memory-model/README index fc07b52..b9c562e 100644 --- a/tools/memory-model/README +++ b/tools/memory-model/README @@ -207,11 +207,15 @@ The Linux-kernel memory model (LKMM) has the following limitations: case as a store release. b. The "unless" RMW operations are not currently modeled: - atomic_long_add_unless(), atomic_add_unless(), - atomic_inc_unless_negative(), and - atomic_dec_unless_positive(). These can be emulated + atomic_long_add_unless(), atomic_inc_unless_negative(), + and atomic_dec_unless_positive(). These can be emulated in litmus tests, for example, by using atomic_cmpxchg(). + One exception of this limitation is atomic_add_unless(), + which is provided directly by herd7 (so no corresponding + definition in linux-kernel.def). atomic_add_unless() is + modeled by herd7 therefore it can be used in litmus tests. + c. The call_rcu() function is not modeled. It can be emulated in litmus tests by adding another process that invokes synchronize_rcu() and the body of the callback -- 2.9.5