Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030586AbbD1QZT (ORCPT ); Tue, 28 Apr 2015 12:25:19 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:38639 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030265AbbD1QZP (ORCPT ); Tue, 28 Apr 2015 12:25:15 -0400 Date: Tue, 28 Apr 2015 18:24:58 +0200 From: Peter Zijlstra To: Chris Metcalf Cc: "Paul E. McKenney" , Manfred Spraul , Oleg Nesterov , Kirill Tkhai , linux-kernel@vger.kernel.org, Ingo Molnar , Josh Poimboeuf Subject: Re: [PATCH 2/2] [PATCH] sched: Add smp_rmb() in task rq locking cycles Message-ID: <20150428162458.GI5029@twins.programming.kicks-ass.net> References: <20150218155904.GA27687@redhat.com> <54E4E479.4050003@colorfullife.com> <20150218224317.GC5029@twins.programming.kicks-ass.net> <20150219141905.GA11018@redhat.com> <54E77CC0.5030401@colorfullife.com> <20150220184551.GQ2896@worktop.programming.kicks-ass.net> <20150425195602.GA26676@linux.vnet.ibm.com> <20150426105213.GA27191@linux.vnet.ibm.com> <20150428143357.GF23123@twins.programming.kicks-ass.net> <553FACF1.2020405@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <553FACF1.2020405@ezchip.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1104 Lines: 22 On Tue, Apr 28, 2015 at 11:53:21AM -0400, Chris Metcalf wrote: > As you surmise, tilepro doesn't have 64-bit loads. So we are stuck with > 32-bit loads on these two fields. It's true that spin_unlock_wait() can > therefore falsely claim that the lock is unlocked, but it should be only a > hint anyway, since by the time the caller tries to act on that information > the lock may have been retaken anyway, right? If spin_unlock_wait() is > really trying to guarantee that the lock was available at some point in > the interval between when it was called and when it returned, we could use > READ_ONCE() to read the current ticket value first; is that a necessary > part of the semantics? I think it must not return before the lock holder that is current at the time of calling releases. Anything thereafter is indeed fair game as per your logic above. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/