epoch(9): allocate net epochs earlier in boot

This commit is contained in:
Matt Macy 2018-05-18 18:48:00 +00:00
parent 20ba6811e6
commit f2d19f98c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333809

View File

@ -899,13 +899,21 @@ if_attach_internal(struct ifnet *ifp, int vmove, struct if_clone *ifc)
rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
}
static void
if_epochalloc(void *dummy __unused)
{
net_epoch_preempt = epoch_alloc(EPOCH_PREEMPT);
net_epoch = epoch_alloc(0);
}
SYSINIT(ifepochalloc, SI_SUB_TASKQ + 1, SI_ORDER_ANY,
if_epochalloc, NULL);
static void
if_attachdomain(void *dummy)
{
struct ifnet *ifp;
net_epoch_preempt = epoch_alloc(EPOCH_PREEMPT);
net_epoch = epoch_alloc(0);
TAILQ_FOREACH(ifp, &V_ifnet, if_link)
if_attachdomain1(ifp);
}