Editing Processes in D state

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
If there are a lot of processes in D state in your system, then something is wrong with it.
 
If there are a lot of processes in D state in your system, then something is wrong with it.
 
+
What is "D state" and process state in generally? A process in Linux can be in several states: runing state,  
What is '''D state''' and a process state in general? A process in Linux can be in several states: running,  
+
sleeping state and others. Running process runs on a CPU just now, Sleeping process waits for its turn on CPU
sleeping, etc. Running process runs on a CPU just now, sleeping process waits for its turn on CPU
+
or for some other event. Using ps command you can obtain information about state of each process in the system: STAT column shows that:
or for some other event. Using <tt>ps</tt> command you can obtain information about state of each process in the system: STAT column shows that:
 
 
<pre>
 
<pre>
# ps a
+
[root@dhcp0-56 ovz-utils]# ps a
 
   PID TTY      STAT  TIME COMMAND
 
   PID TTY      STAT  TIME COMMAND
 
  4975 tty1    Ss+    0:00 /sbin/mingetty tty1
 
  4975 tty1    Ss+    0:00 /sbin/mingetty tty1
Line 14: Line 13:
 
</pre>
 
</pre>
  
First big '''S''' stands for Sleeping, '''R''' stands for running ("+" means that the process is foreground and small "s" means that the process is session leader, but it is not relevant for this article).
+
First big '''S''' stands for Sleeping, '''R''' stands for runing
 
+
("+" means that the process is foreground and small "s" means that the process is session leader, but it isn't relevant in our discussion).
'''D''' state occurs then the process is in uninterruptible sleep. This state is bad, because you can't do anything with the process in D state. Fortunately, process normally remains in such state not for so long. But if you have a heap of D state processes then some logic in system is disrupt. If that is happening, the very important thing is to determine where this unlucky sleep occurs. It is easy to do with ps command with ''l'' option. WCHAN column shows the name of the kernel function where the process is sleeping:
+
D state occurs then the process is in uninterruptable disk sleep. This state is bad, because you can't do anything with the process in D state.
 +
Fortunately, process normally remains in such state not for long.
 +
If you have a heap of D state processes than some logic in system is disrupt. The very important thing then is to determine,
 +
where this unlucky sleep occurs. It is easy to do with ps command with ''l'' option. WCHAN column shows the name of the kernel function where
 +
the process is sleeping:
  
 
<pre>
 
<pre>
# ps axl | awk '$10 ~ /D/'
+
[root@dhcp0-56 ~]# ps axl | grep D
 
F  UID  PID  PPID PRI  NI    VSZ  RSS WCHAN  STAT TTY        TIME COMMAND
 
F  UID  PID  PPID PRI  NI    VSZ  RSS WCHAN  STAT TTY        TIME COMMAND
 
vass    13478  7.2  0.0  1732  624 pts/1    D+  17:36  0:00 find ./
 
vass    13478  7.2  0.0  1732  624 pts/1    D+  17:36  0:00 find ./
 
</pre>
 
</pre>
  
{{Note|In case you have problem with the D state processes, always attach this information to the report you send to developers.}}
+
Then you have problem with D state processes always attach this information to the report, that you send to developers.
  
==See also==
 
[http://wiki.preshweb.co.uk/doku.php?id=linux:psflags] describes the various states.
 
 
[[Category: Troubleshooting]]
 
[[Category: Troubleshooting]]
 
Process waiting for its turn on CPU is in R state.
 

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: