Skip to content
  • Oleg Nesterov's avatar
    kthreads: simplify the startup synchronization · cdd140bd
    Oleg Nesterov authored
    
    
    We use two completions two create the kernel thread, this is a bit ugly.
    kthread() wakes up create_kthread() via ->started, then create_kthread()
    wakes up the caller kthread_create() via ->done.  But kthread() does not
    need to wait for kthread(), it can just return.  Instead kthread() itself
    can wake up the caller of kthread_create().
    
    Kill kthread_create_info->started, ->done is enough.  This improves the
    scalability a bit and sijmplifies the code.
    
    The only problem if kernel_thread() fails, in that case create_kthread()
    must do complete(&create->done).
    
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Pavel Emelyanov <xemul@openvz.org>
    Cc: Rusty Russell <rusty@rustcorp.com.au>
    Cc: Vitaliy Gusev <vgusev@openvz.org
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    cdd140bd