From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107Ab3LUF5R (ORCPT ); Sat, 21 Dec 2013 00:57:17 -0500 Received: from g5t0006.atlanta.hp.com ([15.192.0.43]:14632 "EHLO g5t0006.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914Ab3LUF5Q (ORCPT ); Sat, 21 Dec 2013 00:57:16 -0500 Message-ID: <1387605430.3119.4.camel@buesod1.americas.hpqcorp.net> Subject: Re: [PATCH v3 4/4] futex: Avoid taking hb lock if nothing to wakeup From: Davidlohr Bueso To: Linus Torvalds Cc: Linux Kernel Mailing List , Ingo Molnar , Darren Hart , Peter Zijlstra , Thomas Gleixner , Paul McKenney , Mike Galbraith , Jeff Mahoney , Jason Low , Waiman Long , Tom Vaden , "Norton, Scott J" , "Chandramouleeswaran, Aswin" , Ingo Molnar Date: Fri, 20 Dec 2013 21:57:10 -0800 In-Reply-To: References: <1387478746-5436-1-git-send-email-davidlohr@hp.com> <1387478746-5436-5-git-send-email-davidlohr@hp.com> <1387567810.2704.19.camel@buesod1.americas.hpqcorp.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4 (3.6.4-3.fc18) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2013-12-20 at 11:54 -0800, Linus Torvalds wrote: > On Fri, Dec 20, 2013 at 11:30 AM, Davidlohr Bueso wrote: > > > > So we'd need the barrier right after the ticket increment (ie: the xadd > > TICKET_LOCK_INC in x86), and cannot rely on the barrier after the lock > > is taken as we could miss waiters that are just spinning trying to take > > it. Is this implicitly guaranteed across all archs? > > Not necessarily. But I don't see why threads spinning on it would be > special? If you spin on things, you've already updated the head > counter, so even spinners *are* visible, even if they haven't actually > gotten the lock yet. Fair enough, just making sure we're covering all cases.