mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
cpu/hotplug: Make wait for dead cpu completion based
Kill the busy spinning on the control side and just wait for the hotplugged cpu to tell that it reached the dead state. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arch@vger.kernel.org Cc: Rik van Riel <riel@redhat.com> Cc: Rafael Wysocki <rafael.j.wysocki@intel.com> Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul Turner <pjt@google.com> Link: http://lkml.kernel.org/r/20160226182341.776157858@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
8df3e07e7f
commit
e69aab1311
4 changed files with 17 additions and 10 deletions
16
kernel/cpu.c
16
kernel/cpu.c
|
@ -688,6 +688,7 @@ static int take_cpu_down(void *_param)
|
|||
|
||||
static int takedown_cpu(unsigned int cpu)
|
||||
{
|
||||
struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
|
||||
int err;
|
||||
|
||||
/*
|
||||
|
@ -733,10 +734,8 @@ static int takedown_cpu(unsigned int cpu)
|
|||
*
|
||||
* Wait for the stop thread to go away.
|
||||
*/
|
||||
while (!per_cpu(cpu_dead_idle, cpu))
|
||||
cpu_relax();
|
||||
smp_mb(); /* Read from cpu_dead_idle before __cpu_die(). */
|
||||
per_cpu(cpu_dead_idle, cpu) = false;
|
||||
wait_for_completion(&st->done);
|
||||
BUG_ON(st->state != CPUHP_AP_IDLE_DEAD);
|
||||
|
||||
/* Interrupts are moved away from the dying cpu, reenable alloc/free */
|
||||
irq_unlock_sparse();
|
||||
|
@ -756,6 +755,15 @@ static int notify_dead(unsigned int cpu)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void cpuhp_report_idle_dead(void)
|
||||
{
|
||||
struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
|
||||
|
||||
BUG_ON(st->state != CPUHP_AP_OFFLINE);
|
||||
st->state = CPUHP_AP_IDLE_DEAD;
|
||||
complete(&st->done);
|
||||
}
|
||||
|
||||
#else
|
||||
#define notify_down_prepare NULL
|
||||
#define takedown_cpu NULL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue