The patch titled softlockup: fix task state setting has been added to the -mm tree. Its filename is kthread-synchronization-issues.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: softlockup: fix task state setting From: Dmitry Adamushko <dmitry.adamushko@xxxxxxxxx> 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: Dmitry Adamushko <dmitry.adamushko@xxxxxxxxx> Signed-off-by: Ingo Molnar <mingo@xxxxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx> Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Cc: Andy Whitcroft <apw@xxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/softlockup.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff -puN kernel/softlockup.c~kthread-synchronization-issues kernel/softlockup.c --- a/kernel/softlockup.c~kthread-synchronization-issues +++ a/kernel/softlockup.c @@ -216,26 +216,25 @@ static int watchdog(void *__bind_cpu) /* initialize timestamp */ touch_softlockup_watchdog(); + set_current_state(TASK_INTERRUPTIBLE); /* * Run briefly once per second to reset the softlockup timestamp. * If this gets delayed for more than 60 seconds then the * debug-printout triggers in softlockup_tick(). */ while (!kthread_should_stop()) { - set_current_state(TASK_INTERRUPTIBLE); touch_softlockup_watchdog(); schedule(); if (kthread_should_stop()) break; - if (this_cpu != check_cpu) - continue; - - if (sysctl_hung_task_timeout_secs) + if (this_cpu == check_cpu && sysctl_hung_task_timeout_secs) check_hung_uninterruptible_tasks(this_cpu); + set_current_state(TASK_INTERRUPTIBLE); } + __set_current_state(TASK_RUNNING); return 0; } _ Patches currently in -mm which might be from dmitry.adamushko@xxxxxxxxx are kthread-synchronization-issues.patch kthread-add-a-missing-memory-barrier-to-kthread_stop.patch kthread-call-wake_up_process-without-the-lock-being-held.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html