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

Function epoch_init

freebsd/kern/subr_epoch.c:265–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263#endif /* EPOCH_TRACE */
264
265static void
266epoch_init(void *arg __unused)
267{
268 int cpu;
269
270 block_count = counter_u64_alloc(M_WAITOK);
271 migrate_count = counter_u64_alloc(M_WAITOK);
272 turnstile_count = counter_u64_alloc(M_WAITOK);
273 switch_count = counter_u64_alloc(M_WAITOK);
274 epoch_call_count = counter_u64_alloc(M_WAITOK);
275 epoch_call_task_count = counter_u64_alloc(M_WAITOK);
276
277 pcpu_zone_record = uma_zcreate("epoch_record pcpu",
278 sizeof(struct epoch_record), NULL, NULL, NULL, NULL,
279 UMA_ALIGN_PTR, UMA_ZONE_PCPU);
280 CPU_FOREACH(cpu) {
281 GROUPTASK_INIT(DPCPU_ID_PTR(cpu, epoch_cb_task), 0,
282 epoch_call_task, NULL);
283#ifndef FSTACK
284 taskqgroup_attach_cpu(qgroup_softirq,
285 DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, NULL, NULL,
286 "epoch call task");
287#endif
288 }
289#ifdef EPOCH_TRACE
290 SLIST_INIT(&thread0.td_epochs);
291#endif
292 sx_init(&epoch_sx, "epoch-sx");
293 inited = 1;
294 global_epoch = epoch_alloc("Global", 0);
295 global_epoch_preempt = epoch_alloc("Global preemptible", EPOCH_PREEMPT);
296}
297SYSINIT(epoch, SI_SUB_EPOCH, SI_ORDER_FIRST, epoch_init, NULL);
298
299#if !defined(EARLY_AP_STARTUP)

Callers

nothing calls this directly

Calls 4

counter_u64_allocFunction · 0.85
uma_zcreateFunction · 0.85
taskqgroup_attach_cpuFunction · 0.85
epoch_allocFunction · 0.70

Tested by

no test coverage detected