From owner-freebsd-arch Sun Jan 26 11:20:28 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 13C4437B401; Sun, 26 Jan 2003 11:20:27 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id A99B043F13; Sun, 26 Jan 2003 11:20:26 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.6/8.12.6) with ESMTP id h0QJKO0i051947; Sun, 26 Jan 2003 11:20:24 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.6/8.12.6/Submit) id h0QJKOBB051946; Sun, 26 Jan 2003 11:20:24 -0800 (PST) Date: Sun, 26 Jan 2003 11:20:24 -0800 (PST) From: Matthew Dillon Message-Id: <200301261920.h0QJKOBB051946@apollo.backplane.com> To: Jeff Roberson , Steve Kargl , Robert Watson , Gary Jennejohn , Subject: Re: New scheduler - Interactivity fixes References: <20030126035429.A64928-100000@mail.chesapeake.net> <200301261913.h0QJDd8c051876@apollo.backplane.com> 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 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