public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "lk" <linux_kernel@patni.com>
To: "helen monte" <hzmonte@hotmail.com>, <linux-kernel@vger.kernel.org>
Subject: Re: How does 2.6 SMP scheduler initially assign a thread to a run queue?
Date: Wed, 8 Jun 2005 18:11:55 +0530	[thread overview]
Message-ID: <000e01c56c27$765c4510$5e91a8c0@patni.com> (raw)
In-Reply-To: BAY102-F24530D3EE13EBCA2B13336A0FA0@phx.gbl


> 
> 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.

>I know that once it goes to a particular run queue,
> the scheduler would try to run that thread on that CPU to take
> advantage of processor affinity; and then there would be the load
> balancing stuff.  But at the very beginning, what algorithm does the
> scheduler use to assign a newly created thread to a particulat CPU?

Child will always goes to the parent's run-queue (CPU) for the first time.

> Would the load balancing algorithm be used? Or gang scheduling?

Yes, load balancing algorithm is used. tasks will be pulled from
very busy processors to lesser busy processors.

> 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

regards
lk


  reply	other threads:[~2005-06-08 12:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-07 23:50 How does 2.6 SMP scheduler initially assign a thread to a run queue? helen monte
2005-06-08 12:41 ` lk [this message]
2005-06-08 19:03   ` Siddha, Suresh B
2005-06-08 19:25     ` Steven Rostedt
2005-06-09  6:32       ` How does 2.6 SMP scheduler assign runqueues to multi-cores? helen monte
2005-06-09  7:03         ` Nick Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000e01c56c27$765c4510$5e91a8c0@patni.com' \
    --to=linux_kernel@patni.com \
    --cc=hzmonte@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox