From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] x86/process: directly use try_get_task_stack() return value in get_wchan
Date: Thu, 30 Sep 2021 18:52:29 +0800 [thread overview]
Message-ID: <20210930185229.09d463ab@xhacker.debian> (raw)
try_get_task_stack() has already properly gets target task's stack,
no need to call task_stack_page() again.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
arch/x86/kernel/process.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 1d9463e3096b..d4a6503b3878 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -950,12 +950,9 @@ unsigned long get_wchan(struct task_struct *p)
if (p == current || task_is_running(p))
return 0;
- if (!try_get_task_stack(p))
- return 0;
-
- start = (unsigned long)task_stack_page(p);
+ start = (unsigned long)try_get_task_stack(p);
if (!start)
- goto out;
+ return 0;
/*
* Layout of the stack page:
--
2.32.0
next reply other threads:[~2021-09-30 10:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 10:52 Jisheng Zhang [this message]
2021-09-30 11:10 ` [PATCH RESEND] x86/process: directly use try_get_task_stack() return value in get_wchan Peter Zijlstra
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=20210930185229.09d463ab@xhacker.debian \
--to=jisheng.zhang@synaptics.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.