This kernel patch is based on Linux kernel 3.8.

We add :

- prwlock implementation (kernel/srwlock.c)
- parallel wakeup (kernel/fast_wake.c)

We replace the mmap_sem in mm_struct (include/linux/mm_typh.h) with prwlock.
We add some general functions (include/linux/mm_lock.h), so you can conveniently replace our lock with standard rwsemaphore.

Quick Start:

1. Please download the clean kernel with version 3.8 from https://www.kernel.org/

2. tar xf linux-3.8.tar.bz2 (suppose you download the kernel with bzip2 compression format)

3. cd linux-3.8

4. patch -p1 < [the patch path]

Now you can have the kernel with prwlock.

Notes

- The parallel wakeup may use monitor & mwait instruction. If it is not supported on your computer, please replace it with "local_irq_enable()" in kernel/fast_wake.c.

- Please disable the preemption in config. We are not sure whether it causes bugs in current version.

- Our kernel is designed for read-mostly synchronization. It may not perform well when there are too much writer acquisitions.

Thanks

