From owner-freebsd-hackers Sat Mar 20 12:37:23 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (Postfix) with SMTP id 2659014C10 for ; Sat, 20 Mar 1999 12:37:18 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id TAA02543; Sat, 20 Mar 1999 19:19:26 +0100 From: Luigi Rizzo Message-Id: <199903201819.TAA02543@labinfo.iet.unipi.it> Subject: Re: Calculation of load average and CCPU_SHIFT To: bf20761@binghamton.edu (zhihuizhang) Date: Sat, 20 Mar 1999 19:19:26 +0100 (MET) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: from "zhihuizhang" at Mar 20, 99 03:17:56 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 354 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I am looking into the source code in file vm_meter.c and kern_synch.c of > FreeBSD 2.2.8. They use integer multiplication and shift operation to > replace the costly float multiplication. The FSCALE and FSHIFT are for it is not only costly (actually, on modern CPUs it is not costly at all!), FPU usage is not allowed in the kernel. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message