]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Re: [PATCH] idle task preempt_count fix
authorRobert Love <rml@tech9.net>
Tue, 5 Mar 2002 07:19:34 +0000 (23:19 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Tue, 5 Mar 2002 07:19:34 +0000 (23:19 -0800)
On SMP systems, preempt_count is erroneously set to 1 for idle task's on
all CPU besides CPU0.  This patch sets preempt_count properly.

Robert Love

init/main.c
kernel/sched.c

index 524abe909c64abce130ec54ab3517ef6e7a5354a..41189a1290bc85b48d7538249e1e45ace7e33e64 100644 (file)
@@ -335,7 +335,6 @@ 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();
@@ -402,6 +401,9 @@ asmlinkage void __init start_kernel(void)
        printk("POSIX conformance testing by UNIFIX\n");
 
        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 82602df689b49612020ab7b74fc1aceeb32b2def..bb0776d23902ed8571bf432fe2d585ea599f2843 100644 (file)
@@ -1438,6 +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;
        double_rq_unlock(idle_rq, rq);
        set_tsk_need_resched(idle);
        __restore_flags(flags);