Re: check_usage_backwards() && forwards? (Was: [2.6.33-rc5] starting emacs makes lockdep warning)

From: AmÃrico Wang
Date: Tue Jan 26 2010 - 21:59:03 EST


On Wed, Jan 27, 2010 at 2:16 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> (add Âlockdep gurus)
>
> Lockdep has found the real bug, but the output doesn't look right to me
>
> On 01/26, KOSAKI Motohiro wrote:
>>
>> =========================================================
>> [ INFO: possible irq lock inversion dependency detected ]
>> 2.6.33-rc5 #77
>> ---------------------------------------------------------
>> emacs/1609 just changed the state of lock:
>> Â(&(&tty->ctrl_lock)->rlock){+.....}, at: [<ffffffff8127c648>] tty_fasync+0xe8/0x190
>> but this lock took another, HARDIRQ-unsafe lock in the past:
>> Â(&(&sighand->siglock)->rlock){-.....}
>
> "HARDIRQ-unsafe" and "this lock took another" looks wrong, afaics.
>
>>  ... key   Âat: [<ffffffff81c054a4>] __key.46539+0x0/0x8
>> Â ... acquired at:
>> Â Â[<ffffffff81089af6>] __lock_acquire+0x1056/0x15a0
>> Â Â[<ffffffff8108a0df>] lock_acquire+0x9f/0x120
>> Â Â[<ffffffff81423012>] _raw_spin_lock_irqsave+0x52/0x90
>> Â Â[<ffffffff8127c1be>] __proc_set_tty+0x3e/0x150
>> Â Â[<ffffffff8127e01d>] tty_open+0x51d/0x5e0
>
> The stack-trace shows that this lock (ctrl_lock) was taken under
> ->siglock (which is hopefully irq-safe).
>
> Typo in check_usage_backwards() ?
>
> Oleg.
>
> --- a/kernel/lockdep.c
> +++ b/kernel/lockdep.c
> @@ -2147,7 +2147,7 @@ check_usage_backwards(struct task_struct
> Â Â Â Â Â Â Â Âreturn ret;
>
> Â Â Â Âreturn print_irq_inversion_bug(curr, &root, target_entry,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â this, 1, irqclass);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â this, 0, irqclass);
> Â}
>
> Âvoid print_irqtrace_events(struct task_struct *curr)
>
>

Yes!! Almost definitely... You are so careful!
ACK, please submit it as a normal patch.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/