kernel-ark/arch/s390
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
..
appldata sched/accounting: Change cpustat fields to an array 2011-12-06 09:06:38 +01:00
boot [S390] Remove Kerntypes leftovers 2011-12-27 11:27:12 +01:00
crypto [S390] crypto: avoid MSA3 and MSA4 instructions in ESA mode 2011-11-14 11:19:09 +01:00
hypfs vfs: switch ->show_options() to struct dentry * 2012-01-06 23:19:54 -05:00
include/asm compat: fix compile breakage on s390 2012-02-27 07:54:27 -08:00
kernel sched: Cleanup cpu_active madness 2012-03-12 20:43:15 +01:00
kvm KVM: s390: announce SYNC_MMU 2011-11-17 16:25:52 +02:00
lib [S390] sparse: fix sparse warnings with __user pointers 2011-10-30 15:16:46 +01:00
math-emu
mm compat: fix compile breakage on s390 2012-02-27 07:54:27 -08:00
oprofile Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-01-06 08:02:58 -08:00
defconfig [S390] defconfig: switch on CONFIG_DEVTMPFS 2011-10-30 15:16:42 +01:00
Kbuild [S390] make arch/s390 subdirectories depend on config option 2011-12-27 11:27:12 +01:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-01-09 08:11:13 -08:00
Kconfig.debug
Makefile [S390] cleanup entry point definition 2012-01-18 18:03:41 +01:00