Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!sco!abs From: abs@sco.COM (Amy Snader) Newsgroups: comp.unix.xenix Subject: load average on Xenix Message-ID: <713@sysco> Date: 22 Jun 89 06:40:03 GMT Distribution: usa Organization: The Santa Cruz Operation, Inc. Lines: 28 I was playing around with this in 2.3.1, and it appears that you have something like: short avenrun[3]; in the kernel, and the load average values are these values divided by 256.0. I came upon 256 emperically ... is there any particular reason or precedent for this magic cookie? It isn't documented in any file that I could find. -- Chip Rosenthal / chip@vector.Dallas.TX.US / Dallas Semiconductor / 214-450-5337 The three numbers in avenrun are the 1, 5, and 15 minute load averages. The load average figures are updated every 5 seconds. These three shorts are being used as pseudo-floating point numbers, with 8 bits to the left of the decimal point, 8 bits to the right. According to comments in the code, the Berkeley kernel maintains a load average in genuine floating point, but when the algorithm was ported to Xenix it was translated into integer-based psuedo-floating point. Because a Xenix box may or may not contain an fpu chip, Xenix assiduously avoids performing any floating point in the kernel. However, once the numbers are read by a user program it's easy enough to translate into a "normal" floating point format. --Amy