Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dmitry.adamushko@gmail.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Dmitry Adamushko and committed by
Linus Torvalds
cbd9b67b a2d416dc

+1 -1
+1 -1
kernel/kthread.c
··· 144 144 145 145 spin_lock(&kthread_create_lock); 146 146 list_add_tail(&create.list, &kthread_create_list); 147 - wake_up_process(kthreadd_task); 148 147 spin_unlock(&kthread_create_lock); 149 148 149 + wake_up_process(kthreadd_task); 150 150 wait_for_completion(&create.done); 151 151 152 152 if (!IS_ERR(create.result)) {