* [PATCH RESEND] x86/process: directly use try_get_task_stack() return value in get_wchan
@ 2021-09-30 10:52 Jisheng Zhang
2021-09-30 11:10 ` Peter Zijlstra
0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2021-09-30 10:52 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86; +Cc: linux-kernel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] x86/process: directly use try_get_task_stack() return value in get_wchan
2021-09-30 10:52 [PATCH RESEND] x86/process: directly use try_get_task_stack() return value in get_wchan Jisheng Zhang
@ 2021-09-30 11:10 ` Peter Zijlstra
0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2021-09-30 11:10 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86, linux-kernel
On Thu, Sep 30, 2021 at 06:52:29PM +0800, Jisheng Zhang wrote:
> try_get_task_stack() has already properly gets target task's stack,
> no need to call task_stack_page() again.
Please see:
https://lkml.kernel.org/r/20210929220218.691419-1-keescook@chromium.org
Whichever way around, this code doesn't live much longer.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-30 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 10:52 [PATCH RESEND] x86/process: directly use try_get_task_stack() return value in get_wchan Jisheng Zhang
2021-09-30 11:10 ` Peter Zijlstra
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.