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=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 494BBC11D3D for ; Thu, 27 Feb 2020 17:52:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 205EB2469B for ; Thu, 27 Feb 2020 17:52:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rszqU/q6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730435AbgB0Rww (ORCPT ); Thu, 27 Feb 2020 12:52:52 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:34906 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbgB0Rwv (ORCPT ); Thu, 27 Feb 2020 12:52:51 -0500 Received: by mail-wm1-f68.google.com with SMTP id m3so359744wmi.0; Thu, 27 Feb 2020 09:52:48 -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:user-agent; bh=oJzOQyGUdiyuY3HBRX4a1v3LKWNPTj5lhD17LyMZ2gU=; b=rszqU/q6TjoEHSZvLU3SjjNtlZUhdmojbgbag/J2EiP37I/+eMwD5f/30vb9DmCDUY eilL7t0XZevD+Fv6+5Eock2xfk+JJx7wwZgoCQtnfa/i3aothEYuzNCx0fjEgMOYiv+L PE3qisnuQrNZNZjNXWp4pe8OJjaYTBFWNzuHbpVUkmXuWBRLIVQPfbZCKYRzEbk2q+Ff Uqj5EgEQG8hE54jE/IubEcN7NPHdGdMug78Pd9XOK6U6Hch19txBjO9/JOq9zawM4jHb NATB7p0wZ/tshoGalieBmEQNNW9sOqCNfKiqEEkrURvRwOzYJssZ0r2zib17lPKZPTEj X60g== 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=oJzOQyGUdiyuY3HBRX4a1v3LKWNPTj5lhD17LyMZ2gU=; b=BXC5OnZ7syPU7nnlqXcSeaV6F9rOBN4T6zp9mgW6FMHUyN+PsqRPe1BetrleKnH9DQ Dc4WoWQZ6ErINqAfJyeDNWh1LiwfCh2Fqr2QN1ecqbx3C71ullFEJH5X0c+tz+NEBqwd C0buXV89l9K3eSV85mhRWJNmBYtMBgPvZNnYN7t4xJjVd1mPhvyW0J/gZCimboG42Ztw Jm5xcWXrljv9ELS7Plvc/EPzPxjf0jfXSnjjoVuGMiuKVDr9eZEV5giCiQjfXbqmNEZn y961w5SQlfffRbUVXCJejZBycCiYJISQKYGaGmIwX9HDe5EFjjNpG7Z0qkU1LZPshn9E lJ7g== X-Gm-Message-State: APjAAAUnWg+DQOrsf4KrQi3PV+DyDpIWER8xokO6QiyjTgSvA8GFWCCB NO78jLdaCwUWD55wtk1gTU8= X-Google-Smtp-Source: APXvYqxT+Z+0UBIpflHvqZ0pgfzA3CLtgsKUXQb+gdNtOOaStPTtxk+2QEj6M+dWRhmjbTPIuFIPNg== X-Received: by 2002:a1c:cc06:: with SMTP id h6mr720524wmb.118.1582825967439; Thu, 27 Feb 2020 09:52:47 -0800 (PST) Received: from andrea (ip-213-220-200-127.net.upcbroadband.cz. [213.220.200.127]) by smtp.gmail.com with ESMTPSA id y7sm12885124wmd.1.2020.02.27.09.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 09:52:46 -0800 (PST) Date: Thu, 27 Feb 2020 18:52:40 +0100 From: Andrea Parri To: Boqun Feng Cc: linux-kernel@vger.kernel.org, Alan Stern , 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 v3 1/5] tools/memory-model: Add an exception for limitations on _unless() family Message-ID: <20200227175240.GA12046@andrea> References: <20200227004049.6853-1-boqun.feng@gmail.com> <20200227004049.6853-2-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200227004049.6853-2-boqun.feng@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 27, 2020 at 08:40:45AM +0800, Boqun Feng wrote: > 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 > Signed-off-by: Boqun Feng > --- > 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 fc07b52f2028..409211b1c544 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 Nit: Two spaces after period? Andrea > + 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.25.0 >