From owner-freebsd-arch Sat Jan 25 19: 9: 3 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 D798A37B401; Sat, 25 Jan 2003 19:09:01 -0800 (PST) Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FC7843F18; Sat, 25 Jan 2003 19:09:01 -0800 (PST) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h0Q38wN92814; Sat, 25 Jan 2003 22:08:58 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Sat, 25 Jan 2003 22:08:58 -0500 (EST) From: Jeff Roberson To: Matthew Dillon Cc: Steve Kargl , Robert Watson , Gary Jennejohn , Subject: Re: New scheduler (#3) In-Reply-To: <200301260114.h0Q1EXuu017546@apollo.backplane.com> Message-ID: <20030125220657.N18109-100000@mail.chesapeake.net> 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, 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. > 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