Date: Sun, 26 Jan 2003 11:20:24 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Jeff Roberson <jroberson@chesapeake.net>, Steve Kargl <sgk@troutmask.apl.washington.edu>, Robert Watson <rwatson@FreeBSD.ORG>, Gary Jennejohn <garyj@jennejohn.org>, <arch@FreeBSD.ORG> Subject: Re: New scheduler - Interactivity fixes Message-ID: <200301261920.h0QJKOBB051946@apollo.backplane.com> References: <20030126035429.A64928-100000@mail.chesapeake.net> <200301261913.h0QJDd8c051876@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Oops, a few mistakes with my pseudo-code. Corrected below (ok, it IS only
pseudo code but still...). (note also: GlobalAgg could also be a
per-cpu Agg).
sched_clock()
{
task->slice -= GlobalAgg + task->priority; <<< must include task's
if (task->slice < 0) own priority here.
involuntary_switch();
}
sched_choose()
{
while ((task = RemoveHead(queue)) != NULL) {
if (task->slice >= 0) {
GlobalAgg -= task->priority; <<<< task removed from queue
break;
}
task->slice += task->priority * NOMINAL_TICKS; (usually 4)
AddTail(queue, task);
}
return(task);
}
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?200301261920.h0QJKOBB051946>
