Re: [PATCH] Replace completions with semaphores

From: Bart Van Assche
Date: Tue Apr 15 2008 - 09:15:45 EST


On Tue, Apr 15, 2008 at 10:44 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> Also things like lockdep are a real help to a lot of developers - loads
> of locking bugs never make it into the kernel because of it.

I agree that lockdep is a real help for kernel developers. But please
keep in mind that locking order checking has its limitations. While
locking order checking can detect certain very important classes of
deadlocks, it can't detect all classes of possible deadlocks. Consider
e.g. the example mentioned by Roland Dreier, where semaphores are used
to count the number of elements in a queue. Deadlocks triggered by
waiting for a certain semaphore value can't be detected by
lockdep-style algorithms. And renaming semaphores into something else
won't help.

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