Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1382168ybf; Thu, 27 Feb 2020 09:54:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxrzbIxCmiHlQADJNVDCnKm1Enw+NLIv61i5W+R8nMg7LFWxlXDpJy2IKcAtaafLK9ezba2 X-Received: by 2002:aca:54cc:: with SMTP id i195mr183710oib.126.1582826060893; Thu, 27 Feb 2020 09:54:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582826060; cv=none; d=google.com; s=arc-20160816; b=SVTUaTqTSsNrde0Yd4lqdQulhLUGBga7+StPSrEsPZ68LN5GSp0Hojv+0PSpXIqBPE 61fxCpRRwt7E13F9OuoABm5+yo420UV7zPtka10KjnukWByAzYyOOEhHpy5KnrMRHdJH bcOUTD6dZ/CAUxSO/kcxie/vMnMzhrLXnfejOPJQ8Sg3cLZewRauZCnKwBh3gSua/CRA PNZ+MGkqtegbZHIJWPMsoz6BGG5vV51rxGGTn8+JVKSsemNzeotdNME8wdBbYLxB3Xec 5cuWBLnCDYUCPtw+k9OYJRG3HqR6753xrUYPxNRJj1ULz0C9Bn336PxTJV0No/fLkgCa 8mww== 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=oJzOQyGUdiyuY3HBRX4a1v3LKWNPTj5lhD17LyMZ2gU=; b=so1mHFLJOYnQLPpWNoz4FqEUY97FO3EoC3kKPLpEULpNEM/IaZJxKmgZEhVxKVa89d c1DTxQdGZsJhhOLQwd372rbCX0WQv6t8nS2P4C4ro/r/KYbSrvBgrQvvUcA1HEilGs2G d6CSl4EL3lG2X5J6Ua9/d7n5C1/rfV37XQFJGBRY98/GtauRocDGl6hDb/SWpf7zPjYd WyRtyNA3eNANO8s7kwvVDUvv63R/DGbQ+UkJJgLJqapBnUnXzuPXiTW2gyBDmTLaxf1C /9scB/8IA8Po6UqlhuZwesJCH6iX57qnpOTRQGTyh3ErdA/84dhB+f/MgFW39eir85GU 9uzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rszqU/q6"; 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 h6si2162470otk.276.2020.02.27.09.54.08; Thu, 27 Feb 2020 09:54:20 -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="rszqU/q6"; 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 S1730406AbgB0Rww (ORCPT + 99 others); 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-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 >