diff options
author | jeff <jeff@FreeBSD.org> | 2009-04-29 23:04:31 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2009-04-29 23:04:31 +0000 |
commit | 9ff631ca4616f2e067969c2598f97d0aaa69c957 (patch) | |
tree | 6eaf9be9dc75924ad26e6c5200983d78a1fed5f7 /sys/kern/sched_ule.c | |
parent | 8fbb51e63754407583af36cbc775f8f3bae6b1e7 (diff) | |
download | FreeBSD-src-9ff631ca4616f2e067969c2598f97d0aaa69c957.zip FreeBSD-src-9ff631ca4616f2e067969c2598f97d0aaa69c957.tar.gz |
- Fix non-SMP build by encapsulating idle spin logic in a macro.
Pointy hat to: me
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r-- | sys/kern/sched_ule.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 680572d..760149e 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -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; |