Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756763Ab3H3Piw (ORCPT ); Fri, 30 Aug 2013 11:38:52 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:62295 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496Ab3H3Piv (ORCPT ); Fri, 30 Aug 2013 11:38:51 -0400 MIME-Version: 1.0 Reply-To: sedat.dilek@gmail.com In-Reply-To: References: <1375758759-29629-1-git-send-email-Waiman.Long@hp.com> <1375758759-29629-2-git-send-email-Waiman.Long@hp.com> <1377751465.4028.20.camel@pasglop> <20130829070012.GC27322@gmail.com> <52200DAE.2020303@hp.com> Date: Fri, 30 Aug 2013 17:38:47 +0200 Message-ID: Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount From: Sedat Dilek To: Linus Torvalds Cc: Waiman Long , Ingo Molnar , Benjamin Herrenschmidt , Alexander Viro , Jeff Layton , Miklos Szeredi , Ingo Molnar , Thomas Gleixner , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1690 Lines: 43 On Fri, Aug 30, 2013 at 5:34 PM, Linus Torvalds wrote: > On Fri, Aug 30, 2013 at 2:27 AM, Sedat Dilek wrote: >> >> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops: >> >> lockref: w/o patch | w/ patch >> ====================== >> Run #1: 2.688.094 | 2.643.004 >> Run #2: 2.678.884 | 2.652.787 >> Run #3: 2.686.450 | 2.650.142 >> Run #4: 2.688.435 | 2.648.409 >> Run #5: 2.693.770 | 2.651.514 > > Yes, so this is pretty much expected. > > If you don't have a very high core count (you don't mention your > system, but that's pretty - I get ~65 million repetitions in 10 > seconds on my i5-670), the cmpxchg will not help - because you don't > actually see the bad "wait on spinlock" behavior in the first place. > > And a "cmpxchg" is slightly slower than the very optimized spinlocks, > and has that annoying "read original value" first issue too. So the > patch can make things a bit slower, although it will depends on the > microarchitecture (and as mentioned elsewhere, there are other things > that can make a bigger difference boot-to-boot - dentry allocation > details etc can have "sticky" performance impact). > > So we may take a small hit in order to then *not* have horrible > scalability at the high end. > A Samsung series-5 ultrabook. $ grep "model name" /proc/cpuinfo | uniq model name : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz - Sedat - -- 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/