Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2011 11:37:21 -0500
From:      Ryan Stone <rysto32@gmail.com>
To:        Eugene Grosbein <eugen@grosbein.pp.ru>
Cc:        hackers@freebsd.org
Subject:   Re: dummynet(4) kernel process CPU usage monitoring
Message-ID:  <CAFMmRNzKRxqj3dp_8fHzniQ%2BRtTiSN0wxPjcMa9pP97n1=Bxtg@mail.gmail.com>
In-Reply-To: <4EC9EE5A.2070204@grosbein.pp.ru>
References:  <4EC39367.4030109@rdtc.ru> <4EC9EE5A.2070204@grosbein.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 21, 2011 at 1:23 AM, Eugene Grosbein <eugen@grosbein.pp.ru> wrote:
> Hi!
>
> I need to draw graph of dummynet's CPU usage.
> "procstat -t 0" shows me TID (thread id) of dummynet kernel thread.
> "ps -Hxo time,lwp" shows me total CPU time consumed by this thread.
>
> Now I see this time has 9 seconds increase during 60 seconds of real time.
> This should be 9/60=15% CPU usage, but "top -SHP" shows me 0.00% meantime.
>
> Where is my error?
>
> Eugene Grosbein

Which version are you running?  8.1-RELEASE and older have the problem
that the scheduler and the CPU statistics gatherer are driven from the
same clock.  For threads that tend to frequently wake up and run for
less than a full tick(dummynet would appear to fall in this category)
this means that CPU usage statistics are never captured at a point
where those threads are running, so top shows 0% for those threads.

I am told that some relatively recent timer-related work(eventtimer?)
should have resolved the issue, which is definitely in 9.0 and might
be in stable/8 and may even have made it into 8.2-RELEASE.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNzKRxqj3dp_8fHzniQ%2BRtTiSN0wxPjcMa9pP97n1=Bxtg>