* Initialize the per-cpu callout structures. */
| 312 | * Initialize the per-cpu callout structures. |
| 313 | */ |
| 314 | static void |
| 315 | callout_cpu_init(struct callout_cpu *cc, int cpu) |
| 316 | { |
| 317 | int i; |
| 318 | |
| 319 | mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); |
| 320 | cc->cc_inited = 1; |
| 321 | cc->cc_callwheel = malloc_domainset(sizeof(struct callout_list) * |
| 322 | callwheelsize, M_CALLOUT, |
| 323 | DOMAINSET_PREF(pcpu_find(cpu)->pc_domain), M_WAITOK); |
| 324 | for (i = 0; i < callwheelsize; i++) |
| 325 | LIST_INIT(&cc->cc_callwheel[i]); |
| 326 | TAILQ_INIT(&cc->cc_expireq); |
| 327 | cc->cc_firstevent = SBT_MAX; |
| 328 | for (i = 0; i < 2; i++) |
| 329 | cc_cce_cleanup(cc, i); |
| 330 | #ifdef KTR |
| 331 | snprintf(cc->cc_ktr_event_name, sizeof(cc->cc_ktr_event_name), |
| 332 | "callwheel cpu %d", cpu); |
| 333 | #endif |
| 334 | } |
| 335 | |
| 336 | #ifdef SMP |
| 337 | /* |
no test coverage detected