Re: How does 2.6 SMP scheduler initially assign a thread to a run queue?

From: Siddha, Suresh B
Date: Wed Jun 08 2005 - 14:06:49 EST


On Wed, Jun 08, 2005 at 06:11:55PM +0530, lk wrote:
> > In the 2.6 kernel, there is one run queue per CPU, in case of an SMP.
> > After a thread is created, how does the scheduler determine which run
> > queue it goes to?
>
> First it forked process (child) gets the same CPU as that of parent.
> forking a child gets the same CPU and later part of fork will call
> wake_up_new_task () to fetch the run-queue of the CPU and
> __activate_task () is called to move task into run-queue.
> Later rescheduling of the process may move process to another
> run-queues.

In -mm kernels, Nick has recently added balance on exec/fork.

> > By the way, in an SMT/hyperthreading processor, does the latest kernel
> > version assign one run queue per physical CPU, or per virtual
> > processor?
> >
>
> one run-queue per physical CPU

No. Each logical processor has its own runqueue.

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