Re: Deadlock on the mm->mmap_sem

David Howells
2001-09-19T18:26:52Z

> if we go generic then I strongly recommend my version of the generic
> semaphores is _much_ faster (and cleaner) than this one

Not so:-) Your patch, Andrea, grabs the spinlock far more than is necessary.

> (it even allows more than 2^31 concurrent readers on 64 bit archs ;).

Easy enough to fix. Just apply this as well:

--- linux-rwsem-old/include/linux/rwsem.h Wed Sep 19 19:23:44 2001
+++ linux-rwsem/include/linux/rwsem.h Wed Sep 19 19:23:47 2001
@@ -26,7 +26,7 @@
* - if wait_list is not empty, then there are processes waiting for the semaphore
*/
struct rw_semaphore {
- int activity;
+ long activity;
spinlock_t lock;
struct list_head wait_list;
};

David