linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	linux-kernel@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH 2/4] locking/lockdep: Remove the unnecessary trace saving
Date: Sat, 19 Jun 2021 01:01:08 +0800	[thread overview]
Message-ID: <20210618170110.3699115-3-boqun.feng@gmail.com> (raw)
In-Reply-To: <20210618170110.3699115-1-boqun.feng@gmail.com>

In print_bad_irq_dependency(), save_trace() is called to set the ->trace
for @prev_root as the current call trace, however @prev_root corresponds
to the the held lock, which may not be acquired in current call trace,
therefore it's wrong to use save_trace() to set ->trace of @prev_root.
Moreover, with our adjustment of printing backwards dependency path, the
->trace of @prev_root is unncessary, so remove it.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
---
 kernel/locking/lockdep.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 3b32cd9cdfd0..74d084a398be 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2550,9 +2550,6 @@ print_bad_irq_dependency(struct task_struct *curr,
 	lockdep_print_held_locks(curr);
 
 	pr_warn("\nthe dependencies between %s-irq-safe lock and the holding lock:\n", irqclass);
-	prev_root->trace = save_trace();
-	if (!prev_root->trace)
-		return;
 	print_shortest_lock_dependencies_backwards(backwards_entry, prev_root);
 
 	pr_warn("\nthe dependencies between the lock to be acquired");
-- 
2.30.2


  parent reply	other threads:[~2021-06-18 17:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 17:01 [PATCH 0/4] Fix issues in check_irq_usage() Boqun Feng
2021-06-18 17:01 ` [PATCH 1/4] locking/lockdep: Fix the dep path printing for backwards BFS Boqun Feng
2021-06-23  8:19   ` [tip: locking/core] " tip-bot2 for Boqun Feng
2021-06-18 17:01 ` Boqun Feng [this message]
2021-06-23  8:19   ` [tip: locking/core] locking/lockdep: Remove the unnecessary trace saving tip-bot2 for Boqun Feng
2021-06-18 17:01 ` [PATCH 3/4] lockding/lockdep: Avoid to find wrong lock dep path in check_irq_usage() Boqun Feng
2021-06-23  8:19   ` [tip: locking/core] " tip-bot2 for Boqun Feng
2021-06-18 17:01 ` [PATCH 4/4] locking/selftests: Add a selftest for check_irq_usage() Boqun Feng
2021-06-23  8:19   ` [tip: locking/core] " tip-bot2 for Boqun Feng
2021-06-18 17:36 ` [PATCH 0/4] Fix issues in check_irq_usage() Johannes Berg
2021-06-21  7:28   ` 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=20210618170110.3699115-3-boqun.feng@gmail.com \
    --to=boqun.feng@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /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).