svn commit: r312434 - head/sys/sys

Sean Bruno sbruno at FreeBSD.org
Thu Jan 19 19:58:10 UTC 2017


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_ */


More information about the svn-src-head mailing list