LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-08-2012, 03:06 AM   #1
eeluve
Member
 
Registered: Nov 2011
Location: Russia, SPb
Distribution: all of 'em
Posts: 42

Rep: Reputation: Disabled
top, state, find utility


find utility always starts in "D" state and may keep beeing in this state for as long as it wants(needs?). Could someone explain why. What I am doing is:
# find /(anything) -name ^regExpr(also might be a name*)
sometimes complemented with the "-d" option

Cpu(s): 3.0%us, 2.5%sy, 0.0%ni, 94.2%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st
random ss of the top's cpu(s) during this "hang".

Also, the "1min load average" jumps from almost insignificantly to like 5.0. What is it waiting for? Why? My CPU doesn't let it be executed, no idea. Sorry if stupid.

Last edited by eeluve; 12-08-2012 at 03:10 AM.
 
Old 12-08-2012, 08:05 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,943
Blog Entries: 54

Rep: Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731
Quote:
Originally Posted by eeluve View Post
What I am doing is:
# find /(anything) -name ^regExpr(also might be a name*)
sometimes complemented with the "-d" option
D stands for "Uninterruptible sleep" and running your find under 'strace' should show you why it doesn't work the way you think it should. That said, when looking at '/' you may almost always want "-xdev" because you most likely don't want to recurse into VFS like /proc or /sys and stay on the local system. And maybe my 'find' is old but when I want to search for files with a path-based regex I use "-regex", not "-name" though you can mix 'em NP.
 
1 members found this post helpful.
Old 12-08-2012, 06:13 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,037

Rep: Reputation: 968Reputation: 968Reputation: 968Reputation: 968Reputation: 968Reputation: 968Reputation: 968Reputation: 968
If you use find a lot you might be better off using updatedb/locate.

As to why it drops into state "D", that is because most of the time that process will be waiting on (disk) I/O. The spike in loadavg is most likely because other processes doing I/O are being forced to wait as well. Try the following to see if this is true
Code:
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
 
1 members found this post helpful.
Old 12-11-2012, 12:12 AM   #4
eeluve
Member
 
Registered: Nov 2011
Location: Russia, SPb
Distribution: all of 'em
Posts: 42

Original Poster
Rep: Reputation: Disabled
Thank you, guys. Very helpful.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 5 Useful Alternatives to the Top Utility LXer Syndicated Linux News 0 09-29-2012 12:50 AM
Top Utility in Batch Mode Brandon9000 Linux - General 2 09-07-2012 09:32 AM
top utility source code puishor Programming 2 11-23-2005 11:52 AM
top utility and performance bektas Programming 2 08-05-2003 03:33 PM
'Top' utility floating point error Ealric Linux - Software 4 07-24-2003 06:18 AM


All times are GMT -5. The time now is 09:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration