diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2019-11-22 23:23:40 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2019-11-22 23:23:40 +0000 |
commit | 7993a104a10c81e4049e5923061d9bb7a5e35d80 (patch) | |
tree | 916e6db16a17e1940a3a6987453a18a8a7255964 /sys | |
parent | bae3729be460e4857213505c067b0a5bba483a23 (diff) | |
download | src-7993a104a10c81e4049e5923061d9bb7a5e35d80.tar.gz src-7993a104a10c81e4049e5923061d9bb7a5e35d80.zip |
Add explicit SI_SUB_EPOCH
Add explicit SI_SUB_EPOCH, after SI_SUB_TASKQ and before SI_SUB_SMP
(EARLY_AP_STARTUP). Rename existing "SI_SUB_TASKQ + 1" to SI_SUB_EPOCH.
epoch(9) consumers cannot epoch_alloc() before SI_SUB_EPOCH:SI_ORDER_SECOND,
but likely should allocate before SI_SUB_SMP. Prior to this change,
consumers (well, epoch itself, and net/if.c) just open-coded the
SI_SUB_TASKQ + 1 order to match epoch.c, but this was fragile.
Reviewed by: mmacy
Differential Revision: https://reviews.freebsd.org/D22503
Notes
Notes:
svn path=/head/; revision=355024
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_epoch.c | 2 | ||||
-rw-r--r-- | sys/net/if.c | 3 | ||||
-rw-r--r-- | sys/sys/kernel.h | 1 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c index 5d126fadb536..0b3d634901be 100644 --- a/sys/kern/subr_epoch.c +++ b/sys/kern/subr_epoch.c @@ -276,7 +276,7 @@ epoch_init(void *arg __unused) global_epoch = epoch_alloc("Global", 0); global_epoch_preempt = epoch_alloc("Global preemptible", EPOCH_PREEMPT); } -SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); +SYSINIT(epoch, SI_SUB_EPOCH, SI_ORDER_FIRST, epoch_init, NULL); #if !defined(EARLY_AP_STARTUP) static void diff --git a/sys/net/if.c b/sys/net/if.c index 9128a048b91b..aaff4c6e2bf1 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -933,8 +933,7 @@ if_epochalloc(void *dummy __unused) net_epoch_preempt = epoch_alloc("Net preemptible", EPOCH_PREEMPT); net_epoch = epoch_alloc("Net", 0); } -SYSINIT(ifepochalloc, SI_SUB_TASKQ + 1, SI_ORDER_ANY, - if_epochalloc, NULL); +SYSINIT(ifepochalloc, SI_SUB_EPOCH, SI_ORDER_ANY, if_epochalloc, NULL); static void if_attachdomain(void *dummy) diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index a9bfaa9ef7c4..fa6accf6156b 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -124,6 +124,7 @@ enum sysinit_sub_id { SI_SUB_MBUF = 0x2700000, /* mbuf subsystem */ SI_SUB_INTR = 0x2800000, /* interrupt threads */ SI_SUB_TASKQ = 0x2880000, /* task queues */ + SI_SUB_EPOCH = 0x2888000, /* epoch subsystem */ #ifdef EARLY_AP_STARTUP SI_SUB_SMP = 0x2900000, /* start the APs*/ #endif |