[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1586867796-5768-2-git-send-email-wangqing@vivo.com>
Date: Tue, 14 Apr 2020 20:36:30 +0800
From: Wang Qing <wangqing@...o.com>
To: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
James Morse <james.morse@....com>,
Mark Rutland <mark.rutland@....com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Thomas Gleixner <tglx@...utronix.de>,
jinho lim <jordan.lim@...sung.com>,
Wang Qing <wangqing@...o.com>,
Dave Martin <Dave.Martin@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [V3 1/3] ARM64:fixed dump_backtrace() when task running on another cpu
We cannot get FP and PC when the task is running on another CPU,
task->thread.cpu_context is the last time the task was switched out,
it's better to give a reminder than to provide wrong information
for example when Task blocked in spinlock/interrupt/busy loop.
Signed-off-by: Wang Qing <wangqing@...o.com>
---
arch/arm64/kernel/traps.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index cf402be..c74090b 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -106,6 +106,13 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
start_backtrace(&frame,
(unsigned long)__builtin_frame_address(0),
(unsigned long)dump_backtrace);
+ } else if (task_running(tsk)) {
+ /*
+ * The task is running in another cpu, we cannot get it.
+ */
+ pr_warn("tsk: %s is running in CPU%d, Don't call trace!\n",
+ tsk->comm, task_cpu(tsk));
+ return;
} else {
/*
* task blocked in __switch_to
--
2.7.4
Powered by blists - more mailing lists