From owner-freebsd-net@FreeBSD.ORG Sun May 11 02:52:30 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80B7237B401 for ; Sun, 11 May 2003 02:52:30 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5358243FDF for ; Sun, 11 May 2003 02:52:29 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id TAA05409; Sun, 11 May 2003 19:52:12 +1000 Date: Sun, 11 May 2003 19:52:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Don Bowman In-Reply-To: Message-ID: <20030511190918.H74932@gamplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: RE: polling(4) and idle time/cpu usage percentages X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2003 09:52:30 -0000 On Sat, 10 May 2003, Don Bowman wrote: [accounting for the details of idle time] > > The former. It's hard for it to work better without wasting too many > > cycles for the accounting. In RELENG_4, everything done in the "idle" > > loop is counted as idle time using the single counter > > cp_time[CP_IDLE]. > > This is very efficient. > > I tried this on my system, but I still end up with 0 system time. Did you try my hack? > Does the machdep.cpu_idle_hlt=1 have any affect on this? No. However, counting the halted time separately would give another indication of fully idle time (if this sysctl variable is set). On waking up from the halted state, the CPU has to check if there is something to run. This can be considered as useful work and counted as system time. However, if we don't halt then we have to mostly just spin doing the check, and this must be considered as unuseful work. > I'm passing 1Gbps each way through a bridge (e.g. 1Gbps in > and 1Gbps out each of 2 interfaces), and I have 88.4% idle. > This is admittedly on a pretty fast processor, a 2x2.8GHz XEON. I don't quite believe that it could have 88.4% fully idle. Bruce