From owner-freebsd-stable Wed Nov 11 08:02:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA00313 for freebsd-stable-outgoing; Wed, 11 Nov 1998 08:02:58 -0800 (PST) (envelope-from owner-freebsd-stable@FreeBSD.ORG) Received: from obie.softweyr.com ([204.68.178.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA00305 for ; Wed, 11 Nov 1998 08:02:54 -0800 (PST) (envelope-from wes@softweyr.com) Received: from softweyr.com (wes@zaphod.softweyr.com [204.68.178.35]) by obie.softweyr.com (8.8.8/8.8.8) with ESMTP id JAA19516; Wed, 11 Nov 1998 09:01:16 -0700 (MST) (envelope-from wes@softweyr.com) Message-ID: <3649B4CC.ACF9587E@softweyr.com> Date: Wed, 11 Nov 1998 09:01:16 -0700 From: Wes Peters Organization: Softweyr llc X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.6-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Rasmus Kaj CC: max@vega.pfts.com, freebsd-stable@FreeBSD.ORG Subject: Re: calcru: negative time of -71345076 usec for pid 23891 (make) References: <36440E77.3758284D@vega.pfts.com> <19981111004246Z.kaj@interbizz.se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Rasmus Kaj wrote: > > >>>>> "MS" == Maxim Sobolev writes: > > MS> Does anybody know what does this mysterious message means? > > MS> calcru: negative time of -71345076 usec for pid 23891 (make) > > Since I haven't seen an explanatory answer to this, let me throw in a > guess (so there is at lest a try for an answer) ... "Use the Source, Luke!" wes@zaphod$ cd /usr/src/sys wes@zaphod$ find . -name '*.c' -print | xargs grep "negative time" ./kern/kern_clock.c: printf("hzto: negative time difference %ld sec %ld usec\n", ./kern/kern_resource.c: printf("calcru: negative time: %ld usec\n", (long)totusec); wes@zaphod$ vi kern/kern_resource.c /* * Transform the running time and tick information in proc p into user, * system, and interrupt time usage. */ void calcru(p, up, sp, ip) ... if (p == curproc) { /* * Adjust for the current time slice. This is actually fairly * important since the error here is on the order of a time * quantum, which is much greater than the sampling error. */ microtime(&tv); sec += tv.tv_sec - runtime.tv_sec; usec += tv.tv_usec - runtime.tv_usec; } totusec = (quad_t)sec * 1000000 + usec; if (totusec < 0) { /* XXX no %qd in kernel. Truncate. */ printf("calcru: negative time: %ld usec\n", (long)totusec); totusec = 0; } ... So, it looks like your process has been charged negative time during this accounting interval. I've not studied the code to determine exactly *why* this happens, or what it means, but it seems to be relatively harmless. It started happening on my 486/66 server box around 2.2.5 release. I suspect there may be a buglet in there somewhere, but it seems harmless so I just avoid using ttyv0. ;^) -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.softweyr.com/~softweyr wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message