PERFORCE change 92614 for review

John Baldwin jhb at FreeBSD.org
Wed Mar 1 10:58:54 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=92614

Change 92614 by jhb at jhb_slimer on 2006/03/01 18:58:13

	Use the previous longer time when time goes backwards.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_resource.c#59 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_resource.c#59 (text+ko) ====

@@ -761,14 +761,19 @@
 	ut = ruxp->rux_uticks;
 	st = ruxp->rux_sticks;
 	it = ruxp->rux_iticks;
-	tu = ruxp->rux_runtime;
-	tu = cputick2usec(tu);
 	tt = ut + st + it;
 	if (tt == 0) {
 		st = 1;
 		tt = 1;
 	}
+	tu = cputick2usec(ruxp->rux_runtime);
 	ptu = ruxp->rux_uu + ruxp->rux_su + ruxp->rux_iu;
+	if (tu < ptu) {
+		printf(
+"calcru: runtime went backwards from %ju usec to %ju usec for pid %d (%s)\n",
+		    (uintmax_t)ptu, (uintmax_t)tu, p->p_pid, p->p_comm);
+		tu = ptu;
+	}
 	if ((int64_t)tu < 0) {
 		printf("calcru: negative runtime of %jd usec for pid %d (%s)\n",
 		    (intmax_t)tu, p->p_pid, p->p_comm);
@@ -779,16 +784,6 @@
 	uu = (tu * ut) / tt;
 	su = (tu * st) / tt;
 	iu = tu - uu - su;
-	if (tu < ptu) {
-		printf(
-"calcru: runtime went backwards from %ju usec to %ju usec for pid %d (%s)\n",
-		    (uintmax_t)ptu, (uintmax_t)tu, p->p_pid, p->p_comm);
-		printf("u %ju:%ju/%ju s %ju:%ju/%ju i %ju:%ju/%ju\n",
-		    (uintmax_t)ut, (uintmax_t)ruxp->rux_uu, uu,
-		    (uintmax_t)st, (uintmax_t)ruxp->rux_su, su,
-		    (uintmax_t)it, (uintmax_t)ruxp->rux_iu, iu);
-		tu = ptu;
-	}
 #if 0
 	/* Enforce monotonicity. */
 	if (uu < ruxp->rux_uu || su < ruxp->rux_su || iu < ruxp->rux_iu) {


More information about the p4-projects mailing list