Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933503AbaGUSZS (ORCPT ); Mon, 21 Jul 2014 14:25:18 -0400 Received: from www.linutronix.de ([62.245.132.108]:32910 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933341AbaGUSZP (ORCPT ); Mon, 21 Jul 2014 14:25:15 -0400 Date: Mon, 21 Jul 2014 20:24:56 +0200 (CEST) From: Thomas Gleixner To: Andi Kleen cc: Waiman Long , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , Heiko Carstens , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, Jason Low , Scott J Norton Subject: Re: [RFC PATCH 0/5] futex: introduce an optimistic spinning futex In-Reply-To: <871tte3bjw.fsf@tassilo.jf.intel.com> Message-ID: References: <1405956271-34339-1-git-send-email-Waiman.Long@hp.com> <8761iq3bp3.fsf@tassilo.jf.intel.com> <871tte3bjw.fsf@tassilo.jf.intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Jul 2014, Andi Kleen wrote: > Andi Kleen writes: > > > Waiman Long writes: > > > >> This patch series introduces two new futex command codes to support > >> a new optimistic spinning futex for implementing an exclusive lock > >> primitive that should perform better than the same primitive using > >> the wait-wake futex in cases where the lock owner is actively working > >> instead of waiting for I/O completion. > > > > How would you distinguish those two cases automatically? > > Also BTW traditionally the spinning was just done in user space. And traditionally that is based on heuristics, because user space cannot figure out whether the lock owner is on the CPU or not. And heuristics suck no matter what. There have been attempts to expose that information to user space, but that sucks as well, as it requires updates of that information from the guts of the scheduler, does not scale at all and what's worse, it has security implications. Thanks, tglx -- 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/