Re: process states revisited

2007-01-09 Thread Pieter de Goeje
On Tuesday 09 January 2007 06:10, Greg Albrecht wrote:
 while searching for 'freebsd process states' on google i came across
 this thread:
 http://lists.freebsd.org/pipermail/freebsd-questions/2006-December/138024.h
tml i'm a new subscriber, so i can't reply to the original thread.

 i'm guessing [EMAIL PROTECTED]'s original question was something more
 like: that do the values in the STATE column in top mean? here's an
 example of what i'm talking about:

 ## bad 'top' formatting to come
   PID USERNAME  PRI NICE   SIZERES STATE  C   TIME   WCPUCPU
 COMMAND 95698 mysql  200   388M   349M kserel 0 266.7H  0.63% 
 0.63% mysqld 98237 jffnms  80 21224K 14412K nanslp 0   0:02 
 0.59%  0.59% php 98239 jffnms 960 22124K 15292K select 1   0:02
  0.49%  0.49% php 98596 root   960  4124K  2560K CPU1   1  
 0:00  0.51%  0.05% top 1263 root40  1408K   708K accept 0  
 0:07  0.00%  0.00% vsftpd 3405 galbrecht   80  4876K  2676K wait  
 0   0:00  0.00%  0.00% bash 94414 root40  3284K  1968K
 sbwait 1   0:00  0.00%  0.00% mysql ## end of bad formatting

 this snippet of top shows the following values for STATE: kserel,
 nanslp, select, CPU1, accept, wait, sbwait

 this thread has already cleared up these states:
 nanslp: Waiting for  1 second. [EMAIL PROTECTED]
 select: Waiting for a select() to complete [EMAIL PROTECTED]
 wait:  Waiting for something to happen, possibly time limited (= 1
 second) [EMAIL PROTECTED]

 top(1) tells us: STATE is the current state (one of sleep, WAIT,
 run, idl, zomb, or  stop)

 eh, not so much.

 man clears up some of these states:
 sleep: The sleep command suspends execution for a minimum of
 seconds. - sleep(1)
 accept: accept a connection on a socket - accept(2)

 i bet i can answer with:
 run: process is running?
 zomb: zombie process, terminated but not removed from memory

 that leaves us with:
 kserel?
The process is waiting for some event to occur in one of its threads.
see kse(2). Please someone correct me if I'm wrong.

 sbwait?
Wait for data to arrive at/drain from a socket buffer. (see  
sys/kern/uipc_socket2.c:363). So, it is essentially waiting for network I/O.

 idl?
 stop?
I've never seen a process in one of these states.


 does the previous answer still apply (ask the developers of those
 programs)?
The states are set in the kernel, so the (userland) program developers 
wouldn't be able to answer these questions.

Hope this helps,
Pieter
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


process states revisited

2007-01-08 Thread Greg Albrecht

while searching for 'freebsd process states' on google i came across
this thread:
http://lists.freebsd.org/pipermail/freebsd-questions/2006-December/138024.html
i'm a new subscriber, so i can't reply to the original thread.

i'm guessing [EMAIL PROTECTED]'s original question was something more like:
that do the values in the STATE column in top mean? here's an
example of what i'm talking about:

## bad 'top' formatting to come
 PID USERNAME  PRI NICE   SIZERES STATE  C   TIME   WCPUCPU COMMAND
95698 mysql  200   388M   349M kserel 0 266.7H  0.63%  0.63% mysqld
98237 jffnms  80 21224K 14412K nanslp 0   0:02  0.59%  0.59% php
98239 jffnms 960 22124K 15292K select 1   0:02  0.49%  0.49% php
98596 root   960  4124K  2560K CPU1   1   0:00  0.51%  0.05% top
1263 root40  1408K   708K accept 0   0:07  0.00%  0.00% vsftpd
3405 galbrecht   80  4876K  2676K wait   0   0:00  0.00%  0.00% bash
94414 root40  3284K  1968K sbwait 1   0:00  0.00%  0.00% mysql
## end of bad formatting

this snippet of top shows the following values for STATE: kserel,
nanslp, select, CPU1, accept, wait, sbwait

this thread has already cleared up these states:
nanslp: Waiting for  1 second. [EMAIL PROTECTED]
select: Waiting for a select() to complete [EMAIL PROTECTED]
wait:  Waiting for something to happen, possibly time limited (= 1
second) [EMAIL PROTECTED]

top(1) tells us: STATE is the current state (one of sleep, WAIT,
run, idl, zomb, or  stop)

eh, not so much.

man clears up some of these states:
sleep: The sleep command suspends execution for a minimum of
seconds. - sleep(1)
accept: accept a connection on a socket - accept(2)

i bet i can answer with:
run: process is running?
zomb: zombie process, terminated but not removed from memory

that leaves us with:
kserel?
sbwait?
idl?
stop?

does the previous answer still apply (ask the developers of those programs)?

-g

--
Greg Albrecht ([EMAIL PROTECTED])
An Indie, Hip Hop and IDM Podcast: The Letter G
http://theletterg.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]