Re: [Linux-v4.6-rc1] ext4: WARNING: CPU: 2 PID: 2692 at kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260

From: Boqun Feng
Date: Sun Mar 27 2016 - 09:33:09 EST


On Sun, Mar 27, 2016 at 05:03:44AM -0700, Linus Torvalds wrote:
> On Sun, Mar 27, 2016 at 1:57 AM, Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
> >
> > I pulled ext4.git#dev on top of Linux v4.6-rc1...
> >
> > ... and did not see the call-trace.
>
> Unless you're using overlayfs or per-file encryption, I'm not seeing
> that any of that should make any difference (but it's entirely
> possible I'm missing something).
>
> Was it entirely repeatable before? Maybe it just happened to happen
> without that update, and then happened to _not_ happen after you
> rebooted with that 'dev' branch pulled in?
>
> Anyway, I don't think that DEBUG_LOCKS_WARN_ON() in
>
> kernel/locking/lockdep.c:2017 __lock_acquire
>

The code here is in check_no_collision(), so IIUC, there was a warning
because a real chain_key collision happened.

And chain_key is a hashsum of the ->class_idx of held_lock, calculated
via iterate_chain_key(), and the ->class_idx of a held_lock may change
from run to run IIUC, depending on the time register_lock_class() is
called for the corresponding lock class.

So this might be why Sedat didn't see the call-trace again.

Of course, I may miss something subtle here, so add the author of
check_no_collision() in CCs ;-)

If I'm right, maybe we can provide more informative dmesg here rather
than calling DEBUG_LOCKS_WARN_ON() directly?

Regards,
Boqun

> would be an ext4 issue, it looks more like an internal lockdep issue.
>
> Adding in the lockdep people, who will set me right.
>
> Linus

Attachment: signature.asc
Description: PGP signature