Date: Wed, 1 Mar 2006 18:58:51 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92614 for review Message-ID: <200603011858.k21Iwpi3058223@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92614 Change 92614 by jhb@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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603011858.k21Iwpi3058223>