> > Check out the title of the thread... Somebody has a real, reproducible
> > deadlock on a rw_lock where many readers are starving out a writer, and
> > the system hangs.
> They have, as you say, "real reproducible" deadlocks because they are
> not using straight spin-locks. Sombody tried to use cute queued locks.
> This invention is the cause of the problem. The solution is to not
> try to play tricks on "Mother Nature".
> Cheers,
> Dick Johnson
Not quite.
The stock kernel hangs using regular reader/writer locks. The problem
where a series of readers can continue passing a pending writer and
prevent the writer from _ever_ acquiring the lock affects at least i386
and ia64, and probably others, for both 2.4.x AND 2.5.x.
The problem would be fixed (but run very slow) by using normal spinlocks,
EXCEPT for the problem that reader locks are acquired recursivly, which
is the same reason my writer-preference patch could deadlock.
So we have the situation where the current code can deadlock, and the
only patch submitted can also lead to deadlock under a different situation.
It was suggested that a modified lock queue would be able to avoid
the eternal starvation problem, and it was also suggested that having
readers "spin" before acquiring the lock could reduce the problem.
Kevin