Process state 'D' in linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Process state 'D' in linux

satish
Dear Erman,

I have gone through 2 of our blogs to understand the D state processes

http://ermanarslan.blogspot.com/2014/03/linux-d-state-processes-and-load-average.html
http://ermanarslan.blogspot.com.tr/2013/08/linux-d-state-processes.html

when a process issues an I/O operation , the kernel is triggered to run the relevant system call..
This code goes from filename to filesystem, from filesystem to block device and device driver, and then device driver sends the command to the hardware to fetch a block on disk.
The process, on the other hand ; is put in sleeping state (D). When the data is fetched, the process is put in runnable state again. After this point, the process will run(continue its work) when the scheduler allow it to.

could you please let us know whether processes with 'D' state will hold the CPU until its operation is completed?

Thank you
satish
Reply | Threaded
Open this post in threaded view
|

Re: Process state 'D' in linux

ErmanArslansOracleBlog
Administrator
First of all, I m a Linux admin but I m not a kernel developer or Linux guru.

But still, I will try to answer your question.


The processes waiting with an uninterruptable sleep state (D state) , are included in the calculation of Linux Load average.

So, if you have D state processes, you can expect a high load average..

as for the CPU usage, it is hard to answer.
In my opinion,

D state process will not use CPU, but the thing that caused them to be in D state may use CPU..
Consider, a process is doing I/O and relevant device driver is entered an infinite loop.. So the process will be in D state, and the device driver will use cpu in the backend..