Re: [PATCH v3 (repost)] locking/lockdep: add debug_show_all_lock_holders()

From: Tetsuo Handa
Date: Wed Apr 26 2023 - 09:44:08 EST


Ingo or Peter, can we make progress on this patch?
Linus wants this patch be handled by locking people, if this patch is acceptable.

https://lkml.kernel.org/r/CAHk-=wjbu9USn=hVWQ9v9t1H+8R6qXj8REkm36==w10zM0cM6g@xxxxxxxxxxxxxx

On 2023/04/04 18:01, Hillf Danton wrote:
>> 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.
>
> Yeah more info should have been printed for udevd/5109 to help work out
> the cause of task hung [1].
>
> [1] https://lore.kernel.org/lkml/000000000000ac91f005f5eec2e5@xxxxxxxxxx/
>>
>> debug_show_all_lock_holders() skips current thread if the caller is
>> holding no lock, for reporting RCU lock taken inside that function is
>> generally useless.
>>
>> Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
>> ---
>
> Acked-by: Hillf Danton <hdanton@xxxxxxxx>
>
>> I couldn't catch Peter's question at
>> https://lkml.kernel.org/r/Y+oY3Xd43nNnkDSB@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx .
>> I consider that this patch as-is is helpful, for not all TASK_RUNNING threads
>> are actually running on some CPU, aren't they? If we show backtrace of only
>> TASK_RUNNING threads which are running on some CPU, we fail to get hints for
>> TASK_RUNNING threads which are not running on some CPU. Therefore, I consider
>> that showing backtrace of TASK_RUNNING threads which are not running on some
>> CPU is better than not showing.