From: Peter Zijlstra <peterz@infradead.org>
To: yangerkun <yangerkun@huawei.com>
Cc: "miaoxie (A)" <miaoxie@huawei.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Question:Lockdep
Date: Fri, 19 Jan 2018 17:44:37 +0100 [thread overview]
Message-ID: <20180119164437.GS2228@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <663A5575A842324DA6D21D04D5A49941F0B318@dggemm501-mbs.china.huawei.com>
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.
parent reply other threads:[~2018-01-19 16:44 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <663A5575A842324DA6D21D04D5A49941F0B318@dggemm501-mbs.china.huawei.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180119164437.GS2228@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=yangerkun@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox