From owner-freebsd-current@FreeBSD.ORG Wed May 7 10:47:54 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64FD51065676 for ; Wed, 7 May 2008 10:47:54 +0000 (UTC) (envelope-from count@211.ru) Received: from mx.211.ru (mx.211.ru [193.238.131.194]) by mx1.freebsd.org (Postfix) with ESMTP id F36888FC18 for ; Wed, 7 May 2008 10:47:48 +0000 (UTC) (envelope-from count@211.ru) Received: from localhost (mx.211.ru [193.238.131.194]) by mx.211.ru (Postfix) with ESMTP id 62823BE5CD for ; Wed, 7 May 2008 17:32:18 +0700 (NOVST) Received: from mx.211.ru ([193.238.131.194]) by localhost (mx.211.ru [193.238.131.194]) (amavisd-new, port 10024) with LMTP id 9LlKFXGWrXiD for ; Wed, 7 May 2008 17:32:15 +0700 (NOVST) Received: from mail.211.ru (unknown [10.5.1.2]) by mx.211.ru (Postfix) with ESMTP id C8135BE591 for ; Wed, 7 May 2008 17:32:15 +0700 (NOVST) Received: from unknown.211.ru (unknown.211.ru [10.3.0.86]) by mail.211.ru (Postfix) with ESMTP id 8191BDAEDB for ; Wed, 7 May 2008 17:32:15 +0700 (NOVST) Received: from unknown.211.ru (localhost [127.0.0.1]) by unknown.211.ru (8.14.1/8.13.8) with ESMTP id m47AWlKb085003 for ; Wed, 7 May 2008 17:32:48 +0700 (NOVST) (envelope-from count@unknown.211.ru) Received: (from count@localhost) by unknown.211.ru (8.14.1/8.14.1/Submit) id m47AWlG3085002 for freebsd-current@freebsd.org; Wed, 7 May 2008 17:32:47 +0700 (NOVST) (envelope-from count) Date: Wed, 7 May 2008 17:32:47 +0700 From: Stanislav A Svirid To: freebsd-current@freebsd.org Message-ID: <20080507103247.GA84958@unknown.211.ru> References: <4820FE0F.9050808@jellydonut.org> <200805070149.m471nToM073813@lava.sentex.ca> <482121B1.7080901@jellydonut.org> <20080507085035.L9490@beagle.kn.op.dlr.de> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20080507085035.L9490@beagle.kn.op.dlr.de> Organization: Siberian Networks User-Agent: Mutt/1.5.17 (2007-11-01) X-Mailman-Approved-At: Wed, 07 May 2008 15:41:28 +0000 Subject: Re: bsnmpd hrProcessorLoad results incorrect on FreeBSD 7 or 8? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2008 10:47:54 -0000 On Wed 07 May, 2008, Harti Brandt wrote: > On Tue, 6 May 2008, Michael Proto wrote: > > MP>Mike Tancsa wrote: > MP>> At 08:55 PM 5/6/2008, Michael Proto wrote: > MP>> > Is anyone seeing problems with bsnmpd reporting an incorrect > MP>> > HOST-RESOURCES-MIB::hrProcessorLoad value under HEAD? I'm using the > MP>> > default /etc/snmpd.config settings and am loading the > MP>> > /usr/lib/snmp_hostres.so library just as I do in 6.3, but the value for > MP>> > this MIB always reports CPU utilization at 100% regardless of the actual > MP>> > load on the system. 6.3 and 6-STABLE both work correctly and report the > MP>> > actual CPU utilization when queried. > MP>> > MP>> IIRC, I noticed this when I changed to ULE from 4BSD_SCHED. > MP>> > MP>> ---Mike > MP>> _______________________________________________ > MP>> freebsd-current@freebsd.org mailing list > MP>> http://lists.freebsd.org/mailman/listinfo/freebsd-current > MP>> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > MP> > MP>Would match my environment as well, as I'm using ULE on all of the > MP>affected systems. Just built a 4BSD kernel on my HEAD system and > MP>HOST-RESOURCES-MIB::hrProcessorLoad reports a correct value again. > MP> > MP>Anyone have an idea on a fix? > > If anybody has a fix that works with both schedulers, I happily commit > this. Here you are :) --- hostres_processor_tbl.c.old 2008-05-07 17:23:47.000000000 +0700 +++ hostres_processor_tbl.c 2008-05-07 17:23:54.000000000 +0700 @@ -120,7 +120,7 @@ static double processor_getpcpu(struct kinfo_proc *ki_p) { - if (ccpu == 0 || fscale == 0) + if (fscale == 0) return (0.0); #define fxtofl(fixpt) ((double)(fixpt) / fscale) -- Stanislav Svirid > Siberian Networks, Novosibirsk, Russia > SAS-RIPE, 3909675@ICQ