[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f71cfbf-7bee-6a06-dca1-ac94bf542cd7@I-love.SAKURA.ne.jp>
Date: Tue, 4 Oct 2022 07:18:23 +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>
Subject: Re: [PATCH v2] locking/lockdep: add debug_show_all_lock_holders()
Can this patch go to linux.git ?
On 2022/09/17 3:41, Waiman Long wrote:
> On 9/16/22 11:57, Tetsuo Handa wrote:
>> Currently, check_hung_uninterruptible_tasks() reports details of locks
>> held in the system. Also, lockdep_print_held_locks() does not report
>> details of locks held by a thread if that thread is in TASK_RUNNING state.
>> Several years of experience of debugging without vmcore tells me that
>> these limitations have been a barrier for understanding what went wrong
>> in syzbot's "INFO: task hung in" reports.
>>
>> I initially thought that the cause of "INFO: task hung in" reports is
>> due to over-stressing. But I understood that over-stressing is unlikely.
>> I now consider that there likely is a deadlock/livelock bug where lockdep
>> cannot report as a deadlock when "INFO: task hung in" is reported.
>>
>> A typical case is that thread-1 is waiting for something to happen (e.g.
>> wait_event_*()) with a lock held. When thread-2 tries to hold that lock
>> using e.g. mutex_lock(), check_hung_uninterruptible_tasks() reports that
>> thread-2 is hung and thread-1 is holding a lock which thread-2 is trying
>> to hold. But currently check_hung_uninterruptible_tasks() cannot report
>> the exact location of thread-1 which gives us an important hint for
>> understanding why thread-1 is holding that lock for so long period.
>>
>> When check_hung_uninterruptible_tasks() reports a thread waiting for a
>> lock, it is important to report backtrace of threads which already held
>> that lock. Therefore, allow check_hung_uninterruptible_tasks() to report
>> the exact location of threads which is holding any lock.
>>
>> To deduplicate code, share debug_show_all_{locks,lock_holders}() using
>> a flag. As a side effect of sharing, __debug_show_all_locks() skips
>> current thread if the caller is holding no lock, for reporting RCU lock
>> taken inside __debug_show_all_locks() is generally useless.
>>
>> Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
> Acked-by: Waiman Long <longman@...hat.com>
Powered by blists - more mailing lists