MCPcopy Create free account
hub / github.com/F-Stack/f-stack / callout_cpu_init

Function callout_cpu_init

freebsd/kern/kern_timeout.c:314–334  ·  view source on GitHub ↗

* Initialize the per-cpu callout structures. */

Source from the content-addressed store, hash-verified

312 * Initialize the per-cpu callout structures.
313 */
314static void
315callout_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/*

Callers 1

callout_callwheel_initFunction · 0.70

Calls 5

mtx_initFunction · 0.85
pcpu_findFunction · 0.85
snprintfFunction · 0.85
malloc_domainsetFunction · 0.70
cc_cce_cleanupFunction · 0.70

Tested by

no test coverage detected