Re: Deadlock on the mm->mmap_sem

David Howells (dhowells@redhat.com)
Wed, 19 Sep 2001 19:26:33 +0100


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