From nobody@FreeBSD.org  Tue Mar  7 08:18:00 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DF8FA16A420
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Mar 2006 08:17:59 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A72DE43D49
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Mar 2006 08:17:59 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k278Hxmx009904
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 7 Mar 2006 08:17:59 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k278HxvH009903;
	Tue, 7 Mar 2006 08:17:59 GMT
	(envelope-from nobody)
Message-Id: <200603070817.k278HxvH009903@www.freebsd.org>
Date: Tue, 7 Mar 2006 08:17:59 GMT
From: Richard Wiwatowski <rjwiwat@internode.on.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Clock running very fast on SMP RELENG_4
X-Send-Pr-Version: www-2.3

>Number:         94160
>Category:       kern
>Synopsis:       [ntpd] Clock running very fast on SMP RELENG_4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 07 08:20:08 GMT 2006
>Closed-Date:    Thu Mar 09 16:23:46 GMT 2006
>Last-Modified:  Thu Mar 09 16:23:46 GMT 2006
>Originator:     Richard Wiwatowski
>Release:        FreeBSD 4-STABLE
>Organization:
>Environment:
FreeBSD gateway.betalogic.com.au 4.11-STABLE FreeBSD 4.11-STABLE #0: Sun Feb 26 15:35:49 CST 2006     root@gateway.betalogic.com.au:/usr/src/sys/compile/GATEWAY  i386

>Description:
System time on my SMP FreeBSD 4.11-STABLE machine is running about 4 times as fast as it should. I also have two other uni-processor systems running the same version: one keeps time using ntpd with a local stratum 2 time source and all other machines on my internal network synchronise to that one (newton) using timed. Today I noticed this on the 2-processor gateway box:

Mar  7 10:56:24 gateway timed[1879]: slave to newton.betalogic.com.au
Mar  7 10:57:16 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 10:56:2
4 2006
Mar  7 11:00:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:04:0
9 2006
Mar  7 11:04:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:08:4
2 2006
Mar  7 11:08:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:12:4
2 2006
Mar  7 11:12:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:16:4
2 2006
Mar  7 11:16:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:20:4
3 2006
Mar  7 11:20:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:24:4
3 2006
Mar  7 11:24:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:28:4
2 2006
Mar  7 11:28:43 gateway timed[1879]: date changed by newton.betalogic.com.au from Tue Mar  7 11:32:4
3 2006

Seems like the clock is running so fast that timed can't keep it in synch!!

I update my CVS repo once a week these days on Sundays and re-build the whole system on several machines. This is the relevant list of files updated last Sunday:

U src/etc/MAKEDEV
U src/sbin/sconfig/sconfig.c
U src/share/man/man4/man4.i386/Makefile
U src/share/man/man4/man4.i386/ce.4
? src/sys/compile/GATEWAY
U src/sys/conf/files.i386
U src/sys/conf/files.pc98
U src/sys/conf/majors
U src/sys/dev/ce/ceddk.c
U src/sys/dev/ce/ceddk.h
U src/sys/dev/ce/if_ce.c
U src/sys/dev/ce/ng_ce.h
U src/sys/dev/ce/tau32-ddk.c
U src/sys/dev/ce/tau32-ddk.h
U src/sys/dev/usb/usb.c
U src/sys/i386/conf/LINT
U src/sys/i386/i386/mpapic.c
U src/sys/i386/include/cserial.h
U src/sys/modules/ce/Makefile
U src/sys/nfs/nfs_socket.c

I strongly suspect "src/sys/i386/i386/mpapic.c" that was updated like this:

From: John Baldwin <jhb@FreeBSD.org>
Date: Wed, 1 Mar 2006 16:26:51 +0000 (UTC)
X-FreeBSD-CVS-Branch: RELENG_4
Subject: cvs commit: src/sys/i386/i386 mpapic.c

jhb         2006-03-01 16:26:51 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_4)
    sys/i386/i386        mpapic.c 
  Log:
  Use the fixed delivery mode rather than low priority for I/O APIC
  interrupts since low priority delivery mode can only be used logical
  destinations and 4.x and earlier always use only physical destinations.
  
  Revision  Changes    Path
  1.37.2.8  +3 -3      src/sys/i386/i386/mpapic.c

>How-To-Repeat:

>Fix:
Back out the modification? kernel.old doesn't exhibit this problem.

>Release-Note:
>Audit-Trail:

From: Kris Kennaway <kris@obsecurity.org>
To: Richard Wiwatowski <rjwiwat@internode.on.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/94160: Clock running very fast on SMP RELENG_4
Date: Tue, 7 Mar 2006 15:40:10 -0500

 On Tue, Mar 07, 2006 at 08:17:59AM +0000, Richard Wiwatowski wrote:
 
 > System time on my SMP FreeBSD 4.11-STABLE machine is running about 4
 > times as fast as it should. I also have two other uni-processor
 > systems running the same version: one keeps time using ntpd with a
 > local stratum 2 time source and all other machines on my internal
 > network synchronise to that one (newton) using timed. Today I
 > noticed this on the 2-processor gateway box:
 
 4.x is no longer being supported so this problem is unlikely to ever
 be fixed in RELENG_5.  Does the problem persist with 6.x?
 
 Kris

From: "R. J. Wiwatowski" <rjwiwat@internode.on.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/94160: [ntpd] Clock running very fast on SMP RELENG_4
Date: Thu, 09 Mar 2006 11:02:03 +1030

 I reverted src/sys/i386/i386/mpapic.c back to version 1.37.2.7, built a
 new kernel and tested it. The problem disappeared. I verified this on
 two of my own SMP machines and it has been confirmed by another
 independent tester.
 
 I suggest that the changes made in version 1.37.2.8 are a bad idea and
 the modifications should be backed out.
 
 Regards,
 
 Richard
 
 

From: John Baldwin <jhb@freebsd.org>
To: bug-followup@freebsd.org, rjwiwat@internode.on.net
Cc:  
Subject: Re: kern/94160: [ntpd] Clock running very fast on SMP RELENG_4
Date: Thu, 9 Mar 2006 11:19:22 -0500

 Unfortunately, Intel engineers insist that the previous code was buggy.
 I'll revert them though since trying to come up with a more complete
 patch would be a lot of effort.
 
 -- 
 John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
 "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Thu Mar 9 16:23:31 UTC 2006 
State-Changed-Why:  
Change reverted. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94160 
>Unformatted:
