linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: Waiman Long <longman@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Shaokun Zhang <zhangshaokun@hisilicon.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Petr Mladek <pmladek@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ben Dooks <ben.dooks@sifive.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Xiaoming Ni <nixiaoming@huawei.com>,
	John Ogness <john.ogness@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] locking/lockdep: add debug_show_all_lock_holders()
Date: Mon, 14 Nov 2022 19:05:51 +0900	[thread overview]
Message-ID: <523ea5ef-8b2f-ddc5-1e52-4bcc2aad698d@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <5f853677-874a-2a38-4253-95b2795eb7a8@redhat.com>

Peter or Ingo, can you take this patch?

On 2022/10/05 3:09, Waiman Long wrote:
> On 10/3/22 18:18, Tetsuo Handa wrote:
>> Can this patch go to linux.git ?
> 
> It is now up to Peter or Ingo to take it  to tip.
> 
> Cheers,
> Longman
> 
>>
>> 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@I-love.SAKURA.ne.jp>
>>> Acked-by: Waiman Long <longman@redhat.com>
> 


  reply	other threads:[~2022-11-14 10:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16 14:15 [PATCH (repost)] locking/lockdep: add debug_show_all_lock_holders() Tetsuo Handa
2022-09-16 14:51 ` Waiman Long
2022-09-16 15:57   ` [PATCH v2] " Tetsuo Handa
2022-09-16 18:41     ` Waiman Long
2022-10-03 22:18       ` Tetsuo Handa
2022-10-04 18:09         ` Waiman Long
2022-11-14 10:05           ` Tetsuo Handa [this message]
2022-09-16 17:46   ` [PATCH (repost)] " Boqun Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=523ea5ef-8b2f-ddc5-1e52-4bcc2aad698d@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=ben.dooks@sifive.com \
    --cc=bigeasy@linutronix.de \
    --cc=boqun.feng@gmail.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=longman@redhat.com \
    --cc=mcgrof@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nixiaoming@huawei.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=zhangshaokun@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).