diff options
author | jeff <jeff@FreeBSD.org> | 2003-10-28 03:28:48 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-10-28 03:28:48 +0000 |
commit | 7742522f996f5bdf6e9c631b5ad498c10190ff51 (patch) | |
tree | 3da658cc7c16bcf0f50c1cd9aa630b5de4357351 /sys | |
parent | 0327df13d0644c804fb9d2cc34bd439e06477876 (diff) | |
download | FreeBSD-src-7742522f996f5bdf6e9c631b5ad498c10190ff51.zip FreeBSD-src-7742522f996f5bdf6e9c631b5ad498c10190ff51.tar.gz |
- Only change the run queue in sched_prio() if the kse is non null. threads
can be in the TD_ON_RUNQ state and not have an associated kse.
- Remove the PRI_IDLE special case from sched_clock(), it was not actually
necessary.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/sched_ule.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 614bf73..a41d712 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -789,10 +789,10 @@ sched_prio(struct thread *td, u_char prio) * queue. We still call adjustrunqueue below in case kse * needs to fix things up. */ - if ((td->td_ksegrp->kg_pri_class == PRI_TIMESHARE && + if (ke && ((td->td_ksegrp->kg_pri_class == PRI_TIMESHARE && prio < td->td_ksegrp->kg_user_pri) || (td->td_ksegrp->kg_pri_class == PRI_IDLE && - prio < PRI_MIN_IDLE)) { + prio < PRI_MIN_IDLE))) { runq_remove(ke->ke_runq, ke); ke->ke_runq = KSEQ_CPU(ke->ke_cpu)->ksq_curr; runq_add(ke->ke_runq, ke); @@ -1075,14 +1075,6 @@ sched_clock(struct thread *td) CTR4(KTR_ULE, "Tick kse %p (slice: %d, slptime: %d, runtime: %d)", ke, ke->ke_slice, kg->kg_slptime >> 10, kg->kg_runtime >> 10); - - /* - * Idle tasks should always resched. - */ - if (kg->kg_pri_class == PRI_IDLE) { - td->td_flags |= TDF_NEEDRESCHED; - return; - } /* * We only do slicing code for TIMESHARE ksegrps. */ |