Skip to content

Commit 07f06cb

Browse files
Peter Zijlstraingomolnar
authored andcommitted
sched: Start stopper early
Ensure the stopper thread is active 'early', because the load balancer pretty much assumes that its available. And when 'online && active' the load-balancer is fully available. Not only the numa balancing stop_two_cpus() caller relies on it, but also the self migration stuff does, and at CPU_ONLINE time the cpu really is 'free' to run anything. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> 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/20151009160054.GA10176@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent f0cf16c commit 07f06cb

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎kernel/cpu.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@ static int smpboot_thread_call(struct notifier_block *nfb,
475475

476476
case CPU_DOWN_FAILED:
477477
case CPU_ONLINE:
478-
stop_machine_unpark(cpu);
479478
smpboot_unpark_threads(cpu);
480479
break;
481480

‎kernel/sched/core.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5545,21 +5545,27 @@ static void set_cpu_rq_start_time(void)
55455545
static int sched_cpu_active(struct notifier_block *nfb,
55465546
unsigned long action, void *hcpu)
55475547
{
5548+
int cpu = (long)hcpu;
5549+
55485550
switch (action & ~CPU_TASKS_FROZEN) {
55495551
case CPU_STARTING:
55505552
set_cpu_rq_start_time();
55515553
return NOTIFY_OK;
5554+
55525555
case CPU_ONLINE:
55535556
/*
55545557
* At this point a starting CPU has marked itself as online via
55555558
* set_cpu_online(). But it might not yet have marked itself
55565559
* as active, which is essential from here on.
5557-
*
5558-
* Thus, fall-through and help the starting CPU along.
55595560
*/
5561+
set_cpu_active(cpu, true);
5562+
stop_machine_unpark(cpu);
5563+
return NOTIFY_OK;
5564+
55605565
case CPU_DOWN_FAILED:
5561-
set_cpu_active((long)hcpu, true);
5566+
set_cpu_active(cpu, true);
55625567
return NOTIFY_OK;
5568+
55635569
default:
55645570
return NOTIFY_DONE;
55655571
}

0 commit comments

Comments
 (0)