mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] locking/qspinlock: Use __this_cpu_dec instead
@ 2016-06-14  6:37 Pan Xinhui
  2016-06-27 12:56 ` [tip:locking/core] locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec() tip-bot for Pan Xinhui
  0 siblings, 1 reply; 2+ messages in thread
From: Pan Xinhui @ 2016-06-14  6:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, Waiman.Long, Pan Xinhui

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 <xinhui.pan@linux.vnet.ibm.com>
---
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-27 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-14  6:37 [PATCH v2] locking/qspinlock: Use __this_cpu_dec instead Pan Xinhui
2016-06-27 12:56 ` [tip:locking/core] locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec() tip-bot for Pan Xinhui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome