[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20180119164437.GS2228@hirez.programming.kicks-ass.net>
Date: Fri, 19 Jan 2018 17:44:37 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: yangerkun <yangerkun@...wei.com>
Cc: "miaoxie (A)" <miaoxie@...wei.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Question:Lockdep
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.
Powered by blists - more mailing lists