Commit 7be2a03e authored by Dmitry Adamushko's avatar Dmitry Adamushko Committed by Ingo Molnar

softlockup: fix task state setting

kthread_stop() can be called when a 'watchdog' thread is executing after
kthread_should_stop() but before set_task_state(TASK_INTERRUPTIBLE).
Signed-off-by: default avatarDmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2232c2d8
...@@ -216,26 +216,27 @@ static int watchdog(void *__bind_cpu) ...@@ -216,26 +216,27 @@ static int watchdog(void *__bind_cpu)
/* initialize timestamp */ /* initialize timestamp */
touch_softlockup_watchdog(); touch_softlockup_watchdog();
set_current_state(TASK_INTERRUPTIBLE);
/* /*
* Run briefly once per second to reset the softlockup timestamp. * Run briefly once per second to reset the softlockup timestamp.
* If this gets delayed for more than 60 seconds then the * If this gets delayed for more than 60 seconds then the
* debug-printout triggers in softlockup_tick(). * debug-printout triggers in softlockup_tick().
*/ */
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
set_current_state(TASK_INTERRUPTIBLE);
touch_softlockup_watchdog(); touch_softlockup_watchdog();
schedule(); schedule();
if (kthread_should_stop()) if (kthread_should_stop())
break; break;
if (this_cpu != check_cpu) if (this_cpu == check_cpu) {
continue;
if (sysctl_hung_task_timeout_secs) if (sysctl_hung_task_timeout_secs)
check_hung_uninterruptible_tasks(this_cpu); check_hung_uninterruptible_tasks(this_cpu);
}
set_current_state(TASK_INTERRUPTIBLE);
} }
__set_current_state(TASK_RUNNING);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment