From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 16 02:40:09 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4535106564A for ; Thu, 16 Aug 2012 02:40:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BF86A8FC08 for ; Thu, 16 Aug 2012 02:40:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7G2e9Fm045961 for ; Thu, 16 Aug 2012 02:40:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7G2e9Uo045960; Thu, 16 Aug 2012 02:40:09 GMT (envelope-from gnats) Date: Thu, 16 Aug 2012 02:40:09 GMT Message-Id: <201208160240.q7G2e9Uo045960@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/156481: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2012 02:40:09 -0000 The following reply was made to PR kern/156481; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/156481: commit references a PR Date: Thu, 16 Aug 2012 02:35:54 +0000 (UTC) Author: imp Date: Thu Aug 16 02:35:44 2012 New Revision: 239320 URL: http://svn.freebsd.org/changeset/base/239320 Log: Limit popcorn limit to something sane (either 2ns or 2 ticks if that's longer). PR: 156481 Submitted by: Ian Lepore Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Thu Aug 16 00:53:23 2012 (r239319) +++ head/sys/kern/kern_ntptime.c Thu Aug 16 02:35:44 2012 (r239320) @@ -832,8 +832,15 @@ hardpps(tsp, nsec) * discarded. otherwise, if so enabled, the time offset is * updated. We can tolerate a modest loss of data here without * much degrading time accuracy. - */ - if (u_nsec > (pps_jitter << PPS_POPCORN)) { + * + * The measurements being checked here were made with the system + * timecounter, so the popcorn threshold is not allowed to fall below + * the number of nanoseconds in two ticks of the timecounter. For a + * timecounter running faster than 1 GHz the lower bound is 2ns, just + * to avoid a nonsensical threshold of zero. + */ + if (u_nsec > lmax(pps_jitter << PPS_POPCORN, + 2 * (NANOSECOND / (long)qmin(NANOSECOND, tc_getfrequency())))) { time_status |= STA_PPSJITTER; pps_jitcnt++; } else if (time_status & STA_PPSTIME) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"