From owner-svn-src-head@freebsd.org Sat Jun 23 07:14:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B6AF1015F4F; Sat, 23 Jun 2018 07:14:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2808A77D20; Sat, 23 Jun 2018 07:14:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0394C49ED; Sat, 23 Jun 2018 07:14:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N7E8jD011034; Sat, 23 Jun 2018 07:14:08 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N7E8NO011033; Sat, 23 Jun 2018 07:14:08 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806230714.w5N7E8NO011033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Jun 2018 07:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335578 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2018 07:14:09 -0000 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;