locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec()
authorPan Xinhui <xinhui.pan@linux.vnet.ibm.com>
Tue, 14 Jun 2016 06:37:27 +0000 (14:37 +0800)
committerIngo Molnar <mingo@kernel.org>
Mon, 27 Jun 2016 09:37:41 +0000 (11:37 +0200)
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

index 730655533440e6cd898b93af6404ba05e505906e..b2caec7315af5b622a00f8babfd55bb3f27fb315 100644 (file)
@@ -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);