Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932502AbbKYB4i (ORCPT ); Tue, 24 Nov 2015 20:56:38 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36801 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754902AbbKYB4e (ORCPT ); Tue, 24 Nov 2015 20:56:34 -0500 MIME-Version: 1.0 In-Reply-To: References: <563B8E85.6090104@hpe.com> <563CE5A6.8080409@hpe.com> Date: Wed, 25 Nov 2015 09:56:33 +0800 Message-ID: Subject: Re: Improve spinlock performance by moving work to one core From: Ling Ma To: Waiman Long Cc: Peter Zijlstra , mingo@redhat.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Ling 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: 1607 Lines: 52 Any comments about it ? Thanks Ling 2015-11-23 17:41 GMT+08:00 Ling Ma : > Hi Longman, > > Attachments include user space application thread.c and kernel patch > spinlock-test.patch based on kernel 4.3.0-rc4 > > we run thread.c with kernel patch, test original and new spinlock respectively, > perf top -G indicates thread.c cause cache_alloc_refill and > cache_flusharray functions to spend ~25% time on original spinlock, > after introducing new spinlock in two functions, the cost time become ~22%. > > The printed data also tell us the new spinlock improves performance > by about 15%( 93841765576 / 81036259588) on E5-2699V3 > > Appreciate your comments. > > Thanks > Ling > > 2015-11-07 1:38 GMT+08:00 Waiman Long : >> >> On 11/05/2015 11:28 PM, Ling Ma wrote: >>> >>> Longman >>> >>> Thanks for your suggestion. >>> We will look for real scenario to test, and could you please introduce >>> some benchmarks on spinlock ? >>> >>> Regards >>> Ling >>> >>> >> >> The kernel has been well optimized for most common workloads that spinlock contention is usually not a performance bottleneck. There are still corner cases where there is heavy spinlock contention. >> >> I used a spinlock loop microbenchmark like what you are doing as well as AIM7 for application level testing. >> >> Cheers, >> 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/