From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754711Ab3LUCeU (ORCPT ); Fri, 20 Dec 2013 21:34:20 -0500 Received: from mga02.intel.com ([134.134.136.20]:57395 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752629Ab3LUCeT (ORCPT ); Fri, 20 Dec 2013 21:34:19 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,525,1384329600"; d="scan'208";a="428127138" Message-ID: <1387593256.3510.181.camel@dvhart-mobl4.amr.corp.intel.com> Subject: Re: [PATCH v3 4/4] futex: Avoid taking hb lock if nothing to wakeup From: Darren Hart To: Davidlohr Bueso Cc: Linus Torvalds , Linux Kernel Mailing List , Ingo Molnar , 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 18:34:16 -0800 In-Reply-To: <1387589770.3119.2.camel@buesod1.americas.hpqcorp.net> References: <1387478746-5436-1-git-send-email-davidlohr@hp.com> <1387478746-5436-5-git-send-email-davidlohr@hp.com> <1387589770.3119.2.camel@buesod1.americas.hpqcorp.net> Organization: Intel Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) 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 17:36 -0800, Davidlohr Bueso wrote: > On Thu, 2013-12-19 at 15:14 -0800, Linus Torvalds wrote: > > On Thu, Dec 19, 2013 at 10:45 AM, Davidlohr Bueso wrote: > > > > > > - increment the counter at queue_lock() as we always end up calling > > > queue_me() which adds the element to the list. Upon any error, > > > queue_unlock() is called for housekeeping, for which we decrement > > > to mach the increment done in queue_lock(). > > > > > > - decrement the counter at __unqueue_me() to reflect when an element is > > > removed from the queue for wakeup related purposes. > > > > I still hate this whole separate counter thing. It seems really annoying. > > > > If re-ordering things didn't work out, then why can't just the counter > > we *already* have in the spinlock itself work as the counter? Your > > counter update logic seems to basically match when you take the > > spinlock anyway. > > So the following has passed all testing, just like the atomics variant. > Thoughts? Do you have similar performance numbers for comparison? I presume they were *very* similar to the atomics version - I think you hinted at that in a previous post? -- Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel