sched_ule.c (166247) | sched_ule.c (166557) |
---|---|
1/*- 2 * Copyright (c) 2002-2007, Jeffrey Roberson <jeff@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2007, Jeffrey Roberson <jeff@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/sched_ule.c 166247 2007-01-25 23:51:59Z jeff $"); | 28__FBSDID("$FreeBSD: head/sys/kern/sched_ule.c 166557 2007-02-08 01:52:25Z jeff $"); |
29 30#include "opt_hwpmc_hooks.h" 31#include "opt_sched.h" 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kdb.h> 36#include <sys/kernel.h> --- 136 unchanged lines hidden (view full) --- 173 174/* 175 * tdq - per processor runqs and statistics. 176 */ 177struct tdq { 178 struct runq tdq_idle; /* Queue of IDLE threads. */ 179 struct runq tdq_timeshare; /* timeshare run queue. */ 180 struct runq tdq_realtime; /* real-time run queue. */ | 29 30#include "opt_hwpmc_hooks.h" 31#include "opt_sched.h" 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kdb.h> 36#include <sys/kernel.h> --- 136 unchanged lines hidden (view full) --- 173 174/* 175 * tdq - per processor runqs and statistics. 176 */ 177struct tdq { 178 struct runq tdq_idle; /* Queue of IDLE threads. */ 179 struct runq tdq_timeshare; /* timeshare run queue. */ 180 struct runq tdq_realtime; /* real-time run queue. */ |
181 int tdq_idx; /* Current insert index. */ 182 int tdq_ridx; /* Current removal index. */ | 181 u_char tdq_idx; /* Current insert index. */ 182 u_char tdq_ridx; /* Current removal index. */ 183 short tdq_flags; /* Thread queue flags */ |
183 int tdq_load; /* Aggregate load. */ | 184 int tdq_load; /* Aggregate load. */ |
184 int tdq_flags; /* Thread queue flags */ | |
185#ifdef SMP 186 int tdq_transferable; 187 LIST_ENTRY(tdq) tdq_siblings; /* Next in tdq group. */ 188 struct tdq_group *tdq_group; /* Our processor group. */ 189#else 190 int tdq_sysload; /* For loadavg, !ITHD load. */ 191#endif 192}; --- 170 unchanged lines hidden (view full) --- 363 if (tdq->tdq_transferable >= busy_thresh && 364 (tdq->tdq_flags & TDQF_BUSY) == 0) { 365 tdq->tdq_flags |= TDQF_BUSY; 366 atomic_set_int(&tdq_busy, 1 << TDQ_ID(tdq)); 367 } 368 } 369#endif 370 if (ts->ts_runq == &tdq->tdq_timeshare) { | 185#ifdef SMP 186 int tdq_transferable; 187 LIST_ENTRY(tdq) tdq_siblings; /* Next in tdq group. */ 188 struct tdq_group *tdq_group; /* Our processor group. */ 189#else 190 int tdq_sysload; /* For loadavg, !ITHD load. */ 191#endif 192}; --- 170 unchanged lines hidden (view full) --- 363 if (tdq->tdq_transferable >= busy_thresh && 364 (tdq->tdq_flags & TDQF_BUSY) == 0) { 365 tdq->tdq_flags |= TDQF_BUSY; 366 atomic_set_int(&tdq_busy, 1 << TDQ_ID(tdq)); 367 } 368 } 369#endif 370 if (ts->ts_runq == &tdq->tdq_timeshare) { |
371 int pri; | 371 u_char pri; |
372 373 pri = ts->ts_thread->td_priority; 374 KASSERT(pri <= PRI_MAX_TIMESHARE && pri >= PRI_MIN_TIMESHARE, 375 ("Invalid priority %d on timeshare runq", pri)); 376 /* 377 * This queue contains only priorities between MIN and MAX 378 * realtime. Use the whole queue to represent these values. 379 */ --- 1722 unchanged lines hidden --- | 372 373 pri = ts->ts_thread->td_priority; 374 KASSERT(pri <= PRI_MAX_TIMESHARE && pri >= PRI_MIN_TIMESHARE, 375 ("Invalid priority %d on timeshare runq", pri)); 376 /* 377 * This queue contains only priorities between MIN and MAX 378 * realtime. Use the whole queue to represent these values. 379 */ --- 1722 unchanged lines hidden --- |