Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp68125imm; Fri, 6 Jul 2018 14:09:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe/LFFf4snXRjNBYpDX3LvDv9Gz7Bx54hlf07q7ubwyeyxpCj//juOR9b6NiqDth21M/FSP X-Received: by 2002:a65:6292:: with SMTP id f18-v6mr6030354pgv.85.1530911387096; Fri, 06 Jul 2018 14:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530911387; cv=none; d=google.com; s=arc-20160816; b=FqnqCpONWQqENGz27vVQeqNckiTtb4g5pfOv2w+E0QCjTYFDhVUrJ8cTz8/MUyDAsl 4H8cauNoo41nLXre0hdYAtIqdCsSvYxbR2AZ8HcrTvoBbvj1wy3bi1Q1g/6AEFT4l1Pi 323oyi4EfUze59V6CL2mlG2zrU1aiocx4deed31ANozuy5DlzjyxsbgVDKS9NHqg+GGY O8Xm5re8gfybagWFDI5/r/H3M0hSDHXfmkp/ijtnn20JMZgp8qIIsWhdgKLluxZWUnya VtHYTIV9nQveVUX1YhsPcdQXlgSDqzC3jhHh/HHe7uNx0gNjuEtkth2aGq7jDkJKCrQB fTUg== 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:arc-authentication-results; bh=Y0KeHbSIe/WTa9lbeLcDKUkz6VvGi9xy2ErKquuvVWo=; b=xMsTtjGbqPtlnUPYPj4GfV8ZtwL/u7qfDArHazsC0wicz982TbVLQd4TvuvXDhUZNi 0v8m6Mwe2VPAyvWGbfyOZDt8YyV3Ll1XahdFWL5Cr1kpj4d+ZAMfxXcxch9V4p5Pq6JQ +7Ftz5JdcHf4Rk39ue6a3YPnxJJkI3rXI3Jsx+GSH06Tg7VLwkb/tzdp3w6Ujvvh++L+ gnd7F19dsPmob8EIUnU3ubkuK0uo/PrIR7aYbRgRiimOK+8PQDV0mHfrKUy/kYTQojNC Vf6lxyA0pBf+0Jlcx89OqfM9P82iLN7heR2QT/J+f9artPidfT+5jLL9GENJlMNH3G9h yoUw== 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 s14-v6si8611062pgn.76.2018.07.06.14.09.31; Fri, 06 Jul 2018 14:09:47 -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 S1753956AbeGFVIq (ORCPT + 99 others); Fri, 6 Jul 2018 17:08:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54094 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753529AbeGFVIp (ORCPT ); Fri, 6 Jul 2018 17:08:45 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w66L3RbA115528 for ; Fri, 6 Jul 2018 17:08:44 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k2en23q2b-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Jul 2018 17:08:44 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jul 2018 17:08:44 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 6 Jul 2018 17:08:40 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w66L8dZh10289566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 6 Jul 2018 21:08:39 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 985D6B2064; Fri, 6 Jul 2018 17:08:18 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79288B2066; Fri, 6 Jul 2018 17:08:18 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 6 Jul 2018 17:08:18 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 64CDC16CA5F5; Fri, 6 Jul 2018 14:10:55 -0700 (PDT) Date: Fri, 6 Jul 2018 14:10:55 -0700 From: "Paul E. McKenney" To: Alan Stern Cc: Andrea Parri , Will Deacon , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Kernel development list , dlustig@nvidia.com Subject: Re: [PATCH 2/2] tools/memory-model: Add write ordering by release-acquire and by locks Reply-To: paulmck@linux.vnet.ibm.com References: <20180705150945.GA3699@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18070621-0072-0000-0000-0000037C1440 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009321; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01057548; UDB=6.00542596; IPR=6.00835468; MB=3.00022032; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-06 21:08:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070621-0073-0000-0000-0000489E82A7 Message-Id: <20180706211055.GN3593@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-06_06:,, 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=781 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807060237 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 06, 2018 at 04:37:21PM -0400, Alan Stern wrote: > On Thu, 5 Jul 2018, Andrea Parri wrote: > > > > At any rate, it looks like instead of strengthening the relation, I > > > should write a patch that removes it entirely. I also will add new, > > > stronger relations for use with locking, essentially making spin_lock > > > and spin_unlock be RCsc. > > > > Thank you. > > > > Ah let me put this forward: please keep an eye on the (generic) > > > > queued_spin_lock() > > queued_spin_unlock() > > > > (just to point out an example). Their implementation (in part., > > the fast-path) suggests that if we will stick to RCsc lock then > > we should also stick to RCsc acq. load from RMW and rel. store. > > A very good point. The implementation of those routines uses > atomic_cmpxchg_acquire() to acquire the lock. Unless this is > implemented with an operation or fence that provides write-write > ordering (in conjunction with a suitable release), qspinlocks won't > have the ordering properties that we want. > > I'm going to assume that the release operations used for unlocking > don't need to have any extra properties; only the lock-acquire > operations need to be special (i.e., stronger than a normal > smp_load_acquire). This suggests that atomic RMW functions with acquire > semantics should also use this stronger form of acquire. > > Does anybody have a different suggestion? The approach you suggest makes sense to me. Will, Peter, Daniel, any reasons why this approach would be a problem for you guys? Thanx, Paul