diff options
author | jhb <jhb@FreeBSD.org> | 2004-07-13 20:49:13 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2004-07-13 20:49:13 +0000 |
commit | 4a50f485c4356df4ca2c7b2684af05c53c8c7e5c (patch) | |
tree | 6ede2aa646e9671635fe201d061b8a5dee4d9219 | |
parent | b0e68741889ab66096103a2dec2219bbde3c21c6 (diff) | |
download | FreeBSD-src-4a50f485c4356df4ca2c7b2684af05c53c8c7e5c.zip FreeBSD-src-4a50f485c4356df4ca2c7b2684af05c53c8c7e5c.tar.gz |
Set TDF_NEEDRESCHED when a higher priority thread is scheduled in
sched_add() rather than just doing it in sched_wakeup(). The old
ithread preemption code used to set NEEDRESCHED unconditionally if it
didn't preempt which masked this bug in SCHED_4BSD.
Noticed by: jake
Reported by: kensmith, marcel
-rw-r--r-- | sys/kern/sched_4bsd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index b2ae3dd..2a51bc0 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -694,7 +694,6 @@ sched_wakeup(struct thread *td) updatepri(kg); kg->kg_slptime = 0; setrunqueue(td); - maybe_resched(td); } void @@ -740,6 +739,7 @@ sched_add(struct thread *td) if ((td->td_proc->p_flag & P_NOLOAD) == 0) sched_tdcnt++; runq_add(ke->ke_runq, ke); + maybe_resched(td); } void |