diff options
author | jhb <jhb@FreeBSD.org> | 2011-01-06 22:19:15 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-01-06 22:19:15 +0000 |
commit | 13ffed6f87677b4fbfe9b4c0a700500ce67db7c7 (patch) | |
tree | e8656cb8c47590cc55f916ad5fce39dfe31d3001 /sys/kern/kern_synch.c | |
parent | 3a7fd5f8c7bf1c040291ae6d1a90a9a7c363a513 (diff) | |
download | FreeBSD-src-13ffed6f87677b4fbfe9b4c0a700500ce67db7c7.zip FreeBSD-src-13ffed6f87677b4fbfe9b4c0a700500ce67db7c7.tar.gz |
Only change the priority of timeshare threads to PRI_MAX_TIMESHARE
when yield() is called. Specifically, leave the priority of real time
and idle threads unchanged.
MFC after: 2 weeks
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 30a8bb3..ddc2186 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -546,7 +546,8 @@ yield(struct thread *td, struct yield_args *uap) { thread_lock(td); - sched_prio(td, PRI_MAX_TIMESHARE); + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) + sched_prio(td, PRI_MAX_TIMESHARE); mi_switch(SW_VOL | SWT_RELINQUISH, NULL); thread_unlock(td); td->td_retval[0] = 0; |