dummynet(4) kernel process CPU usage monitoring

Ryan Stone rysto32 at gmail.com
Mon Nov 21 17:00:02 UTC 2011


On Mon, Nov 21, 2011 at 1:23 AM, Eugene Grosbein <eugen at 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.


More information about the freebsd-hackers mailing list