lkml.org 
[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: lockdep null-ptr-deref
On Wed, Sep 30, 2020 at 08:18:18PM +0800, Boqun Feng wrote:

> For one thing, I do think that LOCK_READ_USED trace is helpful for
> better reporting, because if there is a read lock in the dependency path
> which causes the deadlock, it's better to have the LOCK_READ_USED trace
> to know at least the initial READ usage. For example, if we have
>
> void f1(...)
> {
> write_lock(&A);
> spin_lock(&C);
> // A -> C
> ...
> }
>
> void g(...)
> {
> read_lock(&A);
> ...
> }
> void f2(...)
> {
> spin_lock(&B);
> g(...);
> // B -> A
> }
>
> void f3(...) {
> spin_lock(&C);
> spin_lock(&B);
> // C -> B, trigger lockdep splat
> }
>
> when lockdep reports the deadlock (at the time f3() is called), it will
> be useful if we have a trace like:
>
> INITIAL READ usage at:
> g+0x.../0x...
> f2+0x.../0x...
>
> Thoughts?

Wouldn't that also be in LOCK_ENABLED_*_READ ?

That is, with PROVE_LOCKING on, the initial usage is bound to set more
states, except for !check||trylock usage, and those aren't really all
that interesting.

\
 
 \ /
  Last update: 2020-09-30 21:03    [W:0.128 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site