From owner-freebsd-bugs@FreeBSD.ORG Wed Feb 2 10:00:44 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 715F216A4CE for ; Wed, 2 Feb 2005 10:00:44 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5084043D45 for ; Wed, 2 Feb 2005 10:00:44 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j12A0iCM041131 for ; Wed, 2 Feb 2005 10:00:44 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j12A0hZM041130; Wed, 2 Feb 2005 10:00:43 GMT (envelope-from gnats) Date: Wed, 2 Feb 2005 10:00:43 GMT Message-Id: <200502021000.j12A0hZM041130@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Evans Subject: Re: kern/17842: Erratic user time reports for long running processes X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2005 10:00:44 -0000 The following reply was made to PR kern/17842; it has been noted by GNATS. From: Bruce Evans To: Kees Hendrikse Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: kern/17842: Erratic user time reports for long running processes Date: Wed, 2 Feb 2005 20:56:50 +1100 (EST) On Wed, 26 Apr 2000, Bruce Evans meant to Cc this to freebsd-gnats-submit but only Cced it to freebsd-bugs: [The submitter of the PR wrote:] > > What baffles me most: why stop counting at 379265,687860 seconds? > > The multiplication in "uu = (tu * ut) / tt;" in kern_resource.c > overflows near there. Here tu is the total time in usec, ut is the > user tick count and tt is the total tick count. If all ticks are user > ticks, then overflow occurs for tu = sqrt(2^64 / 10^6 / hz) = 429496 > seconds when hz = 100. Normally there are some interrupt and system > ticks, so overflow occurs for a somewhat larger tu and a somewhat > smaller ut -- apparently about 379 / 429 times smaller in your case. > > 4.0 enforces monotonicity of the resource times, so truncated values > resulting from the overflow don't cause the resource times to stick ^^^^^ oops, delete "don't" here > at the first value where overflow occurs. > > Bruce The factor of 379 / 429 was because I got hz and stathz mixed up. sqrt(2^64 / 10^6 / 128) is 379265.06... See PR 76972 for more details, except about the stickyness of the value. The value might not stick at the first overflowed value -- overflow just gives garbage values, and monotonicity limits the jitter caused by the garbage. Bruce