aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_epoch.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_epoch.c')
-rw-r--r--sys/kern/subr_epoch.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c
index b5e6f285062f..9a6f6a68eed9 100644
--- a/sys/kern/subr_epoch.c
+++ b/sys/kern/subr_epoch.c
@@ -176,9 +176,18 @@ done:
global_epoch = epoch_alloc(0);
global_epoch_preempt = epoch_alloc(EPOCH_PREEMPT);
}
-
SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL);
+#if !defined(EARLY_AP_STARTUP)
+static void
+epoch_init_smp(void *dummy __unused)
+{
+ inited = 2;
+}
+SYSINIT(epoch_smp, SI_SUB_SMP + 1, SI_ORDER_FIRST, epoch_init_smp, NULL);
+#endif
+
+
static void
epoch_init_numa(epoch_t epoch)
{
@@ -570,6 +579,10 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t
/* too early in boot to have epoch set up */
if (__predict_false(epoch == NULL))
goto boottime;
+#if !defined(EARLY_AP_STARTUP)
+ if (__predict_false(inited < 2))
+ goto boottime;
+#endif
critical_enter();
*DPCPU_PTR(epoch_cb_count) += 1;