From owner-svn-src-all@freebsd.org Thu Jan 19 19:58:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DDE8CB88C1; Thu, 19 Jan 2017 19:58:10 +0000 (UTC) (envelope-from sbruno@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 mx1.freebsd.org (Postfix) with ESMTPS id 13C11199B; Thu, 19 Jan 2017 19:58:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JJw9Do009582; Thu, 19 Jan 2017 19:58:09 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJw98r009581; Thu, 19 Jan 2017 19:58:09 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701191958.v0JJw98r009581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 19 Jan 2017 19:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312434 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 19:58:10 -0000 Author: sbruno Date: Thu Jan 19 19:58:08 2017 New Revision: 312434 URL: https://svnweb.freebsd.org/changeset/base/312434 Log: Adjust gtaskqueue startup again so that we catch the !SMP case and users that choose not to use EARLY_AP_STARTUP. There is still an initialization issue/panic with !SMP and !EARLY_AP_STARTUP that we have yet to resolve. Submitted by: bde Modified: head/sys/sys/gtaskqueue.h Modified: head/sys/sys/gtaskqueue.h ============================================================================== --- head/sys/sys/gtaskqueue.h Thu Jan 19 19:47:32 2017 (r312433) +++ head/sys/sys/gtaskqueue.h Thu Jan 19 19:58:08 2017 (r312434) @@ -81,7 +81,7 @@ int taskqgroup_adjust(struct taskqgroup extern struct taskqgroup *qgroup_##name -#ifdef EARLY_AP_STARTUP +#if (!defined(SMP) || defined(EARLY_AP_STARTUP)) #define TASKQGROUP_DEFINE(name, cnt, stride) \ \ struct taskqgroup *qgroup_##name; \ @@ -95,7 +95,7 @@ taskqgroup_define_##name(void *arg) \ SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \ taskqgroup_define_##name, NULL) -#else +#else /* SMP && !EARLY_AP_STARTUP */ #define TASKQGROUP_DEFINE(name, cnt, stride) \ \ struct taskqgroup *qgroup_##name; \ @@ -104,6 +104,15 @@ static void \ taskqgroup_define_##name(void *arg) \ { \ qgroup_##name = taskqgroup_create(#name); \ + /* Adjustment will be null unless smp_cpus == 1. */ \ + /* \ + * XXX this was intended to fix the smp_cpus == 1 case, but \ + * doesn't actually work for that. It gives thes same strange \ + * panic as adjustment at SI_SUB_INIT_IF:SI_ORDER_ANY for a \ + * device that works with a pure UP kernel. \ + */ \ + /* XXX this code is common now, so should not be ifdefed. */ \ + taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ } \ \ SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \ @@ -112,14 +121,18 @@ SYSINIT(taskqgroup_##name, SI_SUB_INIT_I static void \ taskqgroup_adjust_##name(void *arg) \ { \ + /* \ + * Adjustment when smp_cpus > 1 only works accidentally \ + * (when there is no device interrupt before adjustment). \ + */ \ taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ } \ \ -SYSINIT(taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY, \ +SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \ taskqgroup_adjust_##name, NULL); \ - \ -struct __hack -#endif + +#endif /* !SMP || EARLY_AP_STARTUP */ + TASKQGROUP_DECLARE(net); #endif /* !_SYS_GTASKQUEUE_H_ */