From owner-svn-src-head@FreeBSD.ORG Fri Dec 2 20:08:17 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 AD643106566C; Fri, 2 Dec 2011 20:08:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 853A68FC0A; Fri, 2 Dec 2011 20:08:17 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 1ECA546B06; Fri, 2 Dec 2011 15:08:17 -0500 (EST) Received: from John-Baldwins-MacBook-Air.local (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7E77CB915; Fri, 2 Dec 2011 15:08:16 -0500 (EST) Message-ID: <4ED93030.6000203@FreeBSD.org> Date: Fri, 02 Dec 2011 15:08:16 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112021959.pB2Jxka6006739@svn.freebsd.org> In-Reply-To: <201112021959.pB2Jxka6006739@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 02 Dec 2011 15:08:16 -0500 (EST) Cc: Subject: Re: 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 20:08:17 -0000 On 12/2/11 2:59 PM, John Baldwin wrote: > 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. An example that this fixes is suppose you have a CPU bound thread running on an dedicated CPU with rtprio and now want to run another quick thread on that CPU. The quick thread doesn't have rtprio and won't get a chance to run (by design). You want to fix this though so you lower the CPU bound thread to a lower rtprio and set the quick thread to rtprio 0. Without this fix the quick thread still won't get to run as the rtprio 0 will never take effect until the thread returns from userland. With this change it will now take effect immediately so the quick thread will preempt the CPU bound one. You can test this by scheduling two CPU bound rtprio threads on a single CPU (I used jot ${BIGNUM} >/dev/null) and frob the two processes relative realtime priorities. Before whatever jot started running first would never be preempted by the second jot, even if the second jot was assigned a higher RT priority. Now the the jot process with the highest RT priority always runs. -- John Baldwin