[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-41946c86876ea6a3e8857182356e6d76dbfe7fb6@git.kernel.org>
Date: Tue, 22 Nov 2016 04:32:00 -0800
From: tip-bot for Pan Xinhui <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, xinhui.pan@...ux.vnet.ibm.com,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
mingo@...nel.org, boqun.feng@...il.com, hpa@...or.com,
tglx@...utronix.de
Subject: [tip:locking/core] locking/core, powerpc: Implement
vcpu_is_preempted(cpu)
Commit-ID: 41946c86876ea6a3e8857182356e6d76dbfe7fb6
Gitweb: http://git.kernel.org/tip/41946c86876ea6a3e8857182356e6d76dbfe7fb6
Author: Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>
AuthorDate: Wed, 2 Nov 2016 05:08:31 -0400
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 22 Nov 2016 12:48:06 +0100
locking/core, powerpc: Implement vcpu_is_preempted(cpu)
Optimize spinlock and mutex busy-loops by providing a vcpu_is_preempted(cpu)
function on pSeries. We do not support PowerNV.
All this can be achieved by using lppaca->yield_count, which is zero on PowerNV.
Suggested-by: Boqun Feng <boqun.feng@...il.com>
Suggested-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: David.Laight@...LAB.COM
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: benh@...nel.crashing.org
Cc: borntraeger@...ibm.com
Cc: bsingharora@...il.com
Cc: dave@...olabs.net
Cc: jgross@...e.com
Cc: kernellwp@...il.com
Cc: konrad.wilk@...cle.com
Cc: linuxppc-dev@...ts.ozlabs.org
Cc: mpe@...erman.id.au
Cc: paulmck@...ux.vnet.ibm.com
Cc: paulus@...ba.org
Cc: pbonzini@...hat.com
Cc: rkrcmar@...hat.com
Cc: virtualization@...ts.linux-foundation.org
Cc: will.deacon@....com
Cc: xen-devel-request@...ts.xenproject.org
Cc: xen-devel@...ts.xenproject.org
Link: http://lkml.kernel.org/r/1478077718-37424-5-git-send-email-xinhui.pan@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/powerpc/include/asm/spinlock.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index fa37fe9..8c1b913 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -52,6 +52,14 @@
#define SYNC_IO
#endif
+#ifdef CONFIG_PPC_PSERIES
+#define vcpu_is_preempted vcpu_is_preempted
+static inline bool vcpu_is_preempted(int cpu)
+{
+ return !!(be32_to_cpu(lppaca_of(cpu).yield_count) & 1);
+}
+#endif
+
static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
{
return lock.slock == 0;
Powered by blists - more mailing lists