Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_timeout.c
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | callout_callwheel_init(void *dummy) | ||||
int cpu; | int cpu; | ||||
/* | /* | ||||
* Calculate the size of the callout wheel and the preallocated | * Calculate the size of the callout wheel and the preallocated | ||||
* timeout() structures. | * timeout() structures. | ||||
* XXX: Clip callout to result of previous function of maxusers | * XXX: Clip callout to result of previous function of maxusers | ||||
* maximum 384. This is still huge, but acceptable. | * maximum 384. This is still huge, but acceptable. | ||||
*/ | */ | ||||
memset(CC_CPU(curcpu), 0, sizeof(cc_cpu)); | |||||
ncallout = imin(16 + maxproc + maxfiles, 18508); | ncallout = imin(16 + maxproc + maxfiles, 18508); | ||||
TUNABLE_INT_FETCH("kern.ncallout", &ncallout); | TUNABLE_INT_FETCH("kern.ncallout", &ncallout); | ||||
/* | /* | ||||
* Calculate callout wheel size, should be next power of two higher | * Calculate callout wheel size, should be next power of two higher | ||||
* than 'ncallout'. | * than 'ncallout'. | ||||
*/ | */ | ||||
callwheelsize = 1 << fls(ncallout); | callwheelsize = 1 << fls(ncallout); | ||||
▲ Show 20 Lines • Show All 1,295 Lines • Show Last 20 Lines |