Re: [patch] increase spinlock-debug looping timeouts from 1 sec to 1 min

From: Ingo Molnar
Date: Mon Jun 19 2006 - 04:25:30 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> no. Write-locks are unfair too, and there's no guarantee that writes
> are listened to. That's why nested read_lock() is valid, while nested
> down_read() is invalid.
>
> Take a look at arch/i386/kernel/semaphore.c, __write_lock_failed()
> just adds back the RW_LOCK_BIAS and retries in a loop. There's no
> difference to an open-coded write_trylock loop - unless i'm missing
> something fundamental.

did i ever mention that i find rwlocks evil, inefficient and bug-prone,
and that we should get rid of them? :-)

(Most rwlock users can be converted to straight spinlocks just fine, but
there are a couple of places that rely on read-lock nesting. The
hardest-to-fix offenders are nested rcu_read_locks() in the netfilter
code. I gave up converting them to saner locking, PREEMPT_RCU works it
around in the -rt tree, by not being rwlock based.)

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/