mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 21:02:19 +00:00
stop_machine: Kill cpu_stop_threads->setup() and cpu_stop_unpark()
Now that we always use stop_machine_unpark() to wake the stopper threas up, we can kill ->setup() and fold cpu_stop_unpark() into stop_machine_unpark(). And we do not need stopper->lock to set stopper->enabled = true. 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/20151009160051.GA10169@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
c00166d87e
commit
f0cf16cbd0
@ -504,20 +504,11 @@ static void cpu_stop_park(unsigned int cpu)
|
|||||||
WARN_ON(!list_empty(&stopper->works));
|
WARN_ON(!list_empty(&stopper->works));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_stop_unpark(unsigned int cpu)
|
|
||||||
{
|
|
||||||
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
|
|
||||||
|
|
||||||
spin_lock_irq(&stopper->lock);
|
|
||||||
stopper->enabled = true;
|
|
||||||
spin_unlock_irq(&stopper->lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
void stop_machine_unpark(int cpu)
|
void stop_machine_unpark(int cpu)
|
||||||
{
|
{
|
||||||
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
|
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
|
||||||
|
|
||||||
cpu_stop_unpark(cpu);
|
stopper->enabled = true;
|
||||||
kthread_unpark(stopper->thread);
|
kthread_unpark(stopper->thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +518,6 @@ static struct smp_hotplug_thread cpu_stop_threads = {
|
|||||||
.thread_fn = cpu_stopper_thread,
|
.thread_fn = cpu_stopper_thread,
|
||||||
.thread_comm = "migration/%u",
|
.thread_comm = "migration/%u",
|
||||||
.create = cpu_stop_create,
|
.create = cpu_stop_create,
|
||||||
.setup = cpu_stop_unpark,
|
|
||||||
.park = cpu_stop_park,
|
.park = cpu_stop_park,
|
||||||
.selfparking = true,
|
.selfparking = true,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user