Date: Fri, 22 Nov 2019 23:23:41 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355024 - in head/sys: kern net sys Message-ID: <201911222323.xAMNNfwi027342@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Fri Nov 22 23:23:40 2019 New Revision: 355024 URL: https://svnweb.freebsd.org/changeset/base/355024 Log: 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 Modified: head/sys/kern/subr_epoch.c head/sys/net/if.c head/sys/sys/kernel.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri Nov 22 21:31:59 2019 (r355023) +++ head/sys/kern/subr_epoch.c Fri Nov 22 23:23:40 2019 (r355024) @@ -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 Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Nov 22 21:31:59 2019 (r355023) +++ head/sys/net/if.c Fri Nov 22 23:23:40 2019 (r355024) @@ -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) Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Fri Nov 22 21:31:59 2019 (r355023) +++ head/sys/sys/kernel.h Fri Nov 22 23:23:40 2019 (r355024) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911222323.xAMNNfwi027342>