linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Pan Xinhui <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:locking/core] locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec()
Date: Mon, 27 Jun 2016 05:56:29 -0700	[thread overview]
Message-ID: <tip-0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2@git.kernel.org> (raw)
In-Reply-To: <1465886247-3773-1-git-send-email-xinhui.pan@linux.vnet.ibm.com>

Commit-ID:  0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2
Gitweb:     http://git.kernel.org/tip/0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2
Author:     Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
AuthorDate: Tue, 14 Jun 2016 14:37:27 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
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 <xinhui.pan@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
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 <mingo@kernel.org>
---
 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);
 

      reply	other threads:[~2016-06-27 12:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14  6:37 [PATCH v2] locking/qspinlock: Use __this_cpu_dec instead Pan Xinhui
2016-06-27 12:56 ` tip-bot for Pan Xinhui [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=xinhui.pan@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).