Search code examples
linuxprocstat

Regarding the process status on output of /proc/stat command


When I check the process status output of my process thru /proc//stat then got to know mostly it is in "D" state which means Unterrptible sleep. I understand it is doing some operation which cannot be interrupted but could someone help me on listing what all are the operations includes in this IO/Uninterruptible sleep ?

Any link also would be fine to understand.

D Uninterruptible sleep (usually IO) R Running or runnable (on run queue) S Interruptible sleep (waiting for an event to complete) T Stopped, either by a job control signal or because it is being traced. W paging (not valid since the 2.6.xx kernel) X dead (should never be seen) Z Defunct ("zombie") process, terminated but not reaped by its parent.

Thanks..


Solution

  • It's proably disk I/O some (slow) calls can return EINTR eg) read waiting for keyboard input from tty. Fast system calls won't get interrupted by signals.

    https://unix.stackexchange.com/questions/62693/why-uninterruptible-sleep-is-not-counted-as-idle

    More info about uninterruptible sleep at Wiki Sleep This page shows how you can induce this state using vfork(2) disown, zombie children, and the uninterruptible sleep Some support info from Novell Processes in an Uninterruptible Sleep (D) State