Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756414AbaGVSfN (ORCPT ); Tue, 22 Jul 2014 14:35:13 -0400 Received: from g4t3427.houston.hp.com ([15.201.208.55]:44636 "EHLO g4t3427.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752213AbaGVSfL (ORCPT ); Tue, 22 Jul 2014 14:35:11 -0400 Message-ID: <53CEAEDA.9000704@hp.com> Date: Tue, 22 Jul 2014 14:35:06 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Andi Kleen CC: Thomas Gleixner , 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 References: <1405956271-34339-1-git-send-email-Waiman.Long@hp.com> <8761iq3bp3.fsf@tassilo.jf.intel.com> <871tte3bjw.fsf@tassilo.jf.intel.com> In-Reply-To: <871tte3bjw.fsf@tassilo.jf.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/21/2014 12:45 PM, 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. > > This would be always even more efficient, because it would > even avoid the syscall entry path. Spinning directly in userspace is useful if the critical section is really short and the chance of heavy contention is small. However, if the lock can be heavily contended and the critical section is not short, these are the conditions where a spinning futex proposed by this patch series can help. -Longman -- 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/