Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752802AbcDORh2 (ORCPT ); Fri, 15 Apr 2016 13:37:28 -0400 Received: from mail-bl2on0101.outbound.protection.outlook.com ([65.55.169.101]:59462 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752637AbcDORhX (ORCPT ); Fri, 15 Apr 2016 13:37:23 -0400 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=hpe.com; Message-ID: <571126C5.3030603@hpe.com> Date: Fri, 15 Apr 2016 13:37:09 -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: CC: , , , , Subject: Re: [RFC PATCH] aliworkqueue: Adaptive lock integration on multi-core platform References: <1460693133-22100-1-git-send-email-ling.ma.program@gmail.com> In-Reply-To: <1460693133-22100-1-git-send-email-ling.ma.program@gmail.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [72.71.243.152] X-ClientProxiedBy: CY1PR08CA0003.namprd08.prod.outlook.com (10.163.94.141) To CS1PR84MB0310.NAMPRD84.PROD.OUTLOOK.COM (10.162.190.28) X-MS-Office365-Filtering-Correlation-Id: 62cb84d4-dbd8-4ab2-19d2-08d365549616 X-Microsoft-Exchange-Diagnostics: 1;CS1PR84MB0310;2:QBjVu8UCvmeet77Yqx9ZptwXn3F3s5e+z4KknbWQy0/DxKhptpjlg9weGJX6MoU/YoTA0qJFBgBtX6w1SlBgGi9zTwrzm5IYn/vzKlXyiROWNjmNJceK4IUnBy1FQdfTu2alIjSMIb4KlnC+V64sJCqQaYW2ytnvLR6zwotjG4E7ot5dc+h74nI+QjH3YzTk;3:m6jAmb1yimVoKbLXnNQocFE5RdVT6cDefoRYkQ7Jx5xju/ctmpMPVbMFXSHY/OD4UVf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ENPTo61Yn9pOwCzKfo0gncE0dwXgysvkugdi3/UAwI2tE3oGMh3dNxIhNPWbQLV4IqaFZmkK7+WYwnPyccFDtk5MN8Sy8VjTOsl/+J5GUd4zaOo3wPEpKhtvg+GAKhdHD/UvKiUGtjI6Wvzjn5hMVqIqfvsvaQL4R+tj3wUvSLs9jg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:CS1PR84MB0310;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0310; X-Forefront-PRVS: 0913EA1D60 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(377454003)(24454002)(5004730100002)(80316001)(2351001)(87266999)(19580405001)(54356999)(19580395003)(5008740100001)(50466002)(86362001)(2906002)(50986999)(76176999)(586003)(23756003)(42186005)(92566002)(64126003)(83506001)(36756003)(2950100001)(77096005)(15975445007)(189998001)(110136002)(81166005)(1096002)(99136001)(230700001)(59896002)(6116002)(3846002)(117156001)(47776003)(65956001)(4326007)(65806001)(4001350100001)(33656002)(66066001);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0310;H:[192.168.142.158];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;CS1PR84MB0310;23:mGyyVwHB0inwU2g+nxaJYfmYOnAj7M963qbasr1?= =?iso-8859-1?Q?AZoazvRJmvjlribrzbVLeqqkrpGMV4+XjOZlBhukMSuFU9hTBs97QOzP3J?= =?iso-8859-1?Q?8f6N+VHlxaEWcn8rV6/w8GoDF9z5SCWEAIxXBaB3L0Uq3KGgbP676g4Gd+?= =?iso-8859-1?Q?XWijDWctjMwC0O94SL0JD1Q2aYOvjUJSSmfG/xGN8VNe6pw2f5+LGyJDfH?= =?iso-8859-1?Q?Ba8+PJwMlFlbGPxO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fcrIucsym7j?= =?iso-8859-1?Q?yAWWGCmRNcOHd2s6nV6UtLfphNnpra2vF2xuzoAkaWj/6FD3vTfyLFwBV+?= =?iso-8859-1?Q?xbjke5Fbbhd6cqtHmORTScFbvm1kOEsSw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CS1PR84MB0310;5:rocaXiOGIWJfocHKlgxPqEt/cq3rl1x8Ma+JwMmllyAM7wjyehQ3xbfSIMi1GK1ABpDCokIKb8UA12G8h3tPtYMjoJV2VPi+vG0Li+4fXzJ2RpifTqIvol7k4EIjZH071mknzFZvNhownaGub6QFaUXQ8IYd6AsdB5FYoZPzS8z0cZelX158W7npW62+78rd;24:12m9kjApI/U3hHCu9W4lF15YUorbIbDSDRUEKP5WW8E/O4EK7mvRH1oqESsz2+IFCeFdFPv+vaTndn6chS5Wu8U+ngq5+SoS7xYcXgY0/P4=;7:7GkHKZctzLHHnm77vfS2gH8B2ZSX2RhzEUwpbFel71fN2uc03P5S8RVm/KAf5ePM1ZHcESCBDcOTcpoiNTq5RCK/tzs1kGeqKkWqF4Nq850ukgDTUIMI9o7X+btvz+3RNLsbqt8HrK4CztngnDLpg8ckRsFsIFw+Rc8WvPX4M3EzfYUIOYrszK3mSCHQ18lkDiIVzxVtHQ57UDoL5VTmhRL16Rx+P70qyiSVnMF3jkA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2016 17:37:15.2498 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0310 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2146 Lines: 51 On 04/15/2016 12:05 AM, ling.ma.program@gmail.com wrote: > From: Ma Ling > > Wire-latency(RC delay) dominate modern computer performance, > conventional serialized works cause cache line ping-pong seriously, > the process spend lots of time and power to complete. > specially on multi-core platform. > > However if the serialized works are sent to one core and executed > ONLY when contention happens, that can save much time and power, > because all shared data are located in private cache of one core. > We call the mechanism as Adaptive Lock Integration. > (ali workqueue) > > The new code is based on qspinlock and implement Lock Integration, > when user space application cause the bottle neck from kernel spinlock > the new mechanism could improve performance up to 1.65x for > https://lkml.org/lkml/2016/2/4/48 or > http://lkml.iu.edu/hypermail/linux/kernel/1602.0/03745.html > and 2.79x for https://lkml.org/lkml/2016/4/4/848 respectively. > > And additional changes on Makefile/Kconfig are made to enable compiling of > this feature on x86 platform. > > Signed-off-by: Ma Ling > --- > The patch is based on https://lkml.org/lkml/2015/12/31/20, > in this version we append init function and fix function name. > > arch/x86/Kconfig | 1 + > include/linux/aliworkqueue.h | 34 ++++++++++++++ > kernel/Kconfig.locks | 7 +++ > kernel/locking/Makefile | 1 + > kernel/locking/aliworkqueue.c | 97 +++++++++++++++++++++++++++++++++++++++++ > 5 files changed, 140 insertions(+), 0 deletions(-) > create mode 100644 include/linux/aliworkqueue.h > create mode 100644 kernel/locking/aliworkqueue.c > > As I said before, you need a use case within the kernel to demonstrate its usefulness. The Linux kernel community will not accept code that isn't used anywhere. A major problem to convert regular locking code to using the aliworkqueue is that it requires rather significant code changes. So you really need a good use case where you can show the performance benefit is much greater the cost of making the conversion. Cheers, Longman