Reese Knowledgebase

How to find stack information for state D processes

View Kristian Reese's profile on LinkedIn

If you like this article, please +1 or Recommend via FB with the provided buttons above:

Article ID: 99
by: Reese K.
Posted: 22 Apr, 2013
Last updated: 13 Sep, 2013
Views: 4323

In looking to find the cause of processes in state D on a linux based system, the following can be used to review/pinpoint the source of the problem (whether its local or NFS based storage that's to blame)

On virtuozzo installations

vzps -o veid,uid,pid,ppid,vsz,rsz,state,wchan:20,cmd axfww | awk '$7~/[D]/'

vzps axww -eL -o veid,ppid,pid,tid,wchan:20,rsz,vsz,state,cmd | awk '$8~/[DR]/ {print "echo "$0"; cat /proc/"$3"/stack; echo ==============================="}'| bash

On linux variety

ps ax | grep ' D ' | awk '{print $1}' | xargs -I % sh -c '{ ps % >> /tmp/pidstack.out; cat /proc/%/stack >> /tmp/pidstack.out; echo "===============" >> /tmp/pidstack.out; }'

Some other commands to simply display a process tree of D state processes

~# ps aux | awk '$8 ~ "D" {print $0}' | wc -l
~# ps -efl | grep rpciod | grep " D "
~# ps axl | awk '$10 ~ /D/'

This article was:   Helpful | Not Helpful
Also listed in
folder UNIX -> Linux

Prev   Next
High Load Average and processes in D state     System_resources_temporarily_unavailable._(#4.3.0)

Showing: 1-2 of 2  
Anonymous | 24 Dec, 2013 11:53 AM
On new kernels you can look at /proc/<pid>/stack
ktreese | 24 Dec, 2013 12:15 PM
That is correct, as is illustrated in the sample commands within the article. Thanks for the comment!
Prev   Next
High Load Average and processes in D state     System_resources_temporarily_unavailable._(#4.3.0)