From 6942d4339e3060ab833571c46b72f1ff9c14f82e Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 13 Jul 2004 20:49:13 +0000 Subject: [PATCH] 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 --- sys/kern/sched_4bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index b2ae3dd123a5..2a51bc04d864 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