[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <62860a46-f6c0-9735-c76f-162a294720a2@I-love.SAKURA.ne.jp>
Date: Fri, 12 Aug 2022 20:50:33 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Waiman Long <longman@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Shaokun Zhang <zhangshaokun@...ilicon.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Petr Mladek <pmladek@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ben Dooks <ben.dooks@...ive.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Luis Chamberlain <mcgrof@...nel.org>,
Xiaoming Ni <nixiaoming@...wei.com>,
John Ogness <john.ogness@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: [PATCH] locking/lockdep: add debug_show_all_lock_holders()
On 2022/08/11 20:32, Tetsuo Handa wrote:
> I wish that lockdep continues tracking locks even after something went
> wrong (i.e. debug_locks remains 1), for recently I sometimes encounter
> problems that disable lockdep during boot stage.
>
> It would be noisy to report possibility of e.g. circular locking dependency
> every time due to keeping debug_locks enabled. But tracking locks even
> after something went wrong will help debug_show_all_lock_holders() to
> survive problems during boot stage.
I forgot to write. I'm not expecting lockdep to report the same problem forever.
Reporting possibility of each problem pattern (e.g. circular locking dependency)
up to once, by using cmpxchg() inside reporting functions that call printk(),
would be enough.
I'm expecting lockdep to continue working without calling printk() even after
one of problem patterns (e.g. circular locking dependency) was printk()ed, so that
debug_show_all_locks()/debug_show_all_lock_holders() can call printk() when needed.
>
> Changing debug_locks behavior is a future patch. For now, this patch alone
> will help debugging Greg's usb.git#usb-testing tree which is generating
> many "INFO: task hung in" reports.
>
On 2022/08/12 4:00, Waiman Long wrote:
>
> BTW, this function will produce much more verbose output. Typically how many line
> of debug outputs are going to be dumped to the console by calling this function?
Regarding amount of output, I can't estimate lines printed because it depends on how
many threads are holding locks. Thus, here are some examples obtained by this patch.
https://syzkaller.appspot.com/text?tag=CrashReport&x=17c78aba080000
https://syzkaller.appspot.com/text?tag=CrashReport&x=13219e6b080000
https://syzkaller.appspot.com/text?tag=CrashReport&x=166c402d080000
https://syzkaller.appspot.com/text?tag=CrashReport&x=15c6ff73080000
We can introduce flags like panic_printk variable in kernel/panic.c if amount of
output (or latency by output) turns out to be a problem.
I guess that the most significant switch would be console_verbose() in
check_hung_task() which forces synchronous output (causing latency problem
if there are many lines to output). If printk() messages are not printed to
consoles, latency by debug_show_all_lock_holders() will be negligible.
Powered by blists - more mailing lists