From owner-freebsd-bugs Wed Mar 10 12:49: 3 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 8C6D315222 for ; Wed, 10 Mar 1999 12:48:57 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id HAA24787; Thu, 11 Mar 1999 07:48:33 +1100 Date: Thu, 11 Mar 1999 07:48:33 +1100 From: Bruce Evans Message-Id: <199903102048.HAA24787@godzilla.zeta.org.au> To: amagai@nue.org, tobez@plab.ku.dk Subject: Re: kern/10402: times(3) non-decreaseness broken in 4.0 Cc: freebsd-bugs@FreeBSD.ORG Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >> Subject: Re: kern/10402: times(3) non-decreaseness broken in 4.0 >> Date: Wed, 10 Mar 1999 17:23:11 +0900 (JST) >> >> Dear, I have a same problem. CPU consumption time is decreased occasionally. >> Environment: FreeBSD 2.2.8-RELEASE, FreeBSD 3.1-RELEASE >Why it happens I don't know. The only seems-to-be-relevant piece of >code that changed in comparison to 3.1 is the global removal of >p_switchtime. calcru() in /usr/src/sys/kern/kern_resource.c uses now >switchtime instead. > >Probably this: > > /usr/src/sys/sys/proc.h > 1.72 Sun Feb 28 10:53:29 1999 UTC by bde > >is somehow related to the problem. Oops. The switchtime changes broke accounting for the current timeslice whenever calcru() is called. Your example loops calling getrusage() which calls calcru(), so its user+sys time is accounted as almost 0. This made "non-decreaseness" more obvious as a side effect. I will commit fixes for both problems tomorrow. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message