Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2009 23:04:31 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r191676 - head/sys/kern
Message-ID:  <200904292304.n3TN4WbH095279@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jeff
Date: Wed Apr 29 23:04:31 2009
New Revision: 191676
URL: http://svn.freebsd.org/changeset/base/191676

Log:
   - Fix non-SMP build by encapsulating idle spin logic in a macro.
  
  Pointy hat to:	me

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c	Wed Apr 29 21:50:13 2009	(r191675)
+++ head/sys/kern/sched_ule.c	Wed Apr 29 23:04:31 2009	(r191676)
@@ -2516,6 +2516,13 @@ sched_sizeof_thread(void)
 	return (sizeof(struct thread) + sizeof(struct td_sched));
 }
 
+#ifdef SMP
+#define	TDQ_IDLESPIN(tdq)						\
+    ((tdq)->tdq_cg != NULL && ((tdq)->tdq_cg->cg_flags & CG_FLAG_THREAD) == 0)
+#else
+#define	TDQ_IDLESPIN(tdq)	1
+#endif
+
 /*
  * The actual idle process.
  */
@@ -2543,8 +2550,7 @@ sched_idletd(void *dummy)
 		 * loops while on SMT machines as this simply steals
 		 * cycles from cores doing useful work.
 		 */
-		if ((tdq->tdq_cg->cg_flags & CG_FLAG_THREAD) == 0 &&
-		    switchcnt > sched_idlespinthresh) {
+		if (TDQ_IDLESPIN(tdq) && switchcnt > sched_idlespinthresh) {
 			for (i = 0; i < sched_idlespins; i++) {
 				if (tdq->tdq_load)
 					break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904292304.n3TN4WbH095279>