OSDN Git Service

stop_machine: Kill smp_hotplug_thread->pre_unpark, introduce stop_machine_unpark()
authorOleg Nesterov <oleg@redhat.com>
Fri, 9 Oct 2015 16:00:49 +0000 (18:00 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 20 Oct 2015 08:23:55 +0000 (10:23 +0200)
commitc00166d87e730088d919814020e96ffed129d0d1
tree89194ca8d10e2c6ceddf203958e65787927d9f9b
parentd8bc853582bfd81a9c08ca6922aeb01570080ccc
stop_machine: Kill smp_hotplug_thread->pre_unpark, introduce stop_machine_unpark()

1. Change smpboot_unpark_thread() to check ->selfparking, just
   like smpboot_park_thread() does.

2. Introduce stop_machine_unpark() which sets ->enabled and calls
   kthread_unpark().

3. Change smpboot_thread_call() and cpu_stop_init() to call
   stop_machine_unpark() by hand.

This way:

    - IMO the ->selfparking logic becomes more consistent.

    - We can kill the smp_hotplug_thread->pre_unpark() method.

    - We can easily unpark the stopper thread earlier. Say, we
      can move stop_machine_unpark() from smpboot_thread_call()
      to sched_cpu_active() as Peter suggests.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: heiko.carstens@de.ibm.com
Link: http://lkml.kernel.org/r/20151009160049.GA10166@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/smpboot.h
include/linux/stop_machine.h
kernel/cpu.c
kernel/smpboot.c
kernel/stop_machine.c