X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/e3027f41d0120b4278cca462f397b6619dcd9ac5..0b4e3aa066abc0728aacb4bbeb86f53f9737156e:/osfmk/kern/mach_factor.c diff --git a/osfmk/kern/mach_factor.c b/osfmk/kern/mach_factor.c index eca59d7c6..14eba5e2b 100644 --- a/osfmk/kern/mach_factor.c +++ b/osfmk/kern/mach_factor.c @@ -76,11 +76,16 @@ integer_t mach_factor[3] = {0, 0, 0}; /* * Values are scaled by LOAD_SCALE, defined in processor_info.h */ +#define base(n) ((n) << SCHED_TICK_SHIFT) +#define frac(n) (((base(n) - 1) * LOAD_SCALE) / base(n)) + static long fract[3] = { - 800, /* (4.0/5.0) 5 second average */ - 966, /* (29.0/30.0) 30 second average */ - 983, /* (59.0/60.) 1 minute average */ + frac(5), /* 5 second average */ + frac(30), /* 30 second average */ + frac(60), /* 1 minute average */ }; +#undef base +#undef frac void compute_mach_factor(void)