140a3 what do all the states in top mean? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old June 19th, 2009, 18:27
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default what do all the states in top mean?

i'm curious if anyone knows where i can find a list of the "states" shown in top, i tried to search and dind't see much.

I see a LOT of processes in the "kqread" state not chaning much, and i was wondering what it meant....some of it i can figure out, like i assume zio means zfs io or something

i'm GUESSING kqread is something to do with the kernel and read but i really have no clue...
Reply With Quote
  #2  
Old June 19th, 2009, 22:39
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,845
Thanks: 30
Thanked 1,888 Times in 1,333 Posts
Default

That would be kqueue(2).
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #3  
Old June 20th, 2009, 13:22
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,523
Thanks: 422
Thanked 607 Times in 475 Posts
Default

When I watched video about Benchmarking FreeBSD (from FreeBSD site), guy told, that if all states in top aren't documented, and if someone really want's to figure it out, he have to din in source of top
Reply With Quote
  #4  
Old June 20th, 2009, 14:11
vivek's Avatar
vivek vivek is offline
Member
 
Join Date: Nov 2008
Location: Hyper Space
Posts: 809
Thanks: 3
Thanked 184 Times in 102 Posts
Default

top command man page also explains output.
__________________
Neither in this world nor elsewhere is there any happiness in store for him who always doubts. If you enjoyed my answer please consider donating some money to FreeBSD foundation @ http://www.freebsdfoundation.org/
Reply With Quote
  #5  
Old June 20th, 2009, 17:59
blah blah is offline
Banned
 
Join Date: Dec 2008
Posts: 75
Thanks: 4
Thanked 16 Times in 16 Posts
Default

you can see similar info via mwchan column in ps(1)
Code:
$ ps Omwchan
  PID MWCHAN  TT  STAT      TIME COMMAND
 1250 kqread  ??  Is     0:00.93 /usr/sbin/nscd

$ ps l
  UID   PID  PPID CPU PRI NI   VSZ   RSS MWCHAN STAT  TT       TIME COMMAND
    0  1250     1   0  44  0 11604  2156 kqread Is    ??    0:00.94 /usr/sbin/nscd
Reply With Quote
  #6  
Old June 22nd, 2009, 17:12
ed@ ed@ is offline
FreeBSD Developer
 
Join Date: Jun 2008
Posts: 17
Thanks: 3
Thanked 7 Times in 3 Posts
Default

Hi wonslung,

Just to put it (very) simple: in FreeBSD, all processes are either capable of running (placed on the run queue of the scheduler) or are waiting for some activity (blocked, placed on sleep queues). When processes are blocked on sleep queues, they can specify a wait channel message, which is the column you are describing. You can also see this message show up if you press ^T in the terminal:

$
load: 0.00 cmd: sh 97917 [ttyin] 5.75r 0.00u 0.00s 0% 1364k

As you can see, the process is blocked on "ttyin", which means the process is waiting for input on the TTY, which makes sense.

These states aren't documented, mainly because the strings that are used are spread throughout the tree and are subject to change. "kqread" just means a process is blocked on kqueue(2). "select" means a process is blocked on select(2). "nanslp" means a process sleeping on a nanosleep(2) call.
Reply With Quote
The Following 4 Users Say Thank You to ed@ For This Useful Post:
blah (June 23rd, 2009), manolis@ (June 23rd, 2009), Patrickly (November 9th, 2010), vertexSymphony (November 13th, 2010)
  #7  
Old November 8th, 2010, 19:12
quintessence's Avatar
quintessence quintessence is offline
Member
 
Join Date: Nov 2008
Location: Sofia, BG
Posts: 145
Thanks: 2
Thanked 28 Times in 24 Posts
Default

Hello ,

What about state *Name , what does it mean ?

I found only similar name as parameter *NameBuffer in AcpiNsBuildExternalPath function , but ...
Reply With Quote
  #8  
Old November 8th, 2010, 20:08
ed@ ed@ is offline
FreeBSD Developer
 
Join Date: Jun 2008
Posts: 17
Thanks: 3
Thanked 7 Times in 3 Posts
Default

So you want to know what it means when the string starts with an asterisk? That means it's currently blocked on a lock (e.g. a mutex) inside the kernel.
Reply With Quote
  #9  
Old November 9th, 2010, 00:36
quintessence's Avatar
quintessence quintessence is offline
Member
 
Join Date: Nov 2008
Location: Sofia, BG
Posts: 145
Thanks: 2
Thanked 28 Times in 24 Posts
Default

Hello ,

No , I want to know what means Name in *Name
Reply With Quote
  #10  
Old November 9th, 2010, 08:58
ed@ ed@ is offline
FreeBSD Developer
 
Join Date: Jun 2008
Posts: 17
Thanks: 3
Thanked 7 Times in 3 Posts
Default

Quote:
Originally Posted by quintessence View Post
Hello ,

No , I want to know what means Name in *Name
It's a description of the lock. Each lock in the kernel also has a wchan-like string associated with it.
Reply With Quote
  #11  
Old November 9th, 2010, 21:25
quintessence's Avatar
quintessence quintessence is offline
Member
 
Join Date: Nov 2008
Location: Sofia, BG
Posts: 145
Thanks: 2
Thanked 28 Times in 24 Posts
Default

Hello ,

Yes, but where I can find info what does exactly mean this description Name

I have processes which sometimes stucks in *Name state for a while , and I wonder what exactly causing the lock , and because currently I don't have compiled any debug info ( or sysctl enabled ) I believe it is somewhere documented / mentioned . And until now I found related info ( similar to *Name ) only in sys/dev/acpica .
Reply With Quote
  #12  
Old November 9th, 2010, 21:40
ed@ ed@ is offline
FreeBSD Developer
 
Join Date: Jun 2008
Posts: 17
Thanks: 3
Thanked 7 Times in 3 Posts
Default

That's probably the name cache:

fgrep -r '"Name' /sys/kern

Last edited by DutchDaemon; November 10th, 2010 at 00:24.
Reply With Quote
The Following User Says Thank You to ed@ For This Useful Post:
quintessence (November 9th, 2010)
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] top + cpu load graudeejs General 11 August 5th, 2010 08:35
[Solved] top Graaf_van_Vlaanderen General 3 April 12th, 2009 16:21
My top ten reasaon for going opensource ChickenWing88 Off-Topic 5 February 24th, 2009 07:26
oh no, top level domain name doesn't resolve porcelaindev Web & Network Services 11 January 9th, 2009 15:12
nice and priority (PRI in top) rambetter General 1 December 13th, 2008 01:20


All times are GMT +1. The time now is 13:43.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0