From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbcFFDVs (ORCPT ); Sun, 5 Jun 2016 23:21:48 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37850 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753103AbcFFDVq (ORCPT ); Sun, 5 Jun 2016 23:21:46 -0400 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: xinhui.pan@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Mon, 06 Jun 2016 11:21:13 +0800 From: xinhui User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Peter Zijlstra CC: linux-kernel@vger.kernel.org, mingo@redhat.com, waiman.long@hpe.com Subject: Re: [PATCH] locking/qspinlock: Use this_cpu_ptr instead of this_cpu_dec References: <1464947330-3568-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160603113703.GK3190@twins.programming.kicks-ass.net> In-Reply-To: <20160603113703.GK3190@twins.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: 16060603-0052-0000-0000-0000019D622D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16060603-0053-0000-0000-00000621441D Message-Id: <5754EC29.2090503@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-06_02:,, 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-1604210000 definitions=main-1606060039 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016年06月03日 19:37, Peter Zijlstra wrote: > On Fri, Jun 03, 2016 at 05:48:50PM +0800, Pan Xinhui wrote: >> queued_spin_lock_slowpath should not worry about interrupt change >> node->count by accident because ->count is inc and dec when we >> enter/leave queued_spin_lock_slowpath. >> >> So this_cpu_dec() does some no point things here, lets use this_cpu_ptr >> for a small optimization. > > Uhm, have you actually looked at what that does on x86? > yep, just one instruction inc/dec. well, with my patch, there are two instructions.