aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/main.c7
-rw-r--r--kernel/sched.c9
2 files changed, 15 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c
index d324801729ba..b5e421e39ede 100644
--- a/init/main.c
+++ b/init/main.c
@@ -383,6 +383,13 @@ static void noinline rest_init(void)
383 numa_default_policy(); 383 numa_default_policy();
384 unlock_kernel(); 384 unlock_kernel();
385 preempt_enable_no_resched(); 385 preempt_enable_no_resched();
386
387 /*
388 * The boot idle thread must execute schedule()
389 * at least one to get things moving:
390 */
391 schedule();
392
386 cpu_idle(); 393 cpu_idle();
387} 394}
388 395
diff --git a/kernel/sched.c b/kernel/sched.c
index e2b0d3e4dd06..5f2182d42241 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4166,6 +4166,14 @@ void show_state(void)
4166 read_unlock(&tasklist_lock); 4166 read_unlock(&tasklist_lock);
4167} 4167}
4168 4168
4169/**
4170 * init_idle - set up an idle thread for a given CPU
4171 * @idle: task in question
4172 * @cpu: cpu the idle task belongs to
4173 *
4174 * NOTE: this function does not set the idle thread's NEED_RESCHED
4175 * flag, to make booting more robust.
4176 */
4169void __devinit init_idle(task_t *idle, int cpu) 4177void __devinit init_idle(task_t *idle, int cpu)
4170{ 4178{
4171 runqueue_t *rq = cpu_rq(cpu); 4179 runqueue_t *rq = cpu_rq(cpu);
@@ -4183,7 +4191,6 @@ void __devinit init_idle(task_t *idle, int cpu)
4183#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) 4191#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
4184 idle->oncpu = 1; 4192 idle->oncpu = 1;
4185#endif 4193#endif
4186 set_tsk_need_resched(idle);
4187 spin_unlock_irqrestore(&rq->lock, flags); 4194 spin_unlock_irqrestore(&rq->lock, flags);
4188 4195
4189 /* Set the preempt count _outside_ the spinlocks! */ 4196 /* Set the preempt count _outside_ the spinlocks! */