From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033045AbdAEIRa (ORCPT ); Thu, 5 Jan 2017 03:17:30 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35869 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936433AbdAEIQf (ORCPT ); Thu, 5 Jan 2017 03:16:35 -0500 Subject: Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs To: Peter Zijlstra , Waiman Long References: <1482697561-23848-1-git-send-email-longman@redhat.com> <20170103161836.GY3107@twins.programming.kicks-ass.net> <20170104094149.GD25813@worktop.programming.kicks-ass.net> Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Boqun Feng From: Pan Xinhui Date: Thu, 5 Jan 2017 16:16:38 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170104094149.GD25813@worktop.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17010508-0012-0000-0000-0000020064EE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17010508-0013-0000-0000-000006C1EB59 Message-Id: <006322ad-2e72-c8fe-361f-233f1821063a@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-05_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701050132 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2017/1/4 17:41, Peter Zijlstra 写道: > On Tue, Jan 03, 2017 at 05:07:54PM -0500, Waiman Long wrote: >> On 01/03/2017 11:18 AM, Peter Zijlstra wrote: >>> On Sun, Dec 25, 2016 at 03:26:01PM -0500, Waiman Long wrote: >>>> A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more >>>> relaxed versions to improve performance on architectures that use LL/SC. >>> Claim without numbers ;-) >> >> Well it is hard to produce actual numbers here as I don't have the setup >> to gather data. > > Surely RHT has big PPC machines around? I know that getting to them is a > wee bit of a bother, but they should be available somewhere. > hi, 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. thanks xinhui