]> git.neil.brown.name Git - history.git/commitdiff
Well, duh!
authorLinus Torvalds <torvalds@home.transmeta.com>
Wed, 6 Mar 2002 14:41:35 +0000 (06:41 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Wed, 6 Mar 2002 14:41:35 +0000 (06:41 -0800)
Initialize preempt count outside the spinlocks that can
themselves impact it on SMP.

kernel/sched.c

index 81190071b1590e81ae4dcc598e57f856167a4016..45e3b61033605356bc09cb5984c9a1f78170dec5 100644 (file)
@@ -1438,10 +1438,12 @@ 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 = (idle->lock_depth >= 0);
        double_rq_unlock(idle_rq, rq);
        set_tsk_need_resched(idle);
        __restore_flags(flags);
+
+       /* Set the preempt count _outside_ the spinlocks! */
+       idle->thread_info->preempt_count = (idle->lock_depth >= 0);
 }
 
 extern void init_timervecs(void);