mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Blocked processes queue
@ 2002-01-24  0:34 William Voorsluys
  0 siblings, 0 replies; only message in thread
From: William Voorsluys @ 2002-01-24  0:34 UTC (permalink / raw)
  To: Linux Kernel

I have a doubt about how to obtain the number of processes that are blocked
due to I/O operations.
As we know, a process can be on three different states: running, ready to
run, and blocked. The linux kernel classifies them as RUNNING (R), that also
comprises the process that are ready to run, SLEPPING (S), that comprises
all processes that are waiting for an interruption. My doubt is about the
processes that are on state (D). Is this equivalent to the processes that
are blocked due to I/O operations? Is I/O the only situation that can make a
process to be on state 'D'?
I've written some code to count how many processes are on this state because
I wanted to know how many were blocked. For me, that would mean that the
host is overloaded with I/O operations (disk access, message sending and
receiving), and the CPU wouldn't beeing used so much. What I want to know is
whether the amount of processes that are on 'D' state is the correct
information which tells me how many processes are waiting for a resource. If
not, how can obtain it? I'm obtaining all this information from /proc
filesystem, by reading each process directory and counting how many are on
'D' state (just like vmstat does). Is there any other way to obtain such
kind of information?
One last question... How can I simulate a code that makes a process to be on
'D' state. I've tried putting one scanf(), but while I don't type anything
the process is slepping, it should be blocked waiting for I/O.

Thank you all.

William




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-24  0:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-24  0:34 Blocked processes queue William Voorsluys

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®