From owner-svn-src-head@FreeBSD.ORG Fri Dec 2 19:59:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 638D11065670; Fri, 2 Dec 2011 19:59:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53C828FC15; Fri, 2 Dec 2011 19:59:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB2JxkVL006741; Fri, 2 Dec 2011 19:59:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB2Jxka6006739; Fri, 2 Dec 2011 19:59:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201112021959.pB2Jxka6006739@svn.freebsd.org> From: John Baldwin Date: Fri, 2 Dec 2011 19:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228207 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2011 19:59:46 -0000 Author: jhb Date: Fri Dec 2 19:59:46 2011 New Revision: 228207 URL: http://svn.freebsd.org/changeset/base/228207 Log: 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. MFC after: 2 weeks Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Fri Dec 2 19:56:46 2011 (r228206) +++ head/sys/kern/kern_resource.c Fri Dec 2 19:59:46 2011 (r228207) @@ -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);