From owner-freebsd-arch@FreeBSD.ORG Mon Sep 20 18:41:53 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67B2316A4F4 for ; Mon, 20 Sep 2004 18:41:53 +0000 (GMT) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32A0043D2D for ; Mon, 20 Sep 2004 18:41:53 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 21149 invoked from network); 20 Sep 2004 18:41:53 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 20 Sep 2004 18:41:52 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i8KIfXOD024733; Mon, 20 Sep 2004 14:41:49 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Stephan Uphoff Date: Mon, 20 Sep 2004 14:42:04 -0400 User-Agent: KMail/1.6.2 References: <1095468747.31297.241.camel@palm.tree.com> <200409181653.35242.jhb@FreeBSD.org> <1095548914.43781.27.camel@palm.tree.com> In-Reply-To: <1095548914.43781.27.camel@palm.tree.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409201442.04525.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Julian Elischer cc: "freebsd-arch@freebsd.org" Subject: Re: scheduler (sched_4bsd) questions X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2004 18:41:53 -0000 On Saturday 18 September 2004 07:08 pm, Stephan Uphoff wrote: > On Sat, 2004-09-18 at 16:53, John Baldwin wrote: > > On Saturday 18 September 2004 01:42 pm, Stephan Uphoff wrote: > > > On Fri, 2004-09-17 at 21:20, Julian Elischer wrote: > > > > Stephan Uphoff wrote: > > > > >If this is true kernel threads can be preempted while holding > > > > >for example the root vnode lock (or other important kernel > > > > >resources) while not getting a chance to run until there are no more > > > > >user processes with better priority. > > > > > > > > This is also true, though it is a slightly more complicated thing > > > > than that. > > > > Preempting threads are usually interrupt threads and are thus usually > > > > short lived,. > > > > > > But interrupt threads often wake up other threads ... > > > > That are lower priority and thus won't be preempted to. Instead, they > > run when the interrupt thread goes back to sleep after it finishes. > > Lower priority than the interrupt threads. > They can however have a priority better than the interrupted thread > holding the kernel resource. > In this case the newly awoken threads will be next to run. > If they are compute bound in user space or wake other threads with > better priorities it might take a while until the system switches back > to the interrupted thread. Yes, but that is what the system is supposed to do. If you want the interrupted thread to run sooner because it holds a resource, then you need to adjust its priority when it holds the resource somehow. We do this with mutexes by having a blocking thread lend its priority to the owner of the mutex. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org