From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 24 15:47:42 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B947916A4DD for ; Mon, 24 Jul 2006 15:47:42 +0000 (UTC) (envelope-from scheidell@secnap.net) Received: from mail.secnap.com (mail.secnap.com [204.89.241.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FDF543D45 for ; Mon, 24 Jul 2006 15:47:42 +0000 (GMT) (envelope-from scheidell@secnap.net) Received: from [10.70.3.3] (unknown [10.70.3.3]) by mail.secnap.com (Postfix) with ESMTP id 8E980164838 for ; Mon, 24 Jul 2006 11:47:41 -0400 (EDT) Message-ID: <44C4EB9D.1060106@secnap.net> Date: Mon, 24 Jul 2006 11:47:41 -0400 From: Michael Scheidell Organization: SECNAP Network Security User-Agent: Thunderbird 1.5.0.4 (Macintosh/20060530) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: FBSD 5.5 and software timers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2006 15:47:42 -0000 I had a 200ms software timer running in FBSD 5.4 that isn't working in 5.5 now. This software timer was resetting a 1 second hardware watchdog timer. Every 200ms, I sent a reset to the hardware WDT. Everything worked on 5.4, but I am getting failures on 5.5 It appears that something changed in ntpd, clock_gettime, or nanosleep. I can 'fix' it by specifying -x in ntpd (slew even if large change), but after a day, time is off by more than 5 mins. I think all I did was upgrade from 5.4 to 5.5 It fails within 1 second of getting these types of log entries: Jul 23 15:03:42 audit18 ntpd[473]: time reset -2.497234 s Jul 23 16:03:56 audit18 ntpd[473]: time reset +1.532401 s if -2.49, and we were inside of the nanosleep() and I was expecting a 200ms sleep, I get 2600ms. (yes, I think I do. the 1 second hardware timer on the WDT triggers if not reset every 1000ms (1 second)) if +1.53, I have to do some hard thinking since my nanosleep() APPEARS to have happened in -1330 ms. Oh, did I mention, this worked on 5.4? and if a prevent the 'time reset' log entries by adding the -x switch to ntpd I don't get failures? (except that the clock drifts about 2 seconds per hour!) Also, 5.4 also showed alternating -2 and +2 second time resets, about once an hour, but it didn't seem to affect nanosleep(). ntpd using strata 2 ntp server, with 2 other backups. ntpdc -c peers shows drift when using -x option. (no different then 5.4 did) -- Michael Scheidell, CTO SECNAP Network Security / www.secnap.com scheidell@secnap.net / 1+561-999-5000, x 1131