FW: About runqueues in Linux
Schick, Stefan
Stefan.Schick at business-consulting.de
Thu Dec 23 06:53:58 EST 2010
-----Original Message-----
From: Schick, Stefan
Sent: Thu 12/23/2010 12:52 PM
To: Sowmya Sridharan
Subject: RE: About runqueues in Linux
-----Original Message-----
From: kernelnewbies-bounces at kernelnewbies.org on behalf of Sowmya Sridharan
Sent: Thu 12/23/2010 11:58 AM
To: kernelnewbies at kernelnewbies.org
Subject: About runqueues in Linux
Greetings List,
I have certain queries regarding the maintenance of runqueues in Linux.
In case of an SMP system, will a same process be added to multiple
runqueues?
In the sample data given below, I am seeing that the process "Appstart" is
added to the runqueue on CPU1, but it is not run on that CPU. Instead it
is added to CPU0's runqueue, and it is run on that CPU. I have not affined
the process to any CPU, and it is not multi-threaded.
CPU1 data:
Cpu: 1, HRT: 1290079896.698994, Pid: 6577, Pname: Appstart
added_to_runqueue, current process: irc(6103)
Cpu: 1, HRT: 1290079896.706994, Pid: 6103, Pname: irc
added_to_runqueue,current process: swapper(0)
CPU0 data:
Cpu: 0, HRT: 1290079896.702994, Pid: 6577, Pname: Appstart
added_to_runqueue, Current process: eventd(5370)
Cpu: 0, HRT: 1290079896.702994, Pid: 14247, Pname: Conn_agent
added_to_runqueue, Current process: Appstart(6577)
What is the default CPU on which a process runs, if cpu affinity is not
set?
Is it possible that a process added to one runqueue can be moved to
another runqueue?
Also I have seen swapper getting scheduled frequently even if there are
runnable processes. Shouldn't swapper be run, only if there are no
runnable processes?
Your insights will be appreciated.
Regards,
Sowmya
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
Hey Sowmya,
one process can only be in one runqueue at the same time.
What is the default CPU on which a process runs, if cpu affinity is not set?
The CPU with the shortest runqueue.
Is it possible that a process added to one runqueue can be moved to another runqueue?
Yes, they can be pulled over, see load_balance() in sched_fair.c
Also I have seen swapper getting scheduled frequently even if there are
runnable processes. Shouldn't swapper be run, only if there are no
runnable processes?
No, because it is possible that a Process in the expired runqueue is starving.
Regards
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20101223/7649565f/attachment.html
More information about the Kernelnewbies
mailing list