sched: fix 2.6.27-rc5 couldn't boot on tulsa machine randomly
authorZhang, Yanmin <yanmin_zhang@linux.intel.com>
Tue, 9 Sep 2008 03:26:33 +0000 (11:26 +0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 11 Sep 2008 07:34:28 +0000 (09:34 +0200)
commitbaf25731e54d06eb13dc4eda78c6dc7da4ce84e8
treeaf5cbd2b004a2258ebfd332d4871249d1c32f41f
parent291c54ff764d12ecc9a916cb478a0bbb45c5990e
sched: fix 2.6.27-rc5 couldn't boot on tulsa machine randomly

On my tulsa x86-64 machine, kernel 2.6.25-rc5 couldn't boot randomly.

Basically, function __enable_runtime forgets to reset rt_rq->rt_throttled
to 0. When every cpu is up, per-cpu migration_thread is created and it runs
very fast, sometimes to mark the corresponding rt_rq->rt_throttled to 1 very
quickly. After all cpus are up, with below calling chain:

   sched_init_smp => arch_init_sched_domains => build_sched_domains => ...
=> cpu_attach_domain => rq_attach_root => set_rq_online => ...
=> _enable_runtime

_enable_runtime is called against every rt_rq again, so rt_rq->rt_time is
reset to 0, but rt_rq->rt_throttled might be still 1. Later on function
do_sched_rt_period_timer couldn't reset it, and all RT tasks couldn't be
scheduled to run on that cpu. here is RT task migration_thread which is
woken up when a task is migrated to another cpu.

Below patch fixes it against 2.6.27-rc5.

Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_rt.c