Messages in this thread | | | Date | Fri, 19 Nov 1999 12:29:03 -0800 (PST) | From | Linus Torvalds <> | Subject | Re: [Patch] shm bug introduced with pagecache in 2.3.11 |
| |
On Fri, 19 Nov 1999, Alexander Viro wrote: > On Fri, 19 Nov 1999, Linus Torvalds wrote: > > > Is anybody willing to take a stab at creating a read-write semaphore? > > Do you want readers' and writers' waitqueues share the spinlock?
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/
| |