All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: benh@kernel.crashing.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
	paulus@au.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: 64-bit ppc rwsem
Date: Tue, 17 Aug 2010 22:28:18 -0700 (PDT)	[thread overview]
Message-ID: <20100817.222818.193699062.davem@davemloft.net> (raw)
In-Reply-To: <1282107803.22370.173.camel@pasglop>

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Wed, 18 Aug 2010 15:03:23 +1000

> I tried various tricks but so far they didn't work. I'll have another
> look tomorrow, but I may end up having to keep all the crap typecasts.

The casts are pretty much unavoidable.

Here's what I'm going to end up using on sparc64:

--------------------
sparc64: Make rwsems 64-bit.

Basically tip-off the powerpc code, use a 64-bit type and atomic64_t
interfaces for the implementation.

This gets us off of the by-hand asm code I wrote, which frankly I
think probably ruins I-cache hit rates.

The idea was the keep the call chains less deep, but anything taking
the rw-semaphores probably is also calling other stuff and therefore
already has allocated a stack-frame.  So no real stack frame savings
ever.

Ben H. has posted patches to make powerpc use 64-bit too and with some
abstractions we can probably use a shared header file somewhere.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/include/asm/rwsem-const.h |   12 ---
 arch/sparc/include/asm/rwsem.h       |  120 +++++++++++++++++++++----
 arch/sparc/lib/Makefile              |    2 +-
 arch/sparc/lib/rwsem_64.S            |  163 ----------------------------------
 4 files changed, 104 insertions(+), 193 deletions(-)
 delete mode 100644 arch/sparc/include/asm/rwsem-const.h
 delete mode 100644 arch/sparc/lib/rwsem_64.S

diff --git a/arch/sparc/include/asm/rwsem-const.h b/arch/sparc/include/asm/rwsem-const.h
deleted file mode 100644
index e4c61a1..0000000
--- a/arch/sparc/include/asm/rwsem-const.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* rwsem-const.h: RW semaphore counter constants.  */
-#ifndef _SPARC64_RWSEM_CONST_H
-#define _SPARC64_RWSEM_CONST_H
-
-#define RWSEM_UNLOCKED_VALUE		0x00000000
-#define RWSEM_ACTIVE_BIAS		0x00000001
-#define RWSEM_ACTIVE_MASK		0x0000ffff
-#define RWSEM_WAITING_BIAS		(-0x00010000)
-#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
-#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
-
-#endif /* _SPARC64_RWSEM_CONST_H */
diff --git a/arch/sparc/include/asm/rwsem.h b/arch/sparc/include/asm/rwsem.h
index 6e56210..a2b4302 100644
--- a/arch/sparc/include/asm/rwsem.h
+++ b/arch/sparc/include/asm/rwsem.h
@@ -15,16 +15,21 @@
 
 #include <linux/list.h>
 #include <linux/spinlock.h>
-#include <asm/rwsem-const.h>
 
 struct rwsem_waiter;
 
 struct rw_semaphore {
-	signed int count;
-	spinlock_t		wait_lock;
-	struct list_head	wait_list;
+	signed long			count;
+#define RWSEM_UNLOCKED_VALUE		0x00000000L
+#define RWSEM_ACTIVE_BIAS		0x00000001L
+#define RWSEM_ACTIVE_MASK		0xffffffffL
+#define RWSEM_WAITING_BIAS		(-RWSEM_ACTIVE_MASK-1)
+#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
+#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
+	spinlock_t			wait_lock;
+	struct list_head		wait_list;
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
-	struct lockdep_map	dep_map;
+	struct lockdep_map		dep_map;
 #endif
 };
 
@@ -41,6 +46,11 @@ struct rw_semaphore {
 #define DECLARE_RWSEM(name) \
 	struct rw_semaphore name = __RWSEM_INITIALIZER(name)
 
+extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
+
 extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
 			 struct lock_class_key *key);
 
@@ -51,27 +61,103 @@ do {								\
 	__init_rwsem((sem), #sem, &__key);			\
 } while (0)
 
-extern void __down_read(struct rw_semaphore *sem);
-extern int __down_read_trylock(struct rw_semaphore *sem);
-extern void __down_write(struct rw_semaphore *sem);
-extern int __down_write_trylock(struct rw_semaphore *sem);
-extern void __up_read(struct rw_semaphore *sem);
-extern void __up_write(struct rw_semaphore *sem);
-extern void __downgrade_write(struct rw_semaphore *sem);
+/*
+ * lock for reading
+ */
+static inline void __down_read(struct rw_semaphore *sem)
+{
+	if (unlikely(atomic64_inc_return((atomic64_t *)(&sem->count)) <= 0L))
+		rwsem_down_read_failed(sem);
+}
+
+static inline int __down_read_trylock(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	while ((tmp = sem->count) >= 0L) {
+		if (tmp == cmpxchg(&sem->count, tmp,
+				   tmp + RWSEM_ACTIVE_READ_BIAS)) {
+			return 1;
+		}
+	}
+	return 0;
+}
 
+/*
+ * lock for writing
+ */
 static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
-	__down_write(sem);
+	long tmp;
+
+	tmp = atomic64_add_return(RWSEM_ACTIVE_WRITE_BIAS,
+				  (atomic64_t *)(&sem->count));
+	if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS))
+		rwsem_down_write_failed(sem);
 }
 
-static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
+static inline void __down_write(struct rw_semaphore *sem)
 {
-	return atomic_add_return(delta, (atomic_t *)(&sem->count));
+	__down_write_nested(sem, 0);
+}
+
+static inline int __down_write_trylock(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
+		      RWSEM_ACTIVE_WRITE_BIAS);
+	return tmp == RWSEM_UNLOCKED_VALUE;
 }
 
-static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
+/*
+ * unlock after reading
+ */
+static inline void __up_read(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = atomic64_dec_return((atomic64_t *)(&sem->count));
+	if (unlikely(tmp < -1L && (tmp & RWSEM_ACTIVE_MASK) == 0L))
+		rwsem_wake(sem);
+}
+
+/*
+ * unlock after writing
+ */
+static inline void __up_write(struct rw_semaphore *sem)
+{
+	if (unlikely(atomic64_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
+					 (atomic64_t *)(&sem->count)) < 0L))
+		rwsem_wake(sem);
+}
+
+/*
+ * implement atomic add functionality
+ */
+static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
+{
+	atomic64_add(delta, (atomic64_t *)(&sem->count));
+}
+
+/*
+ * downgrade write lock to read lock
+ */
+static inline void __downgrade_write(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = atomic64_add_return(-RWSEM_WAITING_BIAS, (atomic64_t *)(&sem->count));
+	if (tmp < 0L)
+		rwsem_downgrade_wake(sem);
+}
+
+/*
+ * implement exchange and add functionality
+ */
+static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
 {
-	atomic_add(delta, (atomic_t *)(&sem->count));
+	return atomic64_add_return(delta, (atomic64_t *)(&sem->count));
 }
 
 static inline int rwsem_is_locked(struct rw_semaphore *sem)
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index c4b5e03..fa4c3ea 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -15,7 +15,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o
 lib-$(CONFIG_SPARC32) += copy_user.o locks.o
 lib-y                 += atomic_$(BITS).o
 lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o
-lib-y                 += rwsem_$(BITS).o
+lib-$(CONFIG_SPARC32) += rwsem_$(BITS).o
 lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o
 
 lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o
diff --git a/arch/sparc/lib/rwsem_64.S b/arch/sparc/lib/rwsem_64.S
deleted file mode 100644
index 91a7d29..0000000
--- a/arch/sparc/lib/rwsem_64.S
+++ /dev/null
@@ -1,163 +0,0 @@
-/* rwsem.S: RW semaphore assembler.
- *
- * Written by David S. Miller (davem@redhat.com), 2001.
- * Derived from asm-i386/rwsem.h
- */
-
-#include <asm/rwsem-const.h>
-
-	.section	.sched.text, "ax"
-
-	.globl		__down_read
-__down_read:
-1:	lduw		[%o0], %g1
-	add		%g1, 1, %g7
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 add		%g7, 1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_down_read_failed
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__down_read, .-__down_read
-
-	.globl		__down_read_trylock
-__down_read_trylock:
-1:	lduw		[%o0], %g1
-	add		%g1, 1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 2f
-	 mov		0, %o1
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 mov		1, %o1
-2:	retl
-	 mov		%o1, %o0
-	.size		__down_read_trylock, .-__down_read_trylock
-
-	.globl		__down_write
-__down_write:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	add		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 cmp		%g7, 0
-	bne,pn		%icc, 3f
-	 nop
-2:	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_down_write_failed
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__down_write, .-__down_write
-
-	.globl		__down_write_trylock
-__down_write_trylock:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	cmp		%g3, 0
-	bne,pn		%icc, 2f
-	 mov		0, %o1
-	add		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 mov		1, %o1
-2:	retl
-	 mov		%o1, %o0
-	.size		__down_write_trylock, .-__down_write_trylock
-
-	.globl		__up_read
-__up_read:
-1:
-	lduw		[%o0], %g1
-	sub		%g1, 1, %g7
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:	retl
-	 nop
-3:	sethi		%hi(RWSEM_ACTIVE_MASK), %g1
-	sub		%g7, 1, %g7
-	or		%g1, %lo(RWSEM_ACTIVE_MASK), %g1
-	andcc		%g7, %g1, %g0
-	bne,pn		%icc, 2b
-	 nop
-	save		%sp, -192, %sp
-	call		rwsem_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__up_read, .-__up_read
-
-	.globl		__up_write
-__up_write:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	sub		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 sub		%g7, %g1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__up_write, .-__up_write
-
-	.globl		__downgrade_write
-__downgrade_write:
-	sethi		%hi(RWSEM_WAITING_BIAS), %g1
-	or		%g1, %lo(RWSEM_WAITING_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	sub		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 sub		%g7, %g1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_downgrade_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__downgrade_write, .-__downgrade_write
-- 
1.7.2.1


WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: benh@kernel.crashing.org
Cc: torvalds@linux-foundation.org, paulus@au.ibm.com,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
	akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: 64-bit ppc rwsem
Date: Wed, 18 Aug 2010 05:28:18 +0000	[thread overview]
Message-ID: <20100817.222818.193699062.davem@davemloft.net> (raw)
In-Reply-To: <1282107803.22370.173.camel@pasglop>

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Wed, 18 Aug 2010 15:03:23 +1000

> I tried various tricks but so far they didn't work. I'll have another
> look tomorrow, but I may end up having to keep all the crap typecasts.

The casts are pretty much unavoidable.

Here's what I'm going to end up using on sparc64:

--------------------
sparc64: Make rwsems 64-bit.

Basically tip-off the powerpc code, use a 64-bit type and atomic64_t
interfaces for the implementation.

This gets us off of the by-hand asm code I wrote, which frankly I
think probably ruins I-cache hit rates.

The idea was the keep the call chains less deep, but anything taking
the rw-semaphores probably is also calling other stuff and therefore
already has allocated a stack-frame.  So no real stack frame savings
ever.

Ben H. has posted patches to make powerpc use 64-bit too and with some
abstractions we can probably use a shared header file somewhere.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/include/asm/rwsem-const.h |   12 ---
 arch/sparc/include/asm/rwsem.h       |  120 +++++++++++++++++++++----
 arch/sparc/lib/Makefile              |    2 +-
 arch/sparc/lib/rwsem_64.S            |  163 ----------------------------------
 4 files changed, 104 insertions(+), 193 deletions(-)
 delete mode 100644 arch/sparc/include/asm/rwsem-const.h
 delete mode 100644 arch/sparc/lib/rwsem_64.S

diff --git a/arch/sparc/include/asm/rwsem-const.h b/arch/sparc/include/asm/rwsem-const.h
deleted file mode 100644
index e4c61a1..0000000
--- a/arch/sparc/include/asm/rwsem-const.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* rwsem-const.h: RW semaphore counter constants.  */
-#ifndef _SPARC64_RWSEM_CONST_H
-#define _SPARC64_RWSEM_CONST_H
-
-#define RWSEM_UNLOCKED_VALUE		0x00000000
-#define RWSEM_ACTIVE_BIAS		0x00000001
-#define RWSEM_ACTIVE_MASK		0x0000ffff
-#define RWSEM_WAITING_BIAS		(-0x00010000)
-#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
-#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
-
-#endif /* _SPARC64_RWSEM_CONST_H */
diff --git a/arch/sparc/include/asm/rwsem.h b/arch/sparc/include/asm/rwsem.h
index 6e56210..a2b4302 100644
--- a/arch/sparc/include/asm/rwsem.h
+++ b/arch/sparc/include/asm/rwsem.h
@@ -15,16 +15,21 @@
 
 #include <linux/list.h>
 #include <linux/spinlock.h>
-#include <asm/rwsem-const.h>
 
 struct rwsem_waiter;
 
 struct rw_semaphore {
-	signed int count;
-	spinlock_t		wait_lock;
-	struct list_head	wait_list;
+	signed long			count;
+#define RWSEM_UNLOCKED_VALUE		0x00000000L
+#define RWSEM_ACTIVE_BIAS		0x00000001L
+#define RWSEM_ACTIVE_MASK		0xffffffffL
+#define RWSEM_WAITING_BIAS		(-RWSEM_ACTIVE_MASK-1)
+#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
+#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
+	spinlock_t			wait_lock;
+	struct list_head		wait_list;
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
-	struct lockdep_map	dep_map;
+	struct lockdep_map		dep_map;
 #endif
 };
 
@@ -41,6 +46,11 @@ struct rw_semaphore {
 #define DECLARE_RWSEM(name) \
 	struct rw_semaphore name = __RWSEM_INITIALIZER(name)
 
+extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
+
 extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
 			 struct lock_class_key *key);
 
@@ -51,27 +61,103 @@ do {								\
 	__init_rwsem((sem), #sem, &__key);			\
 } while (0)
 
-extern void __down_read(struct rw_semaphore *sem);
-extern int __down_read_trylock(struct rw_semaphore *sem);
-extern void __down_write(struct rw_semaphore *sem);
-extern int __down_write_trylock(struct rw_semaphore *sem);
-extern void __up_read(struct rw_semaphore *sem);
-extern void __up_write(struct rw_semaphore *sem);
-extern void __downgrade_write(struct rw_semaphore *sem);
+/*
+ * lock for reading
+ */
+static inline void __down_read(struct rw_semaphore *sem)
+{
+	if (unlikely(atomic64_inc_return((atomic64_t *)(&sem->count)) <= 0L))
+		rwsem_down_read_failed(sem);
+}
+
+static inline int __down_read_trylock(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	while ((tmp = sem->count) >= 0L) {
+		if (tmp = cmpxchg(&sem->count, tmp,
+				   tmp + RWSEM_ACTIVE_READ_BIAS)) {
+			return 1;
+		}
+	}
+	return 0;
+}
 
+/*
+ * lock for writing
+ */
 static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
-	__down_write(sem);
+	long tmp;
+
+	tmp = atomic64_add_return(RWSEM_ACTIVE_WRITE_BIAS,
+				  (atomic64_t *)(&sem->count));
+	if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS))
+		rwsem_down_write_failed(sem);
 }
 
-static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
+static inline void __down_write(struct rw_semaphore *sem)
 {
-	return atomic_add_return(delta, (atomic_t *)(&sem->count));
+	__down_write_nested(sem, 0);
+}
+
+static inline int __down_write_trylock(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
+		      RWSEM_ACTIVE_WRITE_BIAS);
+	return tmp = RWSEM_UNLOCKED_VALUE;
 }
 
-static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
+/*
+ * unlock after reading
+ */
+static inline void __up_read(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = atomic64_dec_return((atomic64_t *)(&sem->count));
+	if (unlikely(tmp < -1L && (tmp & RWSEM_ACTIVE_MASK) = 0L))
+		rwsem_wake(sem);
+}
+
+/*
+ * unlock after writing
+ */
+static inline void __up_write(struct rw_semaphore *sem)
+{
+	if (unlikely(atomic64_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
+					 (atomic64_t *)(&sem->count)) < 0L))
+		rwsem_wake(sem);
+}
+
+/*
+ * implement atomic add functionality
+ */
+static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
+{
+	atomic64_add(delta, (atomic64_t *)(&sem->count));
+}
+
+/*
+ * downgrade write lock to read lock
+ */
+static inline void __downgrade_write(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = atomic64_add_return(-RWSEM_WAITING_BIAS, (atomic64_t *)(&sem->count));
+	if (tmp < 0L)
+		rwsem_downgrade_wake(sem);
+}
+
+/*
+ * implement exchange and add functionality
+ */
+static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
 {
-	atomic_add(delta, (atomic_t *)(&sem->count));
+	return atomic64_add_return(delta, (atomic64_t *)(&sem->count));
 }
 
 static inline int rwsem_is_locked(struct rw_semaphore *sem)
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index c4b5e03..fa4c3ea 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -15,7 +15,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o
 lib-$(CONFIG_SPARC32) += copy_user.o locks.o
 lib-y                 += atomic_$(BITS).o
 lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o
-lib-y                 += rwsem_$(BITS).o
+lib-$(CONFIG_SPARC32) += rwsem_$(BITS).o
 lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o
 
 lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o
diff --git a/arch/sparc/lib/rwsem_64.S b/arch/sparc/lib/rwsem_64.S
deleted file mode 100644
index 91a7d29..0000000
--- a/arch/sparc/lib/rwsem_64.S
+++ /dev/null
@@ -1,163 +0,0 @@
-/* rwsem.S: RW semaphore assembler.
- *
- * Written by David S. Miller (davem@redhat.com), 2001.
- * Derived from asm-i386/rwsem.h
- */
-
-#include <asm/rwsem-const.h>
-
-	.section	.sched.text, "ax"
-
-	.globl		__down_read
-__down_read:
-1:	lduw		[%o0], %g1
-	add		%g1, 1, %g7
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 add		%g7, 1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_down_read_failed
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__down_read, .-__down_read
-
-	.globl		__down_read_trylock
-__down_read_trylock:
-1:	lduw		[%o0], %g1
-	add		%g1, 1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 2f
-	 mov		0, %o1
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 mov		1, %o1
-2:	retl
-	 mov		%o1, %o0
-	.size		__down_read_trylock, .-__down_read_trylock
-
-	.globl		__down_write
-__down_write:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	add		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 cmp		%g7, 0
-	bne,pn		%icc, 3f
-	 nop
-2:	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_down_write_failed
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__down_write, .-__down_write
-
-	.globl		__down_write_trylock
-__down_write_trylock:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	cmp		%g3, 0
-	bne,pn		%icc, 2f
-	 mov		0, %o1
-	add		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 mov		1, %o1
-2:	retl
-	 mov		%o1, %o0
-	.size		__down_write_trylock, .-__down_write_trylock
-
-	.globl		__up_read
-__up_read:
-1:
-	lduw		[%o0], %g1
-	sub		%g1, 1, %g7
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:	retl
-	 nop
-3:	sethi		%hi(RWSEM_ACTIVE_MASK), %g1
-	sub		%g7, 1, %g7
-	or		%g1, %lo(RWSEM_ACTIVE_MASK), %g1
-	andcc		%g7, %g1, %g0
-	bne,pn		%icc, 2b
-	 nop
-	save		%sp, -192, %sp
-	call		rwsem_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__up_read, .-__up_read
-
-	.globl		__up_write
-__up_write:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	sub		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 sub		%g7, %g1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__up_write, .-__up_write
-
-	.globl		__downgrade_write
-__downgrade_write:
-	sethi		%hi(RWSEM_WAITING_BIAS), %g1
-	or		%g1, %lo(RWSEM_WAITING_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	sub		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 sub		%g7, %g1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_downgrade_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__downgrade_write, .-__downgrade_write
-- 
1.7.2.1


WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: benh@kernel.crashing.org
Cc: torvalds@linux-foundation.org, paulus@au.ibm.com,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
	akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: 64-bit ppc rwsem
Date: Tue, 17 Aug 2010 22:28:18 -0700 (PDT)	[thread overview]
Message-ID: <20100817.222818.193699062.davem@davemloft.net> (raw)
In-Reply-To: <1282107803.22370.173.camel@pasglop>

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Wed, 18 Aug 2010 15:03:23 +1000

> I tried various tricks but so far they didn't work. I'll have another
> look tomorrow, but I may end up having to keep all the crap typecasts.

The casts are pretty much unavoidable.

Here's what I'm going to end up using on sparc64:

--------------------
sparc64: Make rwsems 64-bit.

Basically tip-off the powerpc code, use a 64-bit type and atomic64_t
interfaces for the implementation.

This gets us off of the by-hand asm code I wrote, which frankly I
think probably ruins I-cache hit rates.

The idea was the keep the call chains less deep, but anything taking
the rw-semaphores probably is also calling other stuff and therefore
already has allocated a stack-frame.  So no real stack frame savings
ever.

Ben H. has posted patches to make powerpc use 64-bit too and with some
abstractions we can probably use a shared header file somewhere.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/include/asm/rwsem-const.h |   12 ---
 arch/sparc/include/asm/rwsem.h       |  120 +++++++++++++++++++++----
 arch/sparc/lib/Makefile              |    2 +-
 arch/sparc/lib/rwsem_64.S            |  163 ----------------------------------
 4 files changed, 104 insertions(+), 193 deletions(-)
 delete mode 100644 arch/sparc/include/asm/rwsem-const.h
 delete mode 100644 arch/sparc/lib/rwsem_64.S

diff --git a/arch/sparc/include/asm/rwsem-const.h b/arch/sparc/include/asm/rwsem-const.h
deleted file mode 100644
index e4c61a1..0000000
--- a/arch/sparc/include/asm/rwsem-const.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* rwsem-const.h: RW semaphore counter constants.  */
-#ifndef _SPARC64_RWSEM_CONST_H
-#define _SPARC64_RWSEM_CONST_H
-
-#define RWSEM_UNLOCKED_VALUE		0x00000000
-#define RWSEM_ACTIVE_BIAS		0x00000001
-#define RWSEM_ACTIVE_MASK		0x0000ffff
-#define RWSEM_WAITING_BIAS		(-0x00010000)
-#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
-#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
-
-#endif /* _SPARC64_RWSEM_CONST_H */
diff --git a/arch/sparc/include/asm/rwsem.h b/arch/sparc/include/asm/rwsem.h
index 6e56210..a2b4302 100644
--- a/arch/sparc/include/asm/rwsem.h
+++ b/arch/sparc/include/asm/rwsem.h
@@ -15,16 +15,21 @@
 
 #include <linux/list.h>
 #include <linux/spinlock.h>
-#include <asm/rwsem-const.h>
 
 struct rwsem_waiter;
 
 struct rw_semaphore {
-	signed int count;
-	spinlock_t		wait_lock;
-	struct list_head	wait_list;
+	signed long			count;
+#define RWSEM_UNLOCKED_VALUE		0x00000000L
+#define RWSEM_ACTIVE_BIAS		0x00000001L
+#define RWSEM_ACTIVE_MASK		0xffffffffL
+#define RWSEM_WAITING_BIAS		(-RWSEM_ACTIVE_MASK-1)
+#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
+#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
+	spinlock_t			wait_lock;
+	struct list_head		wait_list;
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
-	struct lockdep_map	dep_map;
+	struct lockdep_map		dep_map;
 #endif
 };
 
@@ -41,6 +46,11 @@ struct rw_semaphore {
 #define DECLARE_RWSEM(name) \
 	struct rw_semaphore name = __RWSEM_INITIALIZER(name)
 
+extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
+
 extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
 			 struct lock_class_key *key);
 
@@ -51,27 +61,103 @@ do {								\
 	__init_rwsem((sem), #sem, &__key);			\
 } while (0)
 
-extern void __down_read(struct rw_semaphore *sem);
-extern int __down_read_trylock(struct rw_semaphore *sem);
-extern void __down_write(struct rw_semaphore *sem);
-extern int __down_write_trylock(struct rw_semaphore *sem);
-extern void __up_read(struct rw_semaphore *sem);
-extern void __up_write(struct rw_semaphore *sem);
-extern void __downgrade_write(struct rw_semaphore *sem);
+/*
+ * lock for reading
+ */
+static inline void __down_read(struct rw_semaphore *sem)
+{
+	if (unlikely(atomic64_inc_return((atomic64_t *)(&sem->count)) <= 0L))
+		rwsem_down_read_failed(sem);
+}
+
+static inline int __down_read_trylock(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	while ((tmp = sem->count) >= 0L) {
+		if (tmp == cmpxchg(&sem->count, tmp,
+				   tmp + RWSEM_ACTIVE_READ_BIAS)) {
+			return 1;
+		}
+	}
+	return 0;
+}
 
+/*
+ * lock for writing
+ */
 static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
-	__down_write(sem);
+	long tmp;
+
+	tmp = atomic64_add_return(RWSEM_ACTIVE_WRITE_BIAS,
+				  (atomic64_t *)(&sem->count));
+	if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS))
+		rwsem_down_write_failed(sem);
 }
 
-static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
+static inline void __down_write(struct rw_semaphore *sem)
 {
-	return atomic_add_return(delta, (atomic_t *)(&sem->count));
+	__down_write_nested(sem, 0);
+}
+
+static inline int __down_write_trylock(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
+		      RWSEM_ACTIVE_WRITE_BIAS);
+	return tmp == RWSEM_UNLOCKED_VALUE;
 }
 
-static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
+/*
+ * unlock after reading
+ */
+static inline void __up_read(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = atomic64_dec_return((atomic64_t *)(&sem->count));
+	if (unlikely(tmp < -1L && (tmp & RWSEM_ACTIVE_MASK) == 0L))
+		rwsem_wake(sem);
+}
+
+/*
+ * unlock after writing
+ */
+static inline void __up_write(struct rw_semaphore *sem)
+{
+	if (unlikely(atomic64_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
+					 (atomic64_t *)(&sem->count)) < 0L))
+		rwsem_wake(sem);
+}
+
+/*
+ * implement atomic add functionality
+ */
+static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
+{
+	atomic64_add(delta, (atomic64_t *)(&sem->count));
+}
+
+/*
+ * downgrade write lock to read lock
+ */
+static inline void __downgrade_write(struct rw_semaphore *sem)
+{
+	long tmp;
+
+	tmp = atomic64_add_return(-RWSEM_WAITING_BIAS, (atomic64_t *)(&sem->count));
+	if (tmp < 0L)
+		rwsem_downgrade_wake(sem);
+}
+
+/*
+ * implement exchange and add functionality
+ */
+static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
 {
-	atomic_add(delta, (atomic_t *)(&sem->count));
+	return atomic64_add_return(delta, (atomic64_t *)(&sem->count));
 }
 
 static inline int rwsem_is_locked(struct rw_semaphore *sem)
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index c4b5e03..fa4c3ea 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -15,7 +15,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o
 lib-$(CONFIG_SPARC32) += copy_user.o locks.o
 lib-y                 += atomic_$(BITS).o
 lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o
-lib-y                 += rwsem_$(BITS).o
+lib-$(CONFIG_SPARC32) += rwsem_$(BITS).o
 lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o
 
 lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o
diff --git a/arch/sparc/lib/rwsem_64.S b/arch/sparc/lib/rwsem_64.S
deleted file mode 100644
index 91a7d29..0000000
--- a/arch/sparc/lib/rwsem_64.S
+++ /dev/null
@@ -1,163 +0,0 @@
-/* rwsem.S: RW semaphore assembler.
- *
- * Written by David S. Miller (davem@redhat.com), 2001.
- * Derived from asm-i386/rwsem.h
- */
-
-#include <asm/rwsem-const.h>
-
-	.section	.sched.text, "ax"
-
-	.globl		__down_read
-__down_read:
-1:	lduw		[%o0], %g1
-	add		%g1, 1, %g7
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 add		%g7, 1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_down_read_failed
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__down_read, .-__down_read
-
-	.globl		__down_read_trylock
-__down_read_trylock:
-1:	lduw		[%o0], %g1
-	add		%g1, 1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 2f
-	 mov		0, %o1
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 mov		1, %o1
-2:	retl
-	 mov		%o1, %o0
-	.size		__down_read_trylock, .-__down_read_trylock
-
-	.globl		__down_write
-__down_write:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	add		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 cmp		%g7, 0
-	bne,pn		%icc, 3f
-	 nop
-2:	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_down_write_failed
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__down_write, .-__down_write
-
-	.globl		__down_write_trylock
-__down_write_trylock:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	cmp		%g3, 0
-	bne,pn		%icc, 2f
-	 mov		0, %o1
-	add		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 mov		1, %o1
-2:	retl
-	 mov		%o1, %o0
-	.size		__down_write_trylock, .-__down_write_trylock
-
-	.globl		__up_read
-__up_read:
-1:
-	lduw		[%o0], %g1
-	sub		%g1, 1, %g7
-	cas		[%o0], %g1, %g7
-	cmp		%g1, %g7
-	bne,pn		%icc, 1b
-	 cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:	retl
-	 nop
-3:	sethi		%hi(RWSEM_ACTIVE_MASK), %g1
-	sub		%g7, 1, %g7
-	or		%g1, %lo(RWSEM_ACTIVE_MASK), %g1
-	andcc		%g7, %g1, %g0
-	bne,pn		%icc, 2b
-	 nop
-	save		%sp, -192, %sp
-	call		rwsem_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__up_read, .-__up_read
-
-	.globl		__up_write
-__up_write:
-	sethi		%hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
-	or		%g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	sub		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 sub		%g7, %g1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__up_write, .-__up_write
-
-	.globl		__downgrade_write
-__downgrade_write:
-	sethi		%hi(RWSEM_WAITING_BIAS), %g1
-	or		%g1, %lo(RWSEM_WAITING_BIAS), %g1
-1:
-	lduw		[%o0], %g3
-	sub		%g3, %g1, %g7
-	cas		[%o0], %g3, %g7
-	cmp		%g3, %g7
-	bne,pn		%icc, 1b
-	 sub		%g7, %g1, %g7
-	cmp		%g7, 0
-	bl,pn		%icc, 3f
-	 nop
-2:
-	retl
-	 nop
-3:
-	save		%sp, -192, %sp
-	call		rwsem_downgrade_wake
-	 mov		%i0, %o0
-	ret
-	 restore
-	.size		__downgrade_write, .-__downgrade_write
-- 
1.7.2.1

  reply	other threads:[~2010-08-18  5:28 UTC|newest]

Thread overview: 548+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18  1:03 [GIT] Sparc David Miller
2010-08-18  1:03 ` David Miller
2010-08-18  1:31 ` Linus Torvalds
2010-08-18  1:31   ` Linus Torvalds
2010-08-18  1:59   ` Linus Torvalds
2010-08-18  1:59     ` Linus Torvalds
2010-08-18  2:14     ` David Miller
2010-08-18  2:14       ` David Miller
2010-08-18  4:38       ` 64-bit ppc rwsem (was: Re: [GIT] Sparc) Benjamin Herrenschmidt
2010-08-18  4:38         ` Benjamin Herrenschmidt
2010-08-18  4:38         ` Benjamin Herrenschmidt
2010-08-18  5:03         ` Benjamin Herrenschmidt
2010-08-18  5:03           ` Benjamin Herrenschmidt
2010-08-18  5:03           ` Benjamin Herrenschmidt
2010-08-18  5:28           ` David Miller [this message]
2010-08-18  5:28             ` 64-bit ppc rwsem David Miller
2010-08-18  5:28             ` David Miller
2010-08-18  5:39             ` Sam Ravnborg
2010-08-18  5:39               ` Sam Ravnborg
2010-08-18  5:39               ` Sam Ravnborg
2010-08-18  5:48               ` David Miller
2010-08-18  5:48                 ` David Miller
2010-08-18  5:48                 ` David Miller
2010-08-19  5:23             ` Benjamin Herrenschmidt
2010-08-19  5:23               ` Benjamin Herrenschmidt
2010-08-19  5:23               ` Benjamin Herrenschmidt
2010-08-19  5:29               ` David Miller
2010-08-19  5:29                 ` David Miller
2010-08-19  5:29                 ` David Miller
2010-08-19 10:24                 ` Benjamin Herrenschmidt
2010-08-19 10:24                   ` Benjamin Herrenschmidt
2010-08-19 10:24                   ` Benjamin Herrenschmidt
2010-08-20  5:14                 ` [PATCH 1/2] powerpc: Make rwsem use "long" type Benjamin Herrenschmidt
2010-08-20  5:14                   ` Benjamin Herrenschmidt
2010-08-20  5:14                   ` Benjamin Herrenschmidt
2010-08-24  1:37                   ` Timur Tabi
2010-08-24  1:37                     ` Timur Tabi
2010-08-24  1:37                     ` Timur Tabi
2010-08-20  5:14                 ` [PATCH 2/2] rwsem: Move powerpc atomic-long based implementation to asm-generic Benjamin Herrenschmidt
2010-08-20  5:14                   ` Benjamin Herrenschmidt
2010-08-20  5:14                   ` [PATCH 2/2] rwsem: Move powerpc atomic-long based implementation Benjamin Herrenschmidt
2010-08-20  6:43                   ` [PATCH 2/2] rwsem: Move powerpc atomic-long based implementation to asm-generic Sam Ravnborg
2010-08-20  6:43                     ` Sam Ravnborg
2010-08-20  6:43                     ` [PATCH 2/2] rwsem: Move powerpc atomic-long based Sam Ravnborg
2010-08-24  1:32                     ` [PATCH 2/2] rwsem: Move powerpc atomic-long based implementation to asm-generic Benjamin Herrenschmidt
2010-08-24  1:32                       ` Benjamin Herrenschmidt
2010-08-24  1:32                       ` [PATCH 2/2] rwsem: Move powerpc atomic-long based Benjamin Herrenschmidt
2010-08-23  4:39                   ` [PATCH 2/2] rwsem: Move powerpc atomic-long based implementation to asm-generic David Miller
2010-08-23  4:39                     ` David Miller
2010-08-23  4:39                     ` [PATCH 2/2] rwsem: Move powerpc atomic-long based David Miller
2010-08-23 13:44                 ` 64-bit ppc rwsem Arnd Bergmann
2010-08-23 13:44                   ` Arnd Bergmann
2010-08-23 13:44                   ` Arnd Bergmann
2010-08-23 22:01                   ` Benjamin Herrenschmidt
2010-08-23 22:01                     ` Benjamin Herrenschmidt
2010-08-23 22:01                     ` Benjamin Herrenschmidt
2010-08-23 22:18                     ` David Miller
2010-08-23 22:18                       ` David Miller
2010-08-23 22:18                       ` David Miller
2010-08-24  1:31                       ` Benjamin Herrenschmidt
2010-08-24  1:31                         ` Benjamin Herrenschmidt
2010-08-24  1:31                         ` Benjamin Herrenschmidt
2010-08-24 12:06                         ` Arnd Bergmann
2010-08-24 12:06                           ` Arnd Bergmann
2010-08-24 12:06                           ` Arnd Bergmann
2010-08-18  2:12   ` [GIT] Sparc David Miller
2010-08-18  2:12     ` David Miller
2010-08-18  2:50     ` Al Viro
2010-08-18  2:50       ` Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2021-03-08 23:46 [GIT] SPARC David Miller
2021-03-08 23:46 ` David Miller
2021-03-09  0:19 ` John Paul Adrian Glaubitz
2021-03-09  0:19   ` John Paul Adrian Glaubitz
2021-03-09 19:08   ` David Miller
2021-03-09 19:08     ` David Miller
2021-03-09 19:27     ` Linus Torvalds
2021-03-09 19:27       ` Linus Torvalds
2021-03-10  0:24       ` David Miller
2021-03-10  0:24         ` David Miller
2021-03-10  1:15         ` David Miller
2021-03-10  1:15           ` David Miller
2021-03-10  1:17           ` Linus Torvalds
2021-03-10  1:17             ` Linus Torvalds
2021-03-10  1:18             ` David Miller
2021-03-10  1:18               ` David Miller
2021-03-10 10:40         ` Geert Uytterhoeven
2021-03-10 10:40           ` Geert Uytterhoeven
2021-03-10 13:14           ` Konstantin Ryabitsev
2021-03-10 13:14             ` Konstantin Ryabitsev
2021-02-23 21:21 [GIT] Sparc David Miller
2021-02-23 21:21 ` David Miller
2021-02-23 23:36 ` pr-tracker-bot
2020-06-08  0:16 David Miller
2020-06-08  0:16 ` David Miller
2020-06-08  0:35 ` pr-tracker-bot
2020-04-06 18:25 David Miller
2020-04-06 18:25 ` David Miller
2020-04-07 19:55 ` pr-tracker-bot
2020-02-02 10:57 David Miller
2020-02-02 10:57 ` David Miller
2020-02-02 20:20 ` pr-tracker-bot
2020-01-30 10:19 David Miller
2020-01-30 10:19 ` David Miller
2020-01-30 18:00 ` pr-tracker-bot
2019-07-13  6:17 David Miller
2019-07-13  6:17 ` David Miller
2019-07-13 23:15 ` pr-tracker-bot
2019-06-03  5:21 David Miller
2019-06-03  5:21 ` David Miller
2019-06-03 17:35 ` pr-tracker-bot
2019-05-09 21:35 David Miller
2019-05-09 21:35 ` David Miller
2019-05-09 22:15 ` pr-tracker-bot
2018-12-22 23:46 David Miller
2018-12-22 23:46 ` David Miller
2018-12-26 19:20 ` pr-tracker-bot
2018-12-21 20:42 David Miller
2018-12-21 20:42 ` David Miller
2018-12-21 22:30 ` pr-tracker-bot
2018-12-03  5:33 David Miller
2018-12-03  5:33 ` David Miller
2018-12-03 17:55 ` pr-tracker-bot
2018-11-01  1:44 David Miller
2018-11-01  1:44 ` David Miller
2018-11-01 16:15 ` Linus Torvalds
2018-11-01 16:15   ` Linus Torvalds
2018-10-26 23:08 David Miller
2018-10-26 23:08 ` David Miller
2018-10-27  0:17 ` Linus Torvalds
2018-10-27  0:17   ` Linus Torvalds
2018-10-25 18:28 David Miller
2018-10-25 18:28 ` David Miller
2018-10-26  1:30 ` Linus Torvalds
2018-10-26  1:30   ` Linus Torvalds
2018-10-24  3:31 David Miller
2018-10-24  3:31 ` David Miller
2018-10-24  5:43 ` Linus Torvalds
2018-10-24  5:43   ` Linus Torvalds
2018-10-18 23:33 David Miller
2018-10-18 23:33 ` David Miller
2018-10-19  7:16 ` Greg KH
2018-10-19  7:16   ` Greg KH
2018-10-16  2:39 David Miller
2018-10-16  2:39 ` David Miller
2018-10-16 16:55 ` Greg KH
2018-10-16 16:55   ` Greg KH
2018-10-08  6:48 David Miller
2018-10-08  6:48 ` David Miller
2018-10-08 14:26 ` Greg KH
2018-10-08 14:26   ` Greg KH
2018-08-22  5:16 David Miller
2018-08-22  5:16 ` David Miller
2018-06-09 14:21 David Miller
2018-06-09 14:21 ` David Miller
2018-04-30 20:12 David Miller
2018-04-30 20:12 ` David Miller
2018-04-03 15:31 David Miller
2018-04-03 15:31 ` David Miller
2018-03-15 21:20 David Miller
2018-03-15 21:20 ` David Miller
2018-02-01 15:20 David Miller
2018-02-01 15:20 ` David Miller
2018-01-24 23:23 David Miller
2018-01-24 23:23 ` David Miller
2017-12-31  4:17 David Miller
2017-12-31  4:17 ` David Miller
2017-11-29 20:17 David Miller
2017-11-29 20:17 ` David Miller
2017-11-18  3:15 David Miller
2017-11-18  3:15 ` David Miller
2017-09-10  3:24 David Miller
2017-09-10  3:24 ` David Miller
2017-08-21 21:01 David Miller
2017-08-21 21:01 ` David Miller
2017-08-10  5:26 David Miller
2017-08-10  5:26 ` David Miller
2017-08-04 17:11 David Miller
2017-08-04 17:11 ` David Miller
2017-07-17 20:57 David Miller
2017-07-17 20:57 ` David Miller
2017-07-12  4:05 David Miller
2017-07-12  4:05 ` David Miller
2017-07-08 10:40 David Miller
2017-07-08 10:40 ` David Miller
2017-06-06 20:57 David Miller
2017-06-06 20:57 ` David Miller
2017-05-18 18:03 David Miller
2017-05-18 18:03 ` David Miller
2017-05-09 20:04 David Miller
2017-05-09 20:04 ` David Miller
2017-04-26 19:22 David Miller
2017-04-26 19:22 ` David Miller
2017-04-18 20:20 David Miller
2017-04-18 20:20 ` David Miller
2017-04-07 21:21 David Miller
2017-04-07 21:21 ` David Miller
2017-02-24 16:34 David Miller
2017-02-24 16:34 ` David Miller
2017-01-30 22:37 David Miller
2017-01-30 22:37 ` David Miller
2016-12-12 15:10 David Miller
2016-12-12 15:10 ` David Miller
2016-12-06 17:19 David Miller
2016-12-06 17:19 ` David Miller
2016-11-28 21:03 David Miller
2016-11-28 21:03 ` David Miller
2016-11-21 18:41 David Miller
2016-11-21 18:41 ` David Miller
2016-10-31  1:04 David Miller
2016-10-31  1:04 ` David Miller
2016-10-06  7:57 David Miller
2016-10-06  7:57 ` David Miller
2016-10-02 13:02 David Miller
2016-10-02 13:02 ` David Miller
2016-07-29 18:15 David Miller
2016-07-29 18:15 ` David Miller
2016-06-01  4:17 David Miller
2016-06-01  4:17 ` David Miller
2016-05-22  6:03 David Miller
2016-05-22  6:03 ` David Miller
2016-05-02  5:10 David Miller
2016-05-02  5:10 ` David Miller
2016-03-28 19:45 David Miller
2016-03-28 19:45 ` David Miller
2016-03-01  5:47 David Miller
2016-03-01  5:47 ` David Miller
2016-01-15 21:04 David Miller
2016-01-15 21:04 ` David Miller
2015-12-31 20:30 David Miller
2015-12-31 20:30 ` David Miller
2015-12-24 17:16 David Miller
2015-12-24 17:16 ` David Miller
2015-11-05 21:39 David Miller
2015-11-05 21:39 ` David Miller
2015-11-06  0:43 ` Linus Torvalds
2015-11-06  0:43   ` Linus Torvalds
2015-11-06  0:56   ` Linus Torvalds
2015-11-06  0:56     ` Linus Torvalds
2015-11-06  1:05     ` Julian Calaby
2015-11-06  1:05       ` Julian Calaby
2015-11-06  6:44       ` Julia Lawall
2015-11-06  6:44         ` Julia Lawall
2015-11-07  3:31         ` Julian Calaby
2015-11-07  3:31           ` Julian Calaby
2015-11-07  6:04           ` Julia Lawall
2015-11-07  6:04             ` Julia Lawall
2015-11-06 18:32     ` [PATCH] checkpatch: Warn when casting constants to c90 int or longer types Joe Perches
2015-11-06 18:32       ` Joe Perches
2015-11-06  5:14   ` [GIT] Sparc David Miller
2015-11-06  5:14     ` David Miller
2015-08-07  2:19 David Miller
2015-08-07  2:19 ` David Miller
2015-06-25 13:27 David Miller
2015-06-25 13:27 ` David Miller
2015-06-02  0:17 David Miller
2015-06-02  0:17 ` David Miller
2015-04-22  2:58 David Miller
2015-04-22  2:58 ` David Miller
2015-04-18 21:58 David Miller
2015-04-18 21:58 ` David Miller
2015-04-17 20:14 David Miller
2015-04-17 20:14 ` David Miller
2015-03-23 16:55 David Miller
2015-03-23 16:55 ` David Miller
2015-03-23 17:05 ` Linus Torvalds
2015-03-23 17:05   ` Linus Torvalds
2015-03-23 17:12   ` Linus Torvalds
2015-03-23 17:12     ` Linus Torvalds
2015-03-23 19:14     ` David Miller
2015-03-23 19:14       ` David Miller
2015-03-23 19:10   ` David Miller
2015-03-23 19:10     ` David Miller
2015-03-19  4:59 David Miller
2015-03-19  4:59 ` David Miller
2014-12-18 21:39 David Miller
2014-12-18 21:39 ` David Miller
2014-12-12 20:58 David Miller
2014-12-12 20:58 ` David Miller
2014-11-26 21:42 David Miller
2014-11-26 21:42 ` David Miller
2014-11-16 21:43 David Miller
2014-11-16 21:43 ` David Miller
2014-10-31 20:44 David Miller
2014-10-31 20:44 ` David Miller
2014-10-24 17:32 David Miller
2014-10-24 17:32 ` David Miller
2014-10-24 19:47 ` Linus Torvalds
2014-10-24 19:47   ` Linus Torvalds
2014-10-27 21:09   ` Andrew Morton
2014-10-27 21:09     ` Andrew Morton
2014-10-27 22:43     ` David Miller
2014-10-27 22:43       ` David Miller
2014-10-28 10:49       ` Steve Capper
2014-10-19 17:26 David Miller
2014-10-19 17:26 ` David Miller
2014-10-15 18:45 David Miller
2014-10-15 18:45 ` David Miller
2014-10-10 20:01 David Miller
2014-10-10 20:01 ` David Miller
2014-08-14 23:17 David Miller
2014-08-14 23:17 ` David Miller
2014-08-12  4:01 David Miller
2014-08-12  4:01 ` David Miller
2014-08-06  5:03 David Miller
2014-08-06  5:03 ` David Miller
2014-07-22  5:38 David Miller
2014-07-22  5:38 ` David Miller
2014-06-16  6:45 David Miller
2014-06-16  6:45 ` David Miller
2014-05-22 21:53 David Miller
2014-05-22 21:53 ` David Miller
2014-05-06 15:30 David Miller
2014-05-06 15:30 ` David Miller
2014-05-06 16:29 ` Dave Jones
2014-05-06 16:29   ` Dave Jones
2014-05-06 17:13   ` David Miller
2014-05-06 17:13     ` David Miller
2014-03-24 19:18 David Miller
2014-03-24 19:18 ` David Miller
2014-02-21 17:42 David Miller
2014-02-21 17:42 ` David Miller
2014-01-29  8:51 David Miller
2014-01-29  8:51 ` David Miller
2014-01-05  2:04 David Miller
2014-01-05  2:04 ` David Miller
2013-11-19 22:18 David Miller
2013-11-19 22:18 ` David Miller
2013-11-14 23:19 David Miller
2013-11-14 23:19 ` David Miller
2013-10-03  3:52 David Miller
2013-10-03  3:52 ` David Miller
2013-10-01 17:57 David Miller
2013-10-01 17:57 ` David Miller
2013-07-10 21:00 David Miller
2013-07-10 21:00 ` David Miller
2013-06-19  9:28 David Miller
2013-06-19  9:28 ` David Miller
2013-05-05  2:42 David Miller
2013-05-05  2:42 ` David Miller
2013-04-25  0:08 David Miller
2013-04-25  0:08 ` David Miller
2013-04-21  1:16 David Miller
2013-04-21  1:16 ` David Miller
2013-03-19 21:18 David Miller
2013-03-19 21:18 ` David Miller
2013-02-14 20:14 David Miller
2013-02-14 20:14 ` David Miller
2012-12-20  0:15 David Miller
2012-12-20  0:15 ` David Miller
2012-12-13 20:11 David Miller
2012-12-13 20:11 ` David Miller
2012-12-03 20:33 David Miller
2012-12-03 20:33 ` David Miller
2012-11-23 19:48 David Miller
2012-11-23 19:48 ` David Miller
2012-11-10 19:21 David Miller
2012-11-10 19:21 ` David Miller
2012-10-17  5:05 David Miller
2012-10-17  5:05 ` David Miller
2012-10-12 19:26 David Miller
2012-10-12 19:26 ` David Miller
2012-10-10  1:26 David Miller
2012-10-10  1:26 ` David Miller
2012-10-08 20:18 David Miller
2012-10-08 20:18 ` David Miller
2012-10-10  5:11 ` Al Viro
2012-10-10  5:11   ` Al Viro
2012-10-11  0:34   ` David Miller
2012-10-11  0:34     ` David Miller
2012-10-03  6:14 David Miller
2012-10-03  6:14 ` David Miller
2012-10-02 18:13 David Miller
2012-10-02 18:13 ` David Miller
2012-09-21 19:48 David Miller
2012-09-21 19:48 ` David Miller
2012-07-26 23:58 David Miller
2012-07-26 23:58 ` David Miller
2012-06-15 22:41 David Miller
2012-06-15 22:41 ` David Miller
2012-05-30 22:38 David Miller
2012-05-30 22:38 ` David Miller
2012-05-24 21:32 David Miller
2012-05-24 21:32 ` David Miller
2012-05-24 21:32 ` David Miller
2012-05-21  9:03 David Miller
2012-05-21  9:03 ` David Miller
2012-05-21 17:37 ` Linus Torvalds
2012-05-21 17:37   ` Linus Torvalds
2012-05-21 18:24   ` Sam Ravnborg
2012-05-21 18:24     ` Sam Ravnborg
2012-05-21 18:28     ` Linus Torvalds
2012-05-21 18:28       ` Linus Torvalds
2012-05-21 18:33       ` Linus Torvalds
2012-05-21 18:33         ` Linus Torvalds
2012-05-21 18:52         ` [PATCH] net: drop NET dependency from HAVE_BPF_JIT Sam Ravnborg
2012-05-21 18:52           ` Sam Ravnborg
2012-05-21 18:54           ` Linus Torvalds
2012-05-21 18:54             ` Linus Torvalds
2012-05-21 19:48             ` David Miller
2012-05-21 19:48               ` David Miller
2012-05-21 18:38       ` [GIT] Sparc Sam Ravnborg
2012-05-21 18:38         ` Sam Ravnborg
2012-05-10 20:52 David Miller
2012-05-10 20:52 ` David Miller
2012-04-21 20:58 David Miller
2012-04-21 20:58 ` David Miller
2012-04-13 19:24 David Miller
2012-04-13 19:24 ` David Miller
2012-04-13 19:46 ` Linus Torvalds
2012-04-13 19:46   ` Linus Torvalds
2012-04-13 20:12   ` David Miller
2012-04-13 20:12     ` David Miller
2012-04-13 21:50   ` Sam Ravnborg
2012-04-13 21:50     ` Sam Ravnborg
2012-04-14  9:13     ` Ingo Molnar
2012-04-14  9:13       ` Ingo Molnar
2012-04-14 10:23       ` Sam Ravnborg
2012-04-14 10:23         ` Sam Ravnborg
2012-04-14 10:50         ` Ingo Molnar
2012-04-14 10:50           ` Ingo Molnar
2012-04-04  8:03 David Miller
2012-04-04  8:03 ` David Miller
2012-03-31  1:37 David Miller
2012-03-31  1:37 ` David Miller
2012-03-30  7:39 David Miller
2012-03-30  7:39 ` David Miller
2012-03-30 10:02 ` Sam Ravnborg
2012-03-30 10:02   ` Sam Ravnborg
2012-01-26 21:55 David Miller
2012-01-26 21:55 ` David Miller
2012-01-09 22:22 David Miller
2012-01-09 22:22 ` David Miller
2011-12-23 22:11 David Miller
2011-12-23 22:11 ` David Miller
2011-12-16 20:22 David Miller
2011-12-16 20:22 ` David Miller
2011-11-18 19:22 David Miller
2011-11-18 19:22 ` David Miller
2011-11-08 20:07 David Miller
2011-11-08 20:07 ` David Miller
2011-10-31  8:32 David Miller
2011-10-31  8:32 ` David Miller
2011-10-20  9:48 David Miller
2011-10-20  9:48 ` David Miller
2011-09-29 19:31 David Miller
2011-09-29 19:31 ` David Miller
2011-08-30 18:13 David Miller
2011-08-30 18:13 ` David Miller
2011-08-29 16:50 David Miller
2011-08-29 16:50 ` David Miller
2011-08-24  6:34 David Miller
2011-08-24  6:34 ` David Miller
2011-08-19  4:54 David Miller
2011-08-19  4:54 ` David Miller
2011-08-15 22:47 David Miller
2011-08-15 22:47 ` David Miller
2011-08-12  1:08 David Miller
2011-08-12  1:08 ` David Miller
2011-08-07 22:48 David Miller
2011-08-07 22:48 ` David Miller
2011-08-05 11:25 David Miller
2011-08-05 11:25 ` David Miller
2011-07-28  8:46 David Miller
2011-07-28  8:46 ` David Miller
2011-07-28 10:08 ` Anca Emanuel
2011-07-28 10:08   ` Anca Emanuel
2011-07-16 17:48 David Miller
2011-07-16 17:48 ` David Miller
2011-06-09 23:14 David Miller
2011-06-09 23:14 ` David Miller
2011-05-23  4:52 David Miller
2011-05-23  4:52 ` David Miller
2011-05-12  4:42 David Miller
2011-05-12  4:42 ` David Miller
2011-04-01  6:33 David Miller
2011-04-01  6:33 ` David Miller
2011-03-25 21:05 David Miller
2011-03-25 21:05 ` David Miller
2011-03-21  2:51 David Miller
2011-03-21  2:51 ` David Miller
2011-03-17  3:06 David Miller
2011-03-17  3:06 ` David Miller
2011-02-17 21:34 David Miller
2011-02-17 21:34 ` David Miller
2011-01-12  0:26 David Miller
2011-01-12  0:26 ` David Miller
2011-01-06 22:48 David Miller
2011-01-06 22:48 ` David Miller
2010-12-14 20:11 David Miller
2010-12-14 20:11 ` David Miller
2010-10-29  3:46 David Miller
2010-10-29  3:46 ` David Miller
2010-09-22 18:10 David Miller
2010-09-22 18:10 ` David Miller
2010-09-22 18:32 ` Al Viro
2010-09-22 18:32   ` Al Viro
2010-09-22 18:46   ` Linus Torvalds
2010-09-22 18:46     ` Linus Torvalds
2010-09-22 18:53     ` Al Viro
2010-09-22 18:53       ` Al Viro
2010-09-22 19:04       ` Al Viro
2010-09-22 19:04         ` Al Viro
2010-09-22 19:08       ` Linus Torvalds
2010-09-22 19:08         ` Linus Torvalds
2010-09-22 19:53         ` Al Viro
2010-09-22 19:53           ` Al Viro
2010-09-22 20:43           ` Al Viro
2010-09-22 20:43             ` Al Viro
2010-09-22 21:15             ` David Miller
2010-09-22 21:15               ` David Miller
2010-09-22 23:12               ` Al Viro
2010-09-22 23:12                 ` Al Viro
2010-09-24  4:48                 ` David Miller
2010-09-24  4:48                   ` David Miller
2010-09-23  0:27               ` Al Viro
2010-09-23  0:27                 ` Al Viro
2010-09-24  4:53                 ` David Miller
2010-09-24  4:53                   ` David Miller
2010-09-23  4:59         ` Al Viro
2010-09-23  4:59           ` Al Viro
2010-09-24  5:01           ` David Miller
2010-09-24  5:01             ` David Miller
2010-09-11  4:25 David Miller
2010-09-11  4:25 ` David Miller
2010-08-24  9:02 David Miller
2010-08-24  9:02 ` David Miller
2010-08-09 10:28 David Miller
2010-08-09 10:28 ` David Miller
2010-08-05  0:21 David Miller
2010-08-05  0:21 ` David Miller
2010-07-21  4:25 [GIT] SPARC David Miller
2010-07-21  4:25 ` David Miller
2010-05-19 19:50 [GIT] Sparc David Miller
2010-05-19 19:50 ` David Miller
2010-04-13 11:43 David Miller
2010-04-13 11:43 ` David Miller
2010-04-04  8:15 David Miller
2010-04-04  8:15 ` David Miller
2010-03-29 20:11 David Miller
2010-03-29 20:11 ` David Miller
2012-04-10 14:28 ` David Miller
2013-01-12 23:56 ` David Miller
2013-09-05 20:45 ` Fw: " David Miller
2018-10-08 18:42 ` John Paul Adrian Glaubitz
2018-10-25 23:39 ` David Miller
2018-10-26  3:29 ` David Miller
2018-10-26 12:41 ` John Paul Adrian Glaubitz
2018-10-26 18:30 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100817.222818.193699062.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@au.ibm.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.