Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jul 2002 09:44:31 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        "Kevin Kinsey, DaleCo, S.P." <kdk@daleco.biz>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: More about top(1)
Message-ID:  <20020701144431.GA15191@dan.emsphone.com>
In-Reply-To: <021001c2210c$9f4f6560$aae2910c@fbccarthage.com>
References:  <021001c2210c$9f4f6560$aae2910c@fbccarthage.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jul 01), Kevin Kinsey, DaleCo, S.P. said:
> On my system, 'top' seems to show a larger number of "state"
> descriptors than the manpage would indicate.
> 
> Googling "top(1)" brought up the HTML manpages for OpenBSD, which is
> the same, of course <?!> (where was ours, I wonder?)

man top
 
> What's a resource for learning more about 'top'?  Or, more
> specifically, what is 'poll' 'nanslp' 'piperd'?

The "STATE" column describes where in the kernel a process is waiting
for something to happen.  Any time kernel code calls a sleep function,
it has to pass a text string describing why it's sleeping.  From
/sys/kern/sys_pipe.c, for example:

    /*
     * If the other side is blocked, wake it up saying that
     * we want to close it down.
     */
    while (cpipe->pipe_busy) {
        wakeup(cpipe);
        cpipe->pipe_state |= PIPE_WANT | PIPE_EOF;
        msleep(cpipe, PIPE_MTX(cpipe), PRIBIO, "pipecl", 0);
    }

In this example "pipecl" would show up in the STATE column of top for a
process that's waiting for the other end of a pipe to close.  There is
no definitive index of sleep strings.  Grep the kernel source for it if
you really want to know what the code is doing.  Under current, STATEs
with an asterisk in front of them are mutexes.  The only one you're
likely to ever see is *Giant.

-- 
	Dan Nelson
	dnelson@allantgroup.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020701144431.GA15191>