From owner-svn-src-stable@FreeBSD.ORG Tue Jun 9 15:50:33 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E9511065674; Tue, 9 Jun 2009 15:50:33 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3518FC14; Tue, 9 Jun 2009 15:50:33 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59FoXUU076384; Tue, 9 Jun 2009 15:50:33 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59FoXAv076383; Tue, 9 Jun 2009 15:50:33 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200906091550.n59FoXAv076383@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Jun 2009 15:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193839 - stable/6/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2009 15:50:34 -0000 Author: attilio Date: Tue Jun 9 15:50:33 2009 New Revision: 193839 URL: http://svn.freebsd.org/changeset/base/193839 Log: MFC r156484: Add slop to "backwards" cpu accounting messages, 3 usec or 1% whichever triggers. That will improve the diagnostic with 'time went backwards' messages. Sponsored by: Sandvine Incorporated Modified: stable/6/sys/kern/kern_resource.c Modified: stable/6/sys/kern/kern_resource.c ============================================================================== --- stable/6/sys/kern/kern_resource.c Tue Jun 9 15:20:36 2009 (r193838) +++ stable/6/sys/kern/kern_resource.c Tue Jun 9 15:50:33 2009 (r193839) @@ -773,7 +773,11 @@ calcru1(p, ruxp, up, sp) bintime2timeval(&ruxp->rux_runtime, &tv); tu = (u_int64_t)tv.tv_sec * 1000000 + tv.tv_usec; ptu = ruxp->rux_uu + ruxp->rux_su + ruxp->rux_iu; - if (tu < ptu) { + if (tu + 3 > ptu) { + /* Numeric slop for low counts */ + } else if (101 * tu > 100 * ptu) { + /* 1% slop for large counts */ + } else { 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);