From: Chen Jun <chenjun102@huawei.com>
To: <linux-kernel@vger.kernel.org>, <mingo@redhat.com>,
<peterz@infradead.org>, <will@kernel.org>
Cc: <xuqiang36@huawei.com>
Subject: [PATCH 1/1] lockdep: pass curr_inner to print_lock_invalid_wait_context
Date: Thu, 16 Jun 2022 13:40:42 +0000 [thread overview]
Message-ID: <20220616134042.130002-1-chenjun102@huawei.com> (raw)
Same information (task_wait_context(curr)) is printed twice.
curr_inner in check_wait_context is what we need.
Signed-off-by: Chen Jun <chenjun102@huawei.com>
---
kernel/locking/lockdep.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 81e87280513e..2eb9802df7b9 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4676,10 +4676,8 @@ static inline short task_wait_context(struct task_struct *curr)
static int
print_lock_invalid_wait_context(struct task_struct *curr,
- struct held_lock *hlock)
+ struct held_lock *hlock, short curr_inner)
{
- short curr_inner;
-
if (!debug_locks_off())
return 0;
if (debug_locks_silent)
@@ -4695,9 +4693,7 @@ print_lock_invalid_wait_context(struct task_struct *curr,
print_lock(hlock);
pr_warn("other info that might help us debug this:\n");
-
- curr_inner = task_wait_context(curr);
- pr_warn("context-{%d:%d}\n", curr_inner, curr_inner);
+ pr_warn("context-{%d:%d}\n", curr_inner, task_wait_context(curr));
lockdep_print_held_locks(curr);
@@ -4763,7 +4759,7 @@ static int check_wait_context(struct task_struct *curr, struct held_lock *next)
}
if (next_outer > curr_inner)
- return print_lock_invalid_wait_context(curr, next);
+ return print_lock_invalid_wait_context(curr, next, curr_inner);
return 0;
}
--
2.17.1
next reply other threads:[~2022-06-16 13:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-16 13:40 Chen Jun [this message]
2022-06-17 13:22 ` Peter Zijlstra
2022-06-20 8:46 ` chenjun (AM)
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=20220616134042.130002-1-chenjun102@huawei.com \
--to=chenjun102@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
--cc=xuqiang36@huawei.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
Powered by JetHome