- Restore historical sched_yield() behavior by changing sched_relinquish()

to simply switch rather than lowering priority and switching.  This allows
   threads of equal priority to run but not lesser priority.

Discussed with:	davidxu
Reported by:	NIIMI Satoshi <sa2c@sa2c.net>
Approved by:	re
This commit is contained in:
Jeff Roberson 2007-10-08 23:45:24 +00:00
parent 40a940af86
commit 05dc0eb204
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=172483
3 changed files with 2 additions and 5 deletions

View File

@ -241,7 +241,8 @@ int
sched_yield(struct thread *td, struct sched_yield_args *uap)
{
return (ksched_yield(ksched));
sched_relinquish(curthread);
return 0;
}
int

View File

@ -1324,8 +1324,6 @@ void
sched_relinquish(struct thread *td)
{
thread_lock(td);
if (td->td_pri_class == PRI_TIMESHARE)
sched_prio(td, PRI_MAX_TIMESHARE);
SCHED_STAT_INC(switch_relinquish);
mi_switch(SW_VOL, NULL);
thread_unlock(td);

View File

@ -2540,8 +2540,6 @@ void
sched_relinquish(struct thread *td)
{
thread_lock(td);
if (td->td_pri_class == PRI_TIMESHARE)
sched_prio(td, PRI_MAX_TIMESHARE);
SCHED_STAT_INC(switch_relinquish);
mi_switch(SW_VOL, NULL);
thread_unlock(td);