From owner-freebsd-arch@FreeBSD.ORG Sun Sep 19 07:10:38 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 C9ACA16A4CE; Sun, 19 Sep 2004 07:10:38 +0000 (GMT) Received: from ylpvm29.prodigy.net (ylpvm29-ext.prodigy.net [207.115.57.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85C3343D39; Sun, 19 Sep 2004 07:10:38 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-68-120-130-250.dsl.snfc21.pacbell.net [68.120.130.250])i8J7ANIV018090; Sun, 19 Sep 2004 03:10:23 -0400 Message-ID: <414D30EC.1000104@elischer.org> Date: Sun, 19 Sep 2004 00:10:36 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: John Baldwin References: <1095468747.31297.241.camel@palm.tree.com> <414B8D5E.7000700@elischer.org> <1095529353.31297.1192.camel@palm.tree.com> <200409181653.35242.jhb@FreeBSD.org> In-Reply-To: <200409181653.35242.jhb@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Stephan Uphoff 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: Sun, 19 Sep 2004 07:10:38 -0000 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. though that may still be before the original preempted thread gets run.. that reminds me.. John, we should add a flag to setrunqueue to add a preempted thread back at the FRONT of it's runqueue.. So that it gets a chance to use the rest of its slot.. the alternative is to keep a special "stack" (per cpu) of preempted threads so that we come back to the thread that we preempted.