From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932160AbcHKSb5 (ORCPT ); Thu, 11 Aug 2016 14:31:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:33387 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750840AbcHKSby (ORCPT ); Thu, 11 Aug 2016 14:31:54 -0400 Date: Thu, 11 Aug 2016 11:31:06 -0700 From: Davidlohr Bueso To: Peter Zijlstra Cc: "Paul E. McKenney" , Manfred Spraul , Benjamin Herrenschmidt , Michael Ellerman , Andrew Morton , Linux Kernel Mailing List , Susanne Spraul <1vier1@web.de>, parri.andrea@gmail.com Subject: Re: spin_lock implicit/explicit memory barrier Message-ID: <20160811183106.GA18261@linux-80c1.suse> 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> <20160810225814.GR3482@linux.vnet.ibm.com> <20160810232922.GA24645@linux-80c1.suse> <20160811081139.GT30192@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20160811081139.GT30192@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Aug 2016, Peter Zijlstra wrote: >On Wed, Aug 10, 2016 at 04:29:22PM -0700, Davidlohr Bueso wrote: > >> (1) As Manfred suggested, have a patch 1 that fixes the race against mainline >> with the redundant smp_rmb, then apply a second patch that gets rid of it >> for mainline, but only backport the original patch 1 down to 3.12. > >I have not followed the thread closely, but this seems like the best >option. Esp. since 726328d92a42 ("locking/spinlock, arch: Update and fix >spin_unlock_wait() implementations") is incomplete, it relies on at >least 6262db7c088b ("powerpc/spinlock: Fix spin_unlock_wait()") to sort >PPC. Yeah, and we'd also need the arm bits; which reminds me, aren't alpha ldl_l/stl_c sequences also exposed to this delaying of the publishing when a non-owner peeks at the lock? Right now sysv sem's would be busted when doing either is_locked or unlock_wait, shouldn't these be pimped up to full smp_mb()s? Thanks, Davidlohr