Re: [Patch] shm bug introduced with pagecache in 2.3.11

Linus Torvalds (torvalds@transmeta.com)
Sun, 21 Nov 1999 00:03:52 -0800 (PST)


On Sat, 20 Nov 1999, Jeremy Fitzhardinge wrote:
>
> On 21-Nov-99 Linus Torvalds wrote:
> > - if a writer is waiting for readers (contention_wr), then the writer
> > will have already set the high bit, and a reader will know to wake it
> > up because the rw-semaphore value will be negative when it does
> > read_up().
>
> I assume this also means that if a writer is blocked waiting for readers to
> exit, subsequent readers entering the semaphore are also blocked. If you don't
> do this, the writer can be starved forever by a continious stream of readers.

Yes. Not that I much care (in the case of the mm semaphore if you can get
it to act that way you have other problems anyway), but that's actually
what my outlined proposal would do (an din fact, the way it works it _has_
to work that way: a blocked writer has to keep the "write" bit set in
order for readers that exit the critical region to know to try to wake
anything up).

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/