[RFC] Hanging when parking smp threads

From: Justin Chen <hidden>
Date: 2017-09-06 21:37:25

Hello,

I've been trying to trace down a hang issue for ages now, can't seem
to get to the root of the problem. I'm wondering if anyone else has
seen anything similar or has any suggestions.

I am testing on a bmips chip on kernel version 4.1.20. I don't see the
problem on ARM, so I have a suspicion there might be an issue with the
smp mips specific code, but I cannot put my finger on it.

The hang occurs when stress testing suspend and resume. Everyone once
in a while it hangs when going into suspend and I see the following.

1. CPU 0 brings down other CPUs for suspend and attempts to parks smp
threads. It waits for each thread to be parked before moving on.
kernel/power/suspend.c: disable_nonboot_cpus()
kernel/cpu.c: _cpu_down() then smpboot_park_threads()

2. CPU X(nonboot cpu) parks all smpboot threads except the last one.
Then it hangs here.
Under further inspection I see the following...
The thread that needs to be parked is never scheduled instead it is
waiting in the wake_list within the cpu runqueue(The cpu that should
be parking the thread).
The CPU (with its wait_list populated) is staying in the idle task
loop. It never schedules the next task in the wait_list.

I've tried pulling in potential fixes from upstream, but everything i
tried so far has failed to fix the hang.

I am running out of ideas on how to debug this. So any pointers on how
to get deeper into the issue would be much appreciated. Thanks!

Justin
.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help