From owner-freebsd-questions Thu Apr 2 23:32:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA10400 for freebsd-questions-outgoing; Thu, 2 Apr 1998 23:32:42 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA10370 for ; Thu, 2 Apr 1998 23:32:14 -0800 (PST) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id XAA28847; Thu, 2 Apr 1998 23:31:37 -0800 (PST) Message-Id: <199804030731.XAA28847@implode.root.com> To: Mike Lei cc: freebsd-questions@FreeBSD.ORG Subject: Re: FreeBSD kernel In-reply-to: Your message of "Fri, 03 Apr 1998 01:38:48 EST." <352483F8.B30950F7@mailbox.syr.edu> From: David Greenman Reply-To: dg@root.com Date: Thu, 02 Apr 1998 23:31:36 -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > The commands 'uptime' and 'top' on FreeBSD both obtain three values >through the kernel variable '_averunnable'. Actually, '_averunnable' >points to an array in /dev/kmem which holds three values. After both >commands get those values, they make them divided by FSCALE as "load >average". One of my questions is how those three values in that array >be generated by FreeBSD kernel. In other words, what factors does >FreeBSD >kernel depend on to determine the term "load average"?? > > I know the value of FSCALE on FreeBSD is 2048, because I printed the >constant in a program. And on SunOs, FSCALE is 256, right? What is "256 > >scale array" or "2048 scale array"? What do thay mean? And why do we >have to make the values that get from that array in /dev/kmem divided by > >FSCALE? There is a description of the load average (and process priority) calculation on pages 94-95 of "The Design and Implementation of the 4.4BSD Operating System", by McKusick et al. I believe that FSHIFT and FSCALE are used to scale the integers for doing the fixed-point decimal calculations of the load average. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message