From: Valdis.Kletnieks@vt.edu (Valdis.Kletnieks at vt.edu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How is run queue length computed in linux proc filesystem
Date: Fri, 16 Aug 2013 15:02:31 -0400 [thread overview]
Message-ID: <18255.1376679751@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Fri, 16 Aug 2013 12:57:23 -0400." <520E59F3.9070206@surriel.com>
On Fri, 16 Aug 2013 12:57:23 -0400, Rik van Riel said:
> On 08/16/2013 09:20 AM, emani murali wrote:
> > Hi,
> >
> > I'm trying to obtain number of runnable processes from linux kernel. sar
> > -q gives this information readily. However I'm trying to get this value
> > from /proc filesystem. There is no file in /proc that gives this value
> > directly, then how is runq-sz computed.
>
> Tools like top, vmstat, and sar, simply look at all the processes
> in /proc, and count the number that are in runnable (R) state.
Which is why I asked what Emani is trying to do - scanning /proc is
inherently racy, and the runq-sz value can change and/or be different than
counting the number of runnable processes. A slight bit of jitter in the
output of top probably doesn't matter. Feeding the number back into a
scheduler loop or something like that may matter a lot...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130816/c8ce978b/attachment.bin
prev parent reply other threads:[~2013-08-16 19:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 13:20 How is run queue length computed in linux proc filesystem emani murali
2013-08-16 13:46 ` Valdis.Kletnieks at vt.edu
2013-08-16 13:51 ` emani murali
2013-08-16 14:11 ` Valdis.Kletnieks at vt.edu
2013-08-16 16:57 ` Rik van Riel
2013-08-16 19:02 ` Valdis.Kletnieks at vt.edu [this message]
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=18255.1376679751@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).