Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp372013imm; Fri, 31 Aug 2018 02:46:10 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb828Vqlc92j4m8TVKc7TdA8T/RURMXXoImoSxybyyWfmWJUobYHMCcRZz+VzojxgNWbZhF X-Received: by 2002:a17:902:9045:: with SMTP id w5-v6mr14728446plz.10.1535708770742; Fri, 31 Aug 2018 02:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535708770; cv=none; d=google.com; s=arc-20160816; b=QKSoQ07WIwYi9xVzDDyay16JNz2G4DCOzUUmjd4EsBewYjBL7AVSdUzFtAl3+BMPJh VOlvv8Q0WZIfL9Czx/GGNmdszsOTbb7fT1uOeYeJeNpZpU+e4eLv4miSfkMPyl5/UH4Y 9MbXblQIRQWizNQ++S97/k9I/O4IQmt2/A8NPHH0nQV2o0jszUWGwYPbdle4O3VV4uxA XwgonWzRlVMQq0sxVpGic/FPUPWR0aHhAJ9ZmHJEerX0ZPtRWwMLSRpliM455NqKRMgH svCUfDDFsFBZo+X5hgUwA5r68MeBvalIVGe4lMzUXamIgmijYPvr6uaeD5vI3KpiJTxc 1EfA== 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:arc-authentication-results; bh=8VHe5ji9OPYS6+EyWeSRlHZeRlQ2kxQyLeNoAecrM+o=; b=ICa5az8dKyVK7E9PDVHVEqzXWRKSaWix4a2qnn6zLo/kcJff0ZVCdVnyO1dHG5ND64 h+PChRWVYk+6vEYHEL/3QSq+I8uHC6rCtkPAU34ebGL4Ko79pK0S4PrSIIDThb6aStEV WKQs6pq+P9Q98DzwlEVpl+qpu3thx7yvuffKT6Edp+O9QyfD+Isnk/cDjmWA42IWrNFk 97HEiiEKLgoxLe44dwANhiI9R/NEnnEejw6VlwdDPDF28bko3fXTeu9xOIXfl35zNj9C C6vKYOUB5joatVVNEhXBCVDw+TLyJKAUi5kTG4YAaH8ZmxN3hwYHnkN2zJXcQ27ItG51 mV1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JNXiDy1r; 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 o6-v6si8957788plk.31.2018.08.31.02.45.55; Fri, 31 Aug 2018 02:46:10 -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=@amarulasolutions.com header.s=google header.b=JNXiDy1r; 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 S1727758AbeHaNu3 (ORCPT + 99 others); Fri, 31 Aug 2018 09:50:29 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41614 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727410AbeHaNu3 (ORCPT ); Fri, 31 Aug 2018 09:50:29 -0400 Received: by mail-ed1-f68.google.com with SMTP id f38-v6so8595198edd.8 for ; Fri, 31 Aug 2018 02:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8VHe5ji9OPYS6+EyWeSRlHZeRlQ2kxQyLeNoAecrM+o=; b=JNXiDy1rUQa8Ei43BYnJC22qxF113EQxHTOv92sH4GjQ1MEafjyZ8qUd/ZcouIAvZ1 HyEscNgz+EMT+pzu40HrMr4EBAODBIYPtVeU/9HtPGIyiM7sUol3BRiZ8lOUYsajACTu CSGRIsn6mvsqbpHwVL/+MXkkG+M6XmaqId22Q= 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=8VHe5ji9OPYS6+EyWeSRlHZeRlQ2kxQyLeNoAecrM+o=; b=flV40S8GnO4oYbgfPoDbEMGEIq6IQ4+VOAHsjq9pw1HJ4BxwNoUQgrE7Yk/0RsIAYV 4qqO62ZVsssD59XOYVaZfbekTYMaiQzN1qIwsZAE1rZQhiaq6Ht9rkznXhO1B4NXBmuJ enuTTZpXgjBYwbVmdX9BAL60OiDVkB8C6XGcYlmU7F/KVHClbzdkXe5iaEvyMUp6WuWz JlXvVKkUA+HqBM/I/fbk3DDThaaFmnN3PCg+TjQgIhE5sNeEoFFKbhKO6AxFhbHDb38I Px8C8GvRpeYbnQ2uhlbIrEkWz+5OfX/YEcXMD0fZKrXoGfyUxTs2+zegf9jDrlCkR6LM T5rA== X-Gm-Message-State: APzg51COPvGxH2M1PwcmqjGhmb5aUdkfVDo7utEYlRou5Cx7AOlJhIo3 vigsrE3JrSEf+LK1uEKrZQmEvQ== X-Received: by 2002:a50:878b:: with SMTP id a11-v6mr16459699eda.305.1535708628554; Fri, 31 Aug 2018 02:43:48 -0700 (PDT) Received: from andrea (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id h34-v6sm4258920eda.58.2018.08.31.02.43.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 Aug 2018 02:43:47 -0700 (PDT) Date: Fri, 31 Aug 2018 11:43:42 +0200 From: Andrea Parri To: "Paul E. McKenney" Cc: Andrea Parri , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mingo@kernel.org, stern@rowland.harvard.edu, will.deacon@arm.com, 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 Subject: Re: [PATCH RFC LKMM 3/7] EXP tools/memory-model: Add more LKMM limitations Message-ID: <20180831094341.GA4634@andrea> References: <20180829211018.GA19646@linux.vnet.ibm.com> <20180829211053.20531-3-paulmck@linux.vnet.ibm.com> <20180830091713.GA4617@andrea> <20180830221814.GQ4225@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180830221814.GQ4225@linux.vnet.ibm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > + 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 > > > + in litmus tests, for example, by using atomic_cmpxchg(). > > > > There is a prototype atomic_add_unless(): with current herd7, > > > > $ cat atomic_add_unless.litmus > > C atomic_add_unless > > > > {} > > > > P0(atomic_t *u, atomic_t *v) > > { > > int r0; > > int r1; > > > > r0 = atomic_add_unless(u, 1, 2); > > r1 = atomic_read(v); > > } > > > > P1(atomic_t *u, atomic_t *v) > > { > > int r0; > > int r1; > > > > r0 = atomic_add_unless(v, 1, 2); > > r1 = atomic_read(u); > > } > > > > exists (0:r1=0 /\ 1:r1=0) > > > > $ herd7 -conf linux-kernel.cfg atomic_add_unless.litmus > > Test atomic_add_unless Allowed > > States 3 > > 0:r1=0; 1:r1=1; > > 0:r1=1; 1:r1=0; > > 0:r1=1; 1:r1=1; > > No > > Witnesses > > Positive: 0 Negative: 3 > > Condition exists (0:r1=0 /\ 1:r1=0) > > Observation atomic_add_unless Never 0 3 > > Time atomic_add_unless 0.00 > > Hash=fa37a2359831690299e4cc394e45d966 > > > > The last commit in the herdtools7 repo. related to this implementation > > (AFAICT) is: > > > > 9523c340917b6a ("herd/linux: make atomic_add_unless a primitive, so as to yield more precise dependencies for the returned boolean.") > > > > but I can only vaguely remember those dependencies issues now :/ ...; > > maybe we can now solve these issues? or should we change herd7 to re- > > turn a warning? (Notice that this primitive is currently not exported > > to the linux-kernel.def file.) > > Cool! It would be good to add this to the .def file once the underlying > herd7 machinery is ready. And then I would update the documentation > accordingly. Or happily accept a patch updating the documentation, > as the case might be. ;-) Fair enough, ;-) Please feel free to add: Reviewed-by: Andrea Parri Andrea