Re: [PATCH v2 00/13] rwsem fast-path write lock stealing

From: Peter Hurley
Date: Thu Mar 28 2013 - 15:19:57 EST


On Fri, 2013-03-15 at 03:54 -0700, Michel Lespinasse wrote:
> These patches extend Alex Shi's work (which added write lock stealing
> on the rwsem slow path) in order to provide rwsem write lock stealing
> on the fast path (that is, without taking the rwsem's wait_lock).

Since none of Alex's original code will be in here with these patches
applied, you might as well add this:

diff --git a/lib/rwsem.c b/lib/rwsem.c
index 4e4c889..61f91ca 100644
--- a/lib/rwsem.c
+++ b/lib/rwsem.c
@@ -4,6 +4,7 @@
* Derived from arch/i386/kernel/semaphore.c
*
* Writer lock-stealing by Alex Shi <alex.shi@xxxxxxxxx>
+ * and Michel Lespinasse <walken@xxxxxxxxxx>
*/
#include <linux/rwsem.h>
#include <linux/sched.h>


> Michel Lespinasse (13):
> rwsem: make the waiter type an enumeration rather than a bitmask
> rwsem: shorter spinlocked section in rwsem_down_failed_common()
> rwsem: move rwsem_down_failed_common code into rwsem_down_{read,write}_failed
> rwsem: simplify rwsem_down_read_failed
> rwsem: simplify rwsem_down_write_failed
> rwsem: more agressive lock stealing in rwsem_down_write_failed
> rwsem: use cmpxchg for trying to steal write lock
> rwsem: avoid taking wait_lock in rwsem_down_write_failed
> rwsem: skip initial trylock in rwsem_down_write_failed
> rwsem: simplify __rwsem_do_wake
> rwsem: implement support for write lock stealing on the fastpath
> rwsem: do not block readers at head of queue if other readers are active
> x86 rwsem: avoid taking slow path when stealing write lock
>
> arch/x86/include/asm/rwsem.h | 28 +++--
> lib/rwsem-spinlock.c | 40 +++-----
> lib/rwsem.c | 239 +++++++++++++++++++++----------------------
> 3 files changed, 154 insertions(+), 153 deletions(-)

Because Michel asked:

Reviewed-by: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/