| 263 | #endif /* EPOCH_TRACE */ |
| 264 | |
| 265 | static void |
| 266 | epoch_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 | } |
| 297 | SYSINIT(epoch, SI_SUB_EPOCH, SI_ORDER_FIRST, epoch_init, NULL); |
| 298 | |
| 299 | #if !defined(EARLY_AP_STARTUP) |
nothing calls this directly
no test coverage detected