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

next in thread | previous in thread | raw e-mail | index | archive | help
21.11.2011 23:37, Ryan Stone пишет:
> 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?

> 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.

I run 8.2-STABLE of 16 October. During most busy hours top shows
some nonzero values but TIME obtained from ps(1) is still several times larger.

Eugene Grosbein



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