Re: Question:Lockdep
From: Peter Zijlstra
Date: Fri Jan 19 2018 - 11:44:56 EST
On Fri, Jan 19, 2018 at 12:49:04PM +0000, yangerkun wrote:
> Hi,
> There is a problem confuses me while reading the soure code about lockdep:
> If thread get a lock first time, kernel will add a hash node in chainhash_table, then
> Copy and paste the lock chain and add the new one to tail. But, while checking deadlock,
> I have never seen the effects about the lock chain, instead, kernel will build the
> dependency graph for the checking. Does there some problems about this?
I'm not sure I fully understand your question. But the purpose of the
lock chain hash is to avoid work, its an optimization.
If we've already observed this lock chain before (hash hit), we'll not
do all the dependency checking.
Without this lockdep would be terribly slow.