From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752885AbcHJW6R (ORCPT ); Wed, 10 Aug 2016 18:58:17 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:21139 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752854AbcHJW6Q (ORCPT ); Wed, 10 Aug 2016 18:58:16 -0400 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com Date: Wed, 10 Aug 2016 15:58:15 -0700 From: "Paul E. McKenney" To: Davidlohr Bueso Cc: Manfred Spraul , Benjamin Herrenschmidt , Michael Ellerman , Andrew Morton , Linux Kernel Mailing List , Susanne Spraul <1vier1@web.de>, Peter Zijlstra , parri.andrea@gmail.com Subject: Re: spin_lock implicit/explicit memory barrier Reply-To: paulmck@linux.vnet.ibm.com References: <1470787537.3015.83.camel@kernel.crashing.org> <4bd34301-0c63-66ae-71b1-6fd68c9fecdd@colorfullife.com> <20160810205202.GL3482@linux.vnet.ibm.com> <20160810222316.GA22336@linux-80c1.suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160810222316.GA22336@linux-80c1.suse> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081022-0008-0000-0000-00000546C04C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005575; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000180; SDB=6.00742895; UDB=6.00349750; IPR=6.00515453; BA=6.00004655; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012304; XFM=3.00000011; UTC=2016-08-10 22:58:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081022-0009-0000-0000-00003A213F18 Message-Id: <20160810225814.GR3482@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-10_18:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608100245 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 10, 2016 at 03:23:16PM -0700, Davidlohr Bueso wrote: > On Wed, 10 Aug 2016, Paul E. McKenney wrote: > > >On Wed, Aug 10, 2016 at 08:21:22PM +0200, Manfred Spraul wrote: > > >> 4) > >>spin_unlock_wait() and spin_unlock() pair > >>http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/tree/ipc/sem.c#n291 > >>http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/tree/ipc/sem.c#n409 > >>The data from the simple op must be observed by the following > >>complex op. Right now, there is still an smp_rmb() in line 300: The > >>control barrier from the loop inside spin_unlock_wait() is upgraded > >>to an acquire barrier by an additional smp_rmb(). Is this smp_rmb() > >>required? If I understand commit 2c6100227116 ("locking/qspinlock: > >>Fix spin_unlock_wait() some more") right, with this commit qspinlock > >>handle this case without the smp_rmb(). What I don't know if powerpc > >>is using qspinlock already, or if powerpc works without the > >>smp_rmb(). -- Manfred| > > No, ppc doesn't use qspinlocks, but as mentioned, spin_unlock_wait for > tickets are now at least an acquire (ppc is stronger), which match that > unlock store-release you are concerned about, this is as of 726328d92a4 > (locking/spinlock, arch: Update and fix spin_unlock_wait() implementations). > > This is exactly what you are doing by upgrading the ctrl dependency > to the acquire barrier in > http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/tree/ipc/sem.c#n291 > and therefore we don't need it explicitly -- it also makes the comment > wrt spin_unlock_wait obsolete. Or am I'm misunderstanding you? Ah, I was looking at 4.7 rather than current mainline. Perhaps Manfred was doing the same. Thanx, Paul