From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbcF0Hzh (ORCPT ); Mon, 27 Jun 2016 03:55:37 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52969 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750870AbcF0Hzg (ORCPT ); Mon, 27 Jun 2016 03:55:36 -0400 Date: Mon, 27 Jun 2016 09:55:22 +0200 From: Peter Zijlstra To: panxinhui Cc: Boqun Feng , Pan Xinhui , linux-kernel@vger.kernel.org, mingo@redhat.com, dave@stgolabs.net, will.deacon@arm.com, Waiman.Long@hpe.com, benh@kernel.crashing.org Subject: Re: [PATCH] locking/osq: Drop the overload of osq lock Message-ID: <20160627075522.GT30154@twins.programming.kicks-ass.net> References: <1466876523-33437-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160625142447.GK30154@twins.programming.kicks-ass.net> <20160625152130.GA2452@insomnia> <20160625160922.GL30154@twins.programming.kicks-ass.net> <20160625161307.GZ30927@twins.programming.kicks-ass.net> <90D0C23D-65D5-40A8-89F1-4D02506A9CBC@linux.vnet.ibm.com> <20160625191217.GO30154@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 26, 2016 at 12:59:01PM +0800, panxinhui wrote: > > > 在 2016年6月26日,03:12,Peter Zijlstra 写道: > > > > On Sun, Jun 26, 2016 at 01:27:51AM +0800, panxinhui wrote: > > > >> by the way I still think mutex_unlock has a big overload too. > > > > Do you mean overhead? > > > oh, maybe you are right. > mutex_unlock ’s implementation uses inc_return variant on ppc, and > that’s expensive. I am thinking of using cmpxchg instead. That statement doesn't make any sense. PPC is an LL/SC arch, inc_return and cmpxchg are the 'same' LL/SC loop.