* [PATCHv1] x86: reintroduce read_unlock() optimization
@ 2015-07-08 16:07 David Vrabel
0 siblings, 0 replies; only message in thread
From: David Vrabel @ 2015-07-08 16:07 UTC (permalink / raw)
To: xen-devel
Cc: Andrew Cooper, Stefano Stabellini, David Vrabel, Jan Beulich,
Ian Campbell
Commit 902d1b5c310fb63b511f0b967cf5f32d3f605f3d (x86,arm: remove
asm/spinlock.h from all architectures) inadvertantly removed an
x86-specific optimization for read_unlock*().
Re-add asm/spinlock.h to allow architectures to provide an optmized
_raw_read_unlock() and make x86 provide the previous implementation.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
xen/include/asm-arm/spinlock.h | 6 ++++++
xen/include/asm-x86/spinlock.h | 7 +++++++
xen/include/xen/spinlock.h | 1 +
3 files changed, 14 insertions(+)
create mode 100644 xen/include/asm-arm/spinlock.h
create mode 100644 xen/include/asm-x86/spinlock.h
diff --git a/xen/include/asm-arm/spinlock.h b/xen/include/asm-arm/spinlock.h
new file mode 100644
index 0000000..81955d1
--- /dev/null
+++ b/xen/include/asm-arm/spinlock.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_SPINLOCK_H
+#define __ASM_SPINLOCK_H
+
+/* Nothing ARM specific. */
+
+#endif /* __ASM_SPINLOCK_H */
diff --git a/xen/include/asm-x86/spinlock.h b/xen/include/asm-x86/spinlock.h
new file mode 100644
index 0000000..7d69e75
--- /dev/null
+++ b/xen/include/asm-x86/spinlock.h
@@ -0,0 +1,7 @@
+#ifndef __ASM_SPINLOCK_H
+#define __ASM_SPINLOCK_H
+
+#define _raw_read_unlock(l) \
+ asm volatile ( "lock; dec%z0 %0" : "+m" ((l)->lock) :: "memory" )
+
+#endif /* __ASM_SPINLOCK_H */
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 9286543..fb0438e 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -2,6 +2,7 @@
#define __SPINLOCK_H__
#include <asm/system.h>
+#include <asm/spinlock.h>
#ifndef NDEBUG
struct lock_debug {
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-08 16:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 16:07 [PATCHv1] x86: reintroduce read_unlock() optimization David Vrabel
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).