I would go for something very similar to the current semaphore
implementation - one global spinlock for all rw-semaphores, and only if
that actually becomes a real contention point do we try to be more clever
(starting with moving it to a per-semaphore thing, and only as a last
thing doing separate wait-queues with separate spinlocks).
I doubt you'll get much contention. The current semaphores get very little
contention - the test-case that triggered this discussion in the first
place is probably the worst one by far, and that test-case will have no
contention at all with the read-write version because 99% of everything is
just readers.
The holy grail is "Make it as simple as possible. And no simpler"
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/