Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jan 2003 19:37:27 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Jeff Roberson <jroberson@chesapeake.net>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, Steve Kargl <sgk@troutmask.apl.washington.edu>, Robert Watson <rwatson@FreeBSD.ORG>, Gary Jennejohn <garyj@jennejohn.org>, arch@FreeBSD.ORG
Subject:   Re: New scheduler (#3)
Message-ID:  <Pine.BSF.4.21.0301251920520.89171-100000@InterJet.elischer.org>
In-Reply-To: <20030125220657.N18109-100000@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0301251920520.89171-100000>