From owner-freebsd-arch Sat Jan 25 19:37:34 2003 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 66FDB37B401; Sat, 25 Jan 2003 19:37:32 -0800 (PST) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5D4243E4A; Sat, 25 Jan 2003 19:37:31 -0800 (PST) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc02.attbi.com (sccrmhc02) with ESMTP id <2003012603373000200bi70le>; Sun, 26 Jan 2003 03:37:30 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id TAA90751; Sat, 25 Jan 2003 19:37:28 -0800 (PST) Date: Sat, 25 Jan 2003 19:37:27 -0800 (PST) From: Julian Elischer To: Jeff Roberson Cc: Matthew Dillon , Steve Kargl , Robert Watson , Gary Jennejohn , arch@FreeBSD.ORG Subject: Re: New scheduler (#3) In-Reply-To: <20030125220657.N18109-100000@mail.chesapeake.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 25 Jan 2003, Jeff Roberson wrote: > On Sat, 25 Jan 2003, Matthew Dillon wrote: > > > Found another bug. In sched_sleep() you set td_slptime to ticks > > in order to calculate the time slept in sched_wakeup(). > > > > You have to do the same thing in sched_switchout() (or move it to > > sched_switchout()?), because not all kernel subsystems use msleep(). > > For example, select() does it manually and uses mi_switch(), which > > means that sched_sleep() is never called. (select() uses condvars which > > use mi_switch(). The wakeup portion in the condvar code will use > > sched_wakeup() so no additional changes are required on the wakeup side). > > > I want the sleep time to ONLY reflect voluntary sleep time. Thats why it > was only done in sched_sleep(). It looks like I might have to add it to > either select or the condvar code. I think that perhaps adding it to > condvar would be correct since that is a voluntary sleep. > > Good catch. thanks. Select uses cv_wait() Both jhb and I have been considering passing a parameter to mi_switch() that indicates if the switch was voluntary or not.. in the meanwhile you can do: if (TD_IS_ON_SLEEPQ(td)) in mi_switch (sched_switchout()) to catch both cases.. or just call sched_sleep() from the cv code as it's almost identical to the sleep code.. > > > This could be contributing to why people's X servers are blowing up... > > it's because your scheduler thinks the X server never sleeps so the > > priority remains artifically high even if the X server is mostly idle. > > > > -Matt > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message