Re: PATCH: kernel-2.4 brlock livelock

From: Ingo Molnar
Date: Thu Sep 04 2003 - 04:00:47 EST



On Wed, 3 Sep 2003 linas@xxxxxxxxxxxxxx wrote:

> OK, how about the following: readers on a given cpu are held off if the
> write lock is held *and* the read-count on that cpu is zero?
>
> That way, 'recursive' readers on other CPU's can get a read-lock if
> there's already a non-zero read-lock-count on that CPU.
>
> That should work if the thread holding the lock can't get scheduled to
> another cpu. Can these things wander around?
>
> If they can wander around, then oone would have to order the cpus: wait
> for read count to drop to zero on cpu 0 then on 1 then on 2, meanwhile
> the read-lock can be gotten on the higher ordered CPUs ...
>
> If this sounds reasonable, would you care to see a revised patch?

could you try this approach on your box that shows the livelock situation?

certainly we can add code that only triggers if there's some write attempt
- the important thing is to have the right read-mostly behavior.

Ingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/