Date: Sat, 23 Jun 2018 07:14:08 +0000 (UTC) From: Matt Macy <mmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335578 - head/sys/kern Message-ID: <201806230714.w5N7E8NO011033@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmacy Date: Sat Jun 23 07:14:08 2018 New Revision: 335578 URL: https://svnweb.freebsd.org/changeset/base/335578 Log: epoch(9): Don't trigger taskq enqueue before the grouptaskqs are setup If EARLY_AP_STARTUP is not defined it is possible for an epoch to be allocated prior to it being possible to call epoch_call without issue. Based on patch by andrew@ PR: 229014 Reported by: andrew Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Sat Jun 23 06:53:53 2018 (r335577) +++ head/sys/kern/subr_epoch.c Sat Jun 23 07:14:08 2018 (r335578) @@ -176,10 +176,19 @@ 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) { int domain, cpu_offset; @@ -570,6 +579,10 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* /* 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806230714.w5N7E8NO011033>