Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_synch.c
Show First 20 Lines • Show All 601 Lines • ▼ Show 20 Lines | avg->ldavg[i] = (cexp[i] * avg->ldavg[i] + | ||||
nrun * FSCALE * (FSCALE - cexp[i])) >> FSHIFT; | nrun * FSCALE * (FSCALE - cexp[i])) >> FSHIFT; | ||||
/* | /* | ||||
* Schedule the next update to occur after 5 seconds, but add a | * Schedule the next update to occur after 5 seconds, but add a | ||||
* random variation to avoid synchronisation with processes that | * random variation to avoid synchronisation with processes that | ||||
* run at regular intervals. | * run at regular intervals. | ||||
*/ | */ | ||||
callout_reset_sbt(&loadav_callout, | callout_reset_sbt(&loadav_callout, | ||||
SBT_1US * (4000000 + (int)(random() % 2000001)), SBT_1US, | SBT_1US * (4000000 + (arc4random() % 2000001)), SBT_1US, | ||||
cem: This seems performance insensitive to me; approved as far as I’m concerned. 👍
(It should use… | |||||
loadav, NULL, C_DIRECT_EXEC | C_PREL(32)); | loadav, NULL, C_DIRECT_EXEC | C_PREL(32)); | ||||
} | } | ||||
/* ARGSUSED */ | /* ARGSUSED */ | ||||
static void | static void | ||||
synch_setup(void *dummy) | synch_setup(void *dummy) | ||||
{ | { | ||||
callout_init(&loadav_callout, 1); | callout_init(&loadav_callout, 1); | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
This seems performance insensitive to me; approved as far as I’m concerned. 👍
(It should use arc4random_uniform instead, but the modulo bias is an existing issue and there’s no obvious connection between this and key material to me, so I wouldn’t gate this change on availability of the arc4random_uniform(9) KPI.)