From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751515AbcFNGhk (ORCPT ); Tue, 14 Jun 2016 02:37:40 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47220 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751039AbcFNGhj (ORCPT ); Tue, 14 Jun 2016 02:37:39 -0400 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: xinhui.pan@linux.vnet.ibm.com X-IBM-RcptTo: Waiman.Long@hpe.com;peterz@infradead.org;mingo@redhat.com;linux-kernel@vger.kernel.org From: Pan Xinhui To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, Waiman.Long@hpe.com, Pan Xinhui Subject: [PATCH v2] locking/qspinlock: Use __this_cpu_dec instead Date: Tue, 14 Jun 2016 14:37:27 +0800 X-Mailer: git-send-email 1.9.1 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16061406-0044-0000-0000-000000646932 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16061406-0045-0000-0000-000004796C8D Message-Id: <1465886247-3773-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-14_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606140073 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org queued_spin_lock_slowpath should not worry about another queued_spin_lock_slowpath which runs in interrupt changes node->count by accident because node->count keeps the same value everytime we enter/leave queued_spin_lock_slowpath. On some archs this_cpu_dec will save/restore irq flags, this will give a heavy work load. Lets use __this_cpu_dec instead. Signed-off-by: Pan Xinhui --- change from v1: replace this_cpu_ptr with __this_cpu_dec --- kernel/locking/qspinlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c index 99f31e4..9fd1a1e 100644 --- a/kernel/locking/qspinlock.c +++ b/kernel/locking/qspinlock.c @@ -492,7 +492,7 @@ release: /* * release the node */ - this_cpu_dec(mcs_nodes[0].count); + __this_cpu_dec(mcs_nodes[0].count); } EXPORT_SYMBOL(queued_spin_lock_slowpath); -- 1.9.1