Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1032859imm; Thu, 6 Sep 2018 14:13:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbsOwrTw2zWfvu7RAJbWPNrp9nkV1zsdAi9LDw8HjIyYfkYFgE9X+lUa5RUqF9uhF8JrTA9 X-Received: by 2002:a17:902:f209:: with SMTP id gn9mr4679422plb.173.1536268414473; Thu, 06 Sep 2018 14:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536268414; cv=none; d=google.com; s=arc-20160816; b=kGVvIIiBxA1wzqSucYTQwP3qUk541arLUDoAh8/8bRE4Xv1PpTMK53I0j/IdGELm+g vnYmZlbXITDatFFv0zMAV90dLDkcaUA6c6Cp3rlSGSpsMUJeMNKpo6MG1MNrcpzUJcp+ +AAFNO7gxrSKWwdQ6deIrZZ9cNXKhFyQ6VPbkpRmit+FhK5GxD+x+kBqP/72rOiqit6G 4Fh6u/MTomp6O+i51TIMZ3Da+yjh6ZfiUvglYV5z6Noav+vyU5lmhOG502MWQHdBcw+O hS9jtM15VMSt5/RK8oZDW8wmfBfLf9ff/q6MVnxs+/73g/49Kcjo3P5h2oOUhUalfV+t JObQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=uC4FiHac2m0UufYtDCbDWZIqgWLWq3DQCbFrkjBAnq4=; b=MHt/bToP3KPiozPpoU9DcBYLRmbk8GcKeHFJwTtoVBrIzEr5mKnWjM/a8heN+BAAga vjX0cHXjOYwzCrJoOJt3Z5ccFU/1M1n1aE7OkwhjcQCWC22UmU6SZLCefj6KKAmZuE+m wpMuxpB/qacg/QCFzNKZYvyXVUwZHeFqOIF9RKViLiN/Rf8uMuNYCJtlwOLSf1SuNYlH FMLoaw+qkSJhXeESBKA8FN0ZEih7P/XLDZr8U7CBSwwSMNFNxmvvpreRFOO/tsbHkT2G UgE2mCH3bomarcwV99EtVUO0fw62VTSajFDIg2459jd7//GJq1+BG983EcksXYr2LbWg S+dw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21-v6si5862230pgu.163.2018.09.06.14.13.18; Thu, 06 Sep 2018 14:13:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730448AbeIFXLJ (ORCPT + 99 others); Thu, 6 Sep 2018 19:11:09 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51820 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbeIFXLJ (ORCPT ); Thu, 6 Sep 2018 19:11:09 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w86ISmwt058195 for ; Thu, 6 Sep 2018 14:34:25 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mb9etrcqc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Sep 2018 14:34:25 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Sep 2018 14:34:24 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Sep 2018 14:34:18 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w86IYHAc4784446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Sep 2018 18:34:17 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41BB4B2065; Thu, 6 Sep 2018 14:33:03 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 22151B205F; Thu, 6 Sep 2018 14:33:03 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 6 Sep 2018 14:33:03 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 90FE916C29D3; Thu, 6 Sep 2018 11:34:17 -0700 (PDT) Date: Thu, 6 Sep 2018 11:34:17 -0700 From: "Paul E. McKenney" To: Andrea Parri 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 Reply-To: paulmck@linux.vnet.ibm.com References: <20180829211018.GA19646@linux.vnet.ibm.com> <20180829211053.20531-3-paulmck@linux.vnet.ibm.com> <20180830091713.GA4617@andrea> <20180830221814.GQ4225@linux.vnet.ibm.com> <20180831094341.GA4634@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831094341.GA4634@andrea> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18090618-0052-0000-0000-0000032C59E5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009676; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01084483; UDB=6.00559750; IPR=6.00864483; MB=3.00023148; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-06 18:34:22 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18090618-0053-0000-0000-00005DFBEB85 Message-Id: <20180906183417.GA4225@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-06_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809060179 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 11:43:42AM +0200, Andrea Parri wrote: > > > > + 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 Thank you! Applied and pushed out, updating the lkmm branch in the process. Thanx, Paul