Date: Wed, 26 Jan 2005 12:25:18 -0800 (PST) From: Doug Ambrisko <ambrisko@ambrisko.com> To: Chris Landauer <cal@rushg.aero.org> Cc: freebsd-hackers@freebsd.org Subject: Re: bug in calcru() Message-ID: <200501262025.j0QKPIIq092663@ambrisko.com> In-Reply-To: <200501262010.j0QKArWl041942@calamari.aero.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Chris Landauer writes: | thanx for the suggestion - the notion of computing ut just with subtraction is | really good, since it is likely to be the largest of the three values in most | applications, but i'm a little worried that the 1024 multiplications aren't | large enough when tt gets really large - i'll do the math on it and report its | (provable) range of applicability and accuracy in a few days I understand it wouldn't be exact but it will be better then the 100% typical use ie. (10% system, 20% interrupt and 70% user). With the stuff to ensure it is monitonically increasing you can get "wacky" results so IMHO it will never be right but "good enough" Atleast that is what I recall when I tested this stuff out a long time ago. The assumption with this calculation is that st & it tend to be small compared to tt so the 1024 X shouldn't overflow much. | > Doug Ambrisko <ambrisko@ambrisko.com> wrote | > ... | > /* Subdivide tu. try to becareful of overflow */ | > su = tu * (st * 1024 / tt) / 1024; | > iu = tu * (it * 1024 / tt) / 1024; | > uu = tu - (su + iu); | > ... Doug A.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501262025.j0QKPIIq092663>