race in smp idle task startup

From: Andi Kleen (ak@suse.de)
Date: Fri May 23 2003 - 08:09:48 EST


I think it was there before, but I now noticed it:

The 2.5 SMP bootup path does now:

         idle = fork_by_hand();
         if (IS_ERR(idle))
                         panic("failed fork for CPU %d", cpu);
        wake_up_forked_process(idle);

        <----------- process on run queue ---------------->

        /*
         * We remove it from the pidhash and the runqueue
          * once we got the process:
          */
         init_idle(idle,cpu);

But sched_init has been called before and the load balance timers
are already running. If you have multiple CPUs to start another CPU
could come and balance the idle thread away. Its registers contain
random values from fork_by_hand so it would likely crash.

It probably needs a __wake_up_forked_process that does not actually
put it onto an runqueue. Or did I miss something?

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri May 23 2003 - 22:00:55 EST