From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970426AbdAEJt2 (ORCPT ); Thu, 5 Jan 2017 04:49:28 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:60024 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966593AbdAEJs5 (ORCPT ); Thu, 5 Jan 2017 04:48:57 -0500 Date: Thu, 5 Jan 2017 10:48:53 +0100 From: Peter Zijlstra To: Pan Xinhui Cc: Waiman Long , Ingo Molnar , linux-kernel@vger.kernel.org, Boqun Feng Subject: Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs Message-ID: <20170105094853.GE3093@worktop> References: <1482697561-23848-1-git-send-email-longman@redhat.com> <20170103161836.GY3107@twins.programming.kicks-ass.net> <20170104094149.GD25813@worktop.programming.kicks-ass.net> <006322ad-2e72-c8fe-361f-233f1821063a@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006322ad-2e72-c8fe-361f-233f1821063a@linux.vnet.ibm.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 05, 2017 at 04:16:38PM +0800, Pan Xinhui wrote: > I do some tests about cmpxchg and cmpxchg_acquire before on ppc. > > loops in 15s of each cmpxchg is below. > > cmpxchg_relaxed: 336663 > cmpxchg_release: 369054 > cmpxchg_acquire: 363364 > cmpxchg: 179435 > > so cmpxchg is really expensive than others. > but I also have doubt about the cmpxchg_relaxed, it should be the cheapest, but from the tests, release/acquire are faster than it. Right, curious about that relaxed one. In any case, I was more wondering about the performance impact on the larger construct of the pvlock itself.