svn commit: r229619 - stable/9/sys/kern
John Baldwin
jhb at FreeBSD.org
Thu Jan 5 18:55:59 UTC 2012
Author: jhb
Date: Thu Jan 5 18:55:59 2012
New Revision: 229619
URL: http://svn.freebsd.org/changeset/base/229619
Log:
MFC 228207:
When changing the user priority of a thread, change the real priority
in addition to the user priority for threads whose current real priority
is equal to the previous user priority or if the new priority is a
real-time priority. This allows priority changes of other threads to
have an immediate effect.
Modified:
stable/9/sys/kern/kern_resource.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/amd64/include/xen/ (props changed)
stable/9/sys/boot/ (props changed)
stable/9/sys/boot/i386/efi/ (props changed)
stable/9/sys/boot/ia64/efi/ (props changed)
stable/9/sys/boot/ia64/ski/ (props changed)
stable/9/sys/boot/powerpc/boot1.chrp/ (props changed)
stable/9/sys/boot/powerpc/ofw/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
stable/9/sys/conf/ (props changed)
stable/9/sys/contrib/dev/acpica/ (props changed)
stable/9/sys/contrib/octeon-sdk/ (props changed)
stable/9/sys/contrib/pf/ (props changed)
stable/9/sys/contrib/x86emu/ (props changed)
Modified: stable/9/sys/kern/kern_resource.c
==============================================================================
--- stable/9/sys/kern/kern_resource.c Thu Jan 5 18:50:37 2012 (r229618)
+++ stable/9/sys/kern/kern_resource.c Thu Jan 5 18:55:59 2012 (r229619)
@@ -488,8 +488,9 @@ rtp_to_pri(struct rtprio *rtp, struct th
sched_class(td, rtp->type); /* XXX fix */
oldpri = td->td_user_pri;
sched_user_prio(td, newpri);
- if (curthread == td)
- sched_prio(curthread, td->td_user_pri); /* XXX dubious */
+ if (td->td_user_pri != oldpri && (td == curthread ||
+ td->td_priority == oldpri || td->td_user_pri >= PRI_MAX_REALTIME))
+ sched_prio(td, td->td_user_pri);
if (TD_ON_UPILOCK(td) && oldpri != newpri) {
critical_enter();
thread_unlock(td);
More information about the svn-src-stable-9
mailing list