From: Dmitry Adamushko Date: Tue, 29 Apr 2008 07:59:23 +0000 (-0700) Subject: kthread: call wake_up_process() without the lock being held X-Git-Tag: v2.6.26-rc1~630 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbd9b67bd3883dff0ef4b8ec9229d315a9ba38f0;p=linux-2.6 kthread: call wake_up_process() without the lock being held From the POV of synchronization, there should be no need to call wake_up_process() with the 'kthread_create_lock' being held. Signed-off-by: Dmitry Adamushko Cc: Nick Piggin Cc: Ingo Molnar Cc: Rusty Russell Cc: "Paul E. McKenney" Cc: Peter Zijlstra Cc: Andy Whitcroft Cc: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/kthread.c b/kernel/kthread.c index 92cf6930ab..ac72eea483 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -144,9 +144,9 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), spin_lock(&kthread_create_lock); list_add_tail(&create.list, &kthread_create_list); - wake_up_process(kthreadd_task); spin_unlock(&kthread_create_lock); + wake_up_process(kthreadd_task); wait_for_completion(&create.done); if (!IS_ERR(create.result)) {