aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPan Xinhui <[email protected]>2016-06-14 14:37:27 +0800
committerIngo Molnar <[email protected]>2016-06-27 11:37:41 +0200
commit0dceeaf599e6d9b8bd908ba4bd3dfee84aa26be2 (patch)
tree901f7641d6bc6ed48fdffaee6f85f155e0fb8a07
parentebff09a6ff164aec2b33bf1f9a488c45ac108413 (diff)
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Rewrote changelog. ] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--kernel/locking/qspinlock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c
index 730655533440..b2caec7315af 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);