From owner-freebsd-hackers Thu Oct 18 8: 6: 3 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from femail6.sdc1.sfba.home.com (femail6.sdc1.sfba.home.com [24.0.95.86]) by hub.freebsd.org (Postfix) with ESMTP id 0952737B405 for ; Thu, 18 Oct 2001 08:06:01 -0700 (PDT) Received: from laptop.baldwin.cx ([24.2.39.156]) by femail6.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20011018150600.ZCDM28629.femail6.sdc1.sfba.home.com@laptop.baldwin.cx>; Thu, 18 Oct 2001 08:06:00 -0700 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011018143414.C2064@zerogravity.kawo2.rwth-aachen.de> Date: Thu, 18 Oct 2001 08:05:59 -0700 (PDT) From: John Baldwin To: Alexander Langer Subject: Re: Possible bug in scheduler. Cc: freebsd-hackers@FreeBSD.ORG, sashkin@home.com Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 18-Oct-01 Alexander Langer wrote: > Thus spake Alex Levine (sashkin@asplinux.ru): > >> resetpriority() calls maybe_resched() at the end after updating p_usrpri >> based on changed p_estcpu. >> maybe_resched() uses curpriority_cmp to compare priorities of current >> and given process and this function ( curpriority_cmp ) uses p_priority >> which is unchanged yet - the new p_usrpri is not reflected to p_priority >> yet. > > In -CURRENT, it's more obvious: > maybe_resched() only rescheds, if the resetted process' priority > level changes. > > Since resetpriority() doesn't modify the priority level but > only the user priority, the call to maybe_resched() has no > effect at all -- only some overhead for the comparisons > (curproc will have had the higher or same priority level > as the resetted process anyways, otherwise it hadn't been curproc :) > > So, either > - p's priority level in resetpriority has to be re-calculted > as well, or > - the call to maybe_resched() can be removed w/o loss > of functionality. or c) in the preemptive kernel maybe_resched() doesn't exist as it's functionality is more properly handled in other places. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message