kernel_optimize_test/arch/hexagon/kernel
Peter Zijlstra 5fbd036b55 sched: Cleanup cpu_active madness
Stepan found:

CPU0		CPUn

_cpu_up()
  __cpu_up()

		boostrap()
		  notify_cpu_starting()
		  set_cpu_online()
		  while (!cpu_active())
		    cpu_relax()

<PREEMPT-out>

smp_call_function(.wait=1)
  /* we find cpu_online() is true */
  arch_send_call_function_ipi_mask()

  /* wait-forever-more */

<PREEMPT-in>
		  local_irq_enable()

  cpu_notify(CPU_ONLINE)
    sched_cpu_active()
      set_cpu_active()

Now the purpose of cpu_active is mostly with bringing down a cpu, where
we mark it !active to avoid the load-balancer from moving tasks to it
while we tear down the cpu. This is required because we only update the
sched_domain tree after we brought the cpu-down. And this is needed so
that some tasks can still run while we bring it down, we just don't want
new tasks to appear.

On cpu-up however the sched_domain tree doesn't yet include the new cpu,
so its invisible to the load-balancer, regardless of the active state.
So instead of setting the active state after we boot the new cpu (and
consequently having to wait for it before enabling interrupts) set the
cpu active before we set it online and avoid the whole mess.

Reported-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1323965362.18942.71.camel@twins
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2012-03-12 20:43:15 +01:00
..
asm-offsets.c Hexagon: Add configuration and makefiles for the Hexagon architecture. 2011-11-01 07:34:21 -07:00
dma.c Hexagon: Provide DMA implementation 2011-11-01 07:34:20 -07:00
head.S Hexagon: Add startup code 2011-11-01 07:34:19 -07:00
hexagon_ksyms.c Hexagon: Export ksyms defined in assembly files. 2011-11-01 07:34:19 -07:00
init_task.c Hexagon: Add init_task and process functions 2011-11-01 07:34:19 -07:00
irq_cpu.c Hexagon: Add interrupts 2011-11-01 07:34:19 -07:00
kgdb.c Hexagon: kgdb support files 2011-11-01 07:34:21 -07:00
Makefile Hexagon: Add configuration and makefiles for the Hexagon architecture. 2011-11-01 07:34:21 -07:00
module.c Hexagon: Support dynamic module loading. 2011-11-01 07:34:19 -07:00
process.c Hexagon: Add init_task and process functions 2011-11-01 07:34:19 -07:00
ptrace.c Hexagon: Add ptrace support 2011-11-01 07:34:19 -07:00
reset.c Hexagon: Add startup code 2011-11-01 07:34:19 -07:00
setup.c Hexagon: Add startup code 2011-11-01 07:34:19 -07:00
signal.c Hexagon: Add signal functions 2011-11-01 07:34:19 -07:00
smp.c sched: Cleanup cpu_active madness 2012-03-12 20:43:15 +01:00
stacktrace.c Hexagon: Add basic stacktrace functionality for Hexagon architecture. 2011-11-01 07:34:21 -07:00
syscall.c
syscalltab.c
time.c Hexagon: Add time and timer functions 2011-11-01 07:34:19 -07:00
topology.c Hexagon: Add SMP support 2011-11-01 07:34:20 -07:00
trampoline.S Hexagon: Add signal functions 2011-11-01 07:34:19 -07:00
traps.c Hexagon: Provide basic debugging and system trap support. 2011-11-01 07:34:19 -07:00
vdso.c Hexagon: Add signal functions 2011-11-01 07:34:19 -07:00
vm_entry.S
vm_events.c
vm_init_segtable.S
vm_ops.S
vm_switch.S
vm_vectors.S
vmlinux.lds.S Hexagon: Add configuration and makefiles for the Hexagon architecture. 2011-11-01 07:34:21 -07:00