From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 21 16:51:18 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C4F6106564A for ; Mon, 21 Nov 2011 16:51:18 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13::5]) by mx1.freebsd.org (Postfix) with ESMTP id CB5518FC23 for ; Mon, 21 Nov 2011 16:51:17 +0000 (UTC) Received: from eg.sd.rdtc.ru (localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.14.5/8.14.5) with ESMTP id pALGpERb080992; Mon, 21 Nov 2011 23:51:14 +0700 (NOVT) (envelope-from eugen@grosbein.pp.ru) Message-ID: <4ECA817D.5020205@grosbein.pp.ru> Date: Mon, 21 Nov 2011 23:51:09 +0700 From: Eugene Grosbein User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; ru-RU; rv:1.9.2.13) Gecko/20110112 Thunderbird/3.1.7 MIME-Version: 1.0 To: Ryan Stone References: <4EC39367.4030109@rdtc.ru> <4EC9EE5A.2070204@grosbein.pp.ru> In-Reply-To: Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit Cc: hackers@freebsd.org Subject: Re: dummynet(4) kernel process CPU usage monitoring X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 16:51:18 -0000 21.11.2011 23:37, Ryan Stone пишет: > On Mon, Nov 21, 2011 at 1:23 AM, Eugene Grosbein 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