]> git.hungrycats.org Git - linux/commitdiff
Kernel lock exclusion is actually needed in the boot sequence,
authorLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 6 Mar 2002 08:25:30 +0000 (00:25 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 6 Mar 2002 08:25:30 +0000 (00:25 -0800)
so we need to make init_idle() aware of it so that it gets the
preempt_count initialization right.

init/main.c
kernel/sched.c

index b655eba636d6b4531de1e235aa6e592f3e77a6a1..e5f17bfb5c98d273ad2e25a68d7523de0e80555f 100644 (file)
@@ -338,6 +338,7 @@ asmlinkage void __init start_kernel(void)
  * Interrupts are still disabled. Do necessary setups, then
  * enable them
  */
+       lock_kernel();
        printk(linux_banner);
        setup_arch(&command_line);
        setup_per_cpu_areas();
@@ -405,8 +406,6 @@ asmlinkage void __init start_kernel(void)
 
        init_idle(current, smp_processor_id());
 
-       lock_kernel();
-
        /* 
         *      We count on the initial thread going ok 
         *      Like idlers init is an unlocked kernel thread, which will
index bb0776d23902ed8571bf432fe2d585ea599f2843..81190071b1590e81ae4dcc598e57f856167a4016 100644 (file)
@@ -1438,7 +1438,7 @@ void __init init_idle(task_t *idle, int cpu)
        idle->prio = MAX_PRIO;
        idle->state = TASK_RUNNING;
        idle->thread_info->cpu = cpu;
-       idle->thread_info->preempt_count = 0;
+       idle->thread_info->preempt_count = (idle->lock_depth >= 0);
        double_rq_unlock(idle_rq, rq);
        set_tsk_need_resched(idle);
        __restore_flags(flags);