Hello. Although the process who is sending SIGKILL to systemd-udevd is not identified yet, adding wait_for_completion_timeout() can solve this regression. Therefore, I'd like to propose this patch for 3.14-final and 3.13-stable.
Regards. ---------- >From c6562e5d774dd1f36724197dbcb8976cccfaab53 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa <[email protected]> Date: Sun, 16 Mar 2014 22:44:23 +0900 Subject: [PATCH] kthread: Do not leave kthread_create() immediately upon SIGKILL. Commit 786235ee "kthread: make kthread_create() killable" changed to leave kthread_create() as soon as receiving SIGKILL. But this change caused boot failures if systemd-udevd received SIGKILL (probably due to timeout) while loading SCSI controller drivers using finit_module() [1]. Therefore, this patch changes kthread_create() to wait for 10 more seconds after receiving SIGKILL, unless chosen by the OOM killer, in order to give the kthreadd a chance to complete the request. [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1276705 Signed-off-by: Tetsuo Handa <[email protected]> Cc: <[email protected]> [3.13+] --- kernel/kthread.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/kernel/kthread.c b/kernel/kthread.c index b5ae3ee..52ae7dc 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -292,6 +292,17 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), * new kernel thread. */ if (unlikely(wait_for_completion_killable(&done))) { + int i = 0; + + /* + * I got SIGKILL, but wait for 10 more seconds for completion + * unless chosen by the OOM killer. This delay is there as a + * workaround for boot failure caused by SIGKILL upon device + * driver initialization timeout. + */ + while (i++ < 10 && !test_tsk_thread_flag(current, TIF_MEMDIE)) + if (wait_for_completion_timeout(&done, HZ)) + goto ready; /* * If I was SIGKILLed before kthreadd (or new kernel thread) * calls complete(), leave the cleanup of this structure to @@ -305,6 +316,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), */ wait_for_completion(&done); } +ready: task = create->result; if (!IS_ERR(task)) { static const struct sched_param param = { .sched_priority = 0 }; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

