]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARC: stack unwinding: don't assume non-current task is sleeping
authorVineet Gupta <vgupta@synopsys.com>
Sat, 7 Nov 2020 00:59:27 +0000 (16:59 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:25:38 +0000 (11:25 +0100)
commit3e25867ac4168fd56d67dd5c34c4cab8f5f3948d
treec1bf64a99e96ad3396aaa51614932f698b4349eb
parent57ac40ee09cea2ec90f71c6f49b15d0d82667b38
ARC: stack unwinding: don't assume non-current task is sleeping

[ Upstream commit e42404fa10fd11fe72d0a0e149a321d10e577715 ]

To start stack unwinding (SP, PC and BLINK) are needed. When the
explicit execution context (pt_regs etc) is not available, unwinder
assumes the task is sleeping (in __switch_to()) and fetches SP and BLINK
from kernel mode stack.

But this assumption is not true, specially in a SMP system, when top
runs on 1 core, there may be active running processes on all cores.

So when unwinding non courrent tasks, ensure they are NOT running.

And while at it, handle the self unwinding case explicitly.

This came out of investigation of a customer reported hang with
rcutorture+top

Link: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/31
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arc/kernel/stacktrace.c