From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751899AbcF0M5G (ORCPT ); Mon, 27 Jun 2016 08:57:06 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41650 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751696AbcF0M5E (ORCPT ); Mon, 27 Jun 2016 08:57:04 -0400 Date: Mon, 27 Jun 2016 05:56:29 -0700 From: tip-bot for Pan Xinhui Message-ID: Cc: mingo@kernel.org, torvalds@linux-foundation.org, efault@gmx.de, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, xinhui.pan@linux.vnet.ibm.com, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, xinhui.pan@linux.vnet.ibm.com, tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com, efault@gmx.de, torvalds@linux-foundation.org, mingo@kernel.org In-Reply-To: <1465886247-3773-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> References: <1465886247-3773-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec() Git-Commit-ID: 0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2 Gitweb: http://git.kernel.org/tip/0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2 Author: Pan Xinhui AuthorDate: Tue, 14 Jun 2016 14:37:27 +0800 Committer: Ingo Molnar CommitDate: Mon, 27 Jun 2016 11:37:41 +0200 locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec() queued_spin_lock_slowpath() should not worry about another queued_spin_lock_slowpath() running in interrupt context and changing node->count by accident, because node->count keeps the same value every time we enter/leave queued_spin_lock_slowpath(). On some architectures this_cpu_dec() will save/restore irq flags, which has high overhead. Use the much cheaper __this_cpu_dec() instead. Signed-off-by: Pan Xinhui Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Waiman.Long@hpe.com Link: http://lkml.kernel.org/r/1465886247-3773-1-git-send-email-xinhui.pan@linux.vnet.ibm.com [ Rewrote changelog. ] Signed-off-by: Ingo Molnar --- 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 7306555..b2caec7 100644 --- a/kernel/locking/qspinlock.c +++ b/kernel/locking/qspinlock.c @@ -619,7 +619,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);