Skip to content
  • Oleg Nesterov's avatar
    kthreads: simplify migration_thread() exit path · 371cbb38
    Oleg Nesterov authored
    
    
    Now that kthread_stop() can be used even if the task has already exited,
    we can kill the "wait_to_die:" loop in migration_thread().  But we must
    pin rq->migration_thread after creation.
    
    Actually, I don't think CPU_UP_CANCELED or CPU_DEAD should wait for
    ->migration_thread exit.  Perhaps we can simplify this code a bit more.
    migration_call() can set ->should_stop and forget about this thread.  But
    we need a new helper in kthred.c for that.
    
    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>
    371cbb38