Linux-kernel mailing list archive 2000-26,: Re: [question] Linux read/write spinlocks and readers starving a

# Re: [question] Linux read/write spinlocks and readers starving a

Ben LaHaise (bcrl@redhat.com)
Mon, 26 Jun 2000 12:45:30 -0400 (EDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: H. Peter Anvin: "Re: APIC error interrupt"
- Previous message: Hans-Peter Jansen: "Strange IDE-CDROM prob. with 2.2.14 (IDE driver Revision: 6.30)"

On Mon, 26 Jun 2000, Tigran Aivazian wrote:

> I know that Linux read-write semaphores implementation is quite clever
> with respect to putting the new readers to queue behind the waiting
> writer. Now, is something similar true for read-write spinlocks also?

Not at present. Right now what happens for the contended lock case is
that the writer will release its bias of the lock and wait for the lock to
be released by all readers before attempting to reaquire the lock. Is
this the right thing to do? I'm not certain.

Of course, this could be changed as follows: the writer could check if
it's the first writer in line and then keep its write bias on the lock
until the readers go away (like the semaphore variant does). I'll code up
such a patch for evaluation.

-ben

-
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/

- Next message: H. Peter Anvin: "Re: APIC error interrupt"
- Previous message: Hans-Peter Jansen: "Strange IDE-CDROM prob. with 2.2.14 (IDE driver Revision: 6.30)"