Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 2003 18:28:00 -0500
From:      Don Bowman <don@sandvine.com>
To:        'Kris Kennaway' <kris@obsecurity.org>, stable@FreeBSD.org
Cc:        phk@freeBSD.org
Subject:   RE: Corrected gettimeofday() test code
Message-ID:  <FE045D4D9F7AED4CBFF1B3B813C85337035E3F6B@mail.sandvine.com>

next in thread | raw e-mail | index | archive | help
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C3B6D0.6DD9F800
Content-Type: text/plain;
	charset="iso-8859-1"

From: Kris Kennaway [mailto:kris@obsecurity.org]
> 
> I forwarded the reports of timecounter problems to phk, and he asked
> that people who are seeing timecounter problems provide FULL details
> of their system configuration, including:
> 
> * dmesg
> 
> * kernel configuration
> 
> * compiler options
> 
> * time-related system configuration (whether ntpd/timed/ntpdate is
> running, and if so whether it's correcting for a seriously drifting
> clock)
> 
> * The kernel timecounter configuration, e.g. the
> kern.timecounter.method and kern.timecounter.hardware sysctls, and
> whether changing them has any effect.
> 
> * The exact output of the corrected test program below (the original
> would give spurious errors if it didn't run at least once a second,
> which may have been confusing some people if their systems were
> sufficiently loaded).
> 
> * The system status when the problem is observed (i.e. does it only
> occur under load; what else is running at the time)
> 

For this config (below), kern.timecounter.method=0 reproduces the
problem, kern.timecounter.method=1 does not.

Output in 'error' case:
1070147643.248866 1070147651.028646 1070147643.248866 1070147651.028646
1070147656.287818 1070147664.067692 1070147656.287818 1070147664.067692
1070147659.326429 1070147667.106238 1070147659.326429 1070147667.106238
1070147668.370071 1070147676.149884 1070147668.370071 1070147676.149884
1070147681.433111 1070147689.212926 1070147681.433111 1070147689.212926
1070147683.418743 1070147691.198632 1070147683.418743 1070147691.198632

problem shows up within ~30s of starting the test program, and the messages
will come out about once per 1-5s period after that, not regularly.

kern.timecounter.hardware: TSC

on this machine, i have others which are i8254 which do it too.

hw.ncpu=1

compiler flags:
COPTFLAGS= -O2 -pipe -malign-loops=4 -malign-jumps=4 -malign-functions=4
-mcpu=i686 -march=i686 -fno-gcse -g



machine is running 4.7-RELEASE-p2.

dmesg, kernel config attached.


Intel-specific functions:
Version 00000673:
Type 0 - Original OEM
Family 6 - Pentium Pro
Model 7 - Pentium III/Pentium III Xeon - external L2 cache
Stepping 3
Reserved 0

from cpuid.

ntpd -p /var/run/ntpd.pid -b -g -A
runs.

Clock does not drift much, less than 2s/day. Clock is 
stepped when system boots. There is a chimer on our router 
which broadcasts ntp time every minute. ntpd is not
observed to step clock.

On the 8254 machine [a dual 0f27 xeon, 533 FSB with HTT enabled]
1070147645.119531 1070148340.497729 1070148339.-693880469 1070148340.497729

both systems were unloaded. This was with the corrected program
you included.

--don


------_=_NextPart_000_01C3B6D0.6DD9F800
Content-Type: application/octet-stream;
	name="dmesg.boot"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="dmesg.boot"

Copyright (c) 1992-2002 The FreeBSD Project.=0A=
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, =
1994=0A=
	The Regents of the University of California. All rights reserved.=0A=
FreeBSD 4.7-RELEASE-p2 #1: 20021212_13:58:28=0A=
=0A=
Timecounter "i8254"  frequency 1193182 Hz=0A=
Timecounter "TSC"  frequency 551252183 Hz=0A=
CPU: Pentium III/Pentium III Xeon/Celeron (551.25-MHz 686-class CPU)=0A=
  Origin =3D "GenuineIntel"  Id =3D 0x673  Stepping =3D 3=0A=
  =
Features=3D0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA=
,CMOV,PAT,PSE36,MMX,FXSR,SSE>=0A=
real memory  =3D 536854528 (524272K bytes)=0A=
avail memory =3D 518111232 (505968K bytes)=0A=
Preloaded elf kernel "kernel" at 0xc042a000.=0A=
Preloaded elf module "if_xl.ko" at 0xc042a09c.=0A=
Preloaded elf module "miibus.ko" at 0xc042a13c.=0A=
netsmb_dev: loaded=0A=
Pentium Pro MTRR support enabled=0A=
md0: Malloc disk=0A=
Using $PIR table, 8 entries at 0xc00f0e70=0A=
npx0: <math processor> on motherboard=0A=
npx0: INT 16 interface=0A=
pcib0: <Intel 82443BX (440 BX) host to PCI bridge> on motherboard=0A=
pci0: <PCI bus> on pcib0=0A=
pcib1: <Intel 82443BX (440 BX) PCI-PCI (AGP) bridge> at device 1.0 on =
pci0=0A=
pci1: <PCI bus> on pcib1=0A=
pci1: <ATI Rage128-RF graphics accelerator> at 0.0 irq 11=0A=
isab0: <Intel 82371AB PCI to ISA bridge> at device 4.0 on pci0=0A=
isa0: <ISA bus> on isab0=0A=
atapci0: <Intel PIIX4 ATA33 controller> port 0xb800-0xb80f at device =
4.1 on pci0=0A=
ata0: at 0x1f0 irq 14 on atapci0=0A=
ata1: at 0x170 irq 15 on atapci0=0A=
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0xb400-0xb41f at =
device 4.2 on pci0=0A=
pci_cfgintr_virgin: using routable interrupt 3=0A=
pci_cfgintr: 0:4 INTD routed to irq 3=0A=
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0=0A=
usb0: USB revision 1.0=0A=
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1=0A=
uhub0: 2 ports with 2 removable, self powered=0A=
intpm0: <Intel 82371AB Power management controller> port 0xe800-0xe80f =
irq 9 at device 4.3 on pci0=0A=
intpm0: I/O mapped e800=0A=
intpm0: intr IRQ 9 enabled revision 0=0A=
smbus0: <System Management Bus> on intsmb0=0A=
smb0: <SMBus general purpose I/O> on smbus0=0A=
intpm0: PM I/O mapped e400 =0A=
xl0: <3Com 3c905B-TX Fast Etherlink XL> port 0xb000-0xb07f mem =
0xde800000-0xde80007f irq 10 at device 11.0 on pci0=0A=
xl0: Ethernet address: 00:01:02:ed:38:00=0A=
miibus0: <MII bus> on xl0=0A=
xlphy0: <3Com internal media interface> on miibus0=0A=
xlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto=0A=
xl1: <3Com 3c905B-TX Fast Etherlink XL> port 0xa800-0xa87f mem =
0xde000000-0xde00007f irq 11 at device 12.0 on pci0=0A=
xl1: Ethernet address: 00:50:04:01:2f:8e=0A=
miibus1: <MII bus> on xl1=0A=
xlphy1: <3Com internal media interface> on miibus1=0A=
xlphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto=0A=
orm0: <Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xc87ff on isa0=0A=
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on =
isa0=0A=
fdc0: FIFO enabled, 8 bytes threshold=0A=
fd0: <1440-KB 3.5" drive> on fdc0 drive 0=0A=
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0=0A=
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0=0A=
kbd0 at atkbd0=0A=
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on =
isa0=0A=
sc0: <System console> at flags 0x100 on isa0=0A=
sc0: VGA <16 virtual consoles, flags=3D0x300>=0A=
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0=0A=
sio0: type 16550A=0A=
sio1: configured irq 3 not in bitmap of probed irqs 0=0A=
sio1 at port 0x2f8-0x2ff irq 3 on isa0=0A=
sio1: type 16550A=0A=
IP packet filtering initialized, divert enabled, rule-based forwarding =
enabled, default to accept, logging disabled=0A=
ad0: 19470MB <IBM-DJNA-352030> [39560/16/63] at ata0-master UDMA33=0A=
acd0: CDROM <MATSHITA CR-589> at ata0-slave PIO4=0A=
Mounting root from ufs:/dev/ad0s1a=0A=

------_=_NextPart_000_01C3B6D0.6DD9F800
Content-Type: text/plain;
	name="kern.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="kern.txt"

___#=0A=
___# GENERIC -- Generic kernel configuration file for FreeBSD/i386=0A=
___#=0A=
___# For more information on this file, please read the handbook =
section on=0A=
___# Kernel Configuration Files:=0A=
___#=0A=
___#    http://www.FreeBSD.org/handbook/kernelconfig-config.html=0A=
___#=0A=
___# The handbook is also available locally in =
/usr/share/doc/handbook=0A=
___# if you've installed the doc distribution, otherwise always see =
the=0A=
___# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the=0A=
___# latest information.=0A=
___#=0A=
___# An exhaustive list of options and more detailed explanations of =
the=0A=
___# device lines is also present in the ./LINT configuration file. If =
you are=0A=
___# in doubt as to the purpose or necessity of a line, check first in =
LINT.=0A=
___#=0A=
___# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.246.2.39 2002/03/24 =
13:19:10 wilko Exp $=0A=
___machine		i386=0A=
___#cpu		I386_CPU=0A=
___#cpu		I486_CPU=0A=
___cpu		I586_CPU=0A=
___cpu		I686_CPU=0A=
___ident		TPC=0A=
___maxusers	0=0A=
___makeoptions	DEBUG=3D-g		#Build kernel with gdb(1) debug symbols=0A=
___#options 	MATH_EMULATE		#Support for x87 emulation=0A=
___options 	INET			#InterNETworking=0A=
___#options 	INET6			#IPv6 communications protocols=0A=
___options 	FFS			#Berkeley Fast Filesystem=0A=
___options 	FFS_ROOT		#FFS usable as root device [keep this!]=0A=
___options 	SOFTUPDATES		#Enable FFS soft updates support=0A=
___options 	UFS_DIRHASH		#Improve performance on big directories=0A=
___options 	MFS			#Memory Filesystem=0A=
___options 	MD_ROOT			#MD is a potential root device=0A=
___options 	NFS			#Network Filesystem=0A=
___options 	NFS_ROOT		#NFS usable as root device, NFS required=0A=
___options 	MSDOSFS			#MSDOS Filesystem=0A=
___options 	CD9660			#ISO 9660 Filesystem=0A=
___options 	CD9660_ROOT		#CD-ROM usable as root, CD9660 required=0A=
___options 	PROCFS			#Process filesystem=0A=
___options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]=0A=
___options 	SCSI_DELAY=3D2000		#Delay (in ms) before probing SCSI=0A=
___options 	UCONSOLE		#Allow users to grab the console=0A=
___options 	USERCONFIG		#boot -c editor=0A=
___options 	VISUAL_USERCONFIG	#visual boot -c editor=0A=
___options 	KTRACE			#ktrace(1) support=0A=
___options 	SYSVSHM			#SYSV-style shared memory=0A=
___options 	SYSVMSG			#SYSV-style message queues=0A=
___options 	SYSVSEM			#SYSV-style semaphores=0A=
___options 	P1003_1B		#Posix P1003_1B real-time extensions=0A=
___options 	_KPOSIX_PRIORITY_SCHEDULING=0A=
___options		ICMP_BANDLIM		#Rate limit bad replies=0A=
___options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev=0A=
___# To make an SMP kernel, the next two are needed=0A=
___#options 	SMP			# Symmetric MultiProcessor Kernel=0A=
___#options 	APIC_IO			# Symmetric (APIC) I/O=0A=
___device		isa=0A=
___device		eisa=0A=
___device		pci=0A=
___# Floppy drives=0A=
___device		fdc0	at isa? port IO_FD1 irq 6 drq 2=0A=
___device		fd0	at fdc0 drive 0=0A=
___device		fd1	at fdc0 drive 1=0A=
___#=0A=
___# ATA and ATAPI devices=0A=
___device		ata0	at isa? port IO_WD1 irq 14=0A=
___device		ata1	at isa? port IO_WD2 irq 15=0A=
___device		ata=0A=
___device		atadisk			# ATA disk drives=0A=
___device		atapicd			# ATAPI CDROM drives=0A=
___device		atapifd			# ATAPI floppy drives=0A=
___device		atapist			# ATAPI tape drives=0A=
___options 	ATA_STATIC_ID		#Static device numbering=0A=
___# SCSI Controllers=0A=
___device		ahb		# EISA AHA1742 family=0A=
___device		ahc		# AHA2940 and onboard AIC7xxx devices=0A=
___device		amd		# AMD 53C974 (Tekram DC-390(T))=0A=
___device		isp		# Qlogic family=0A=
___device		ncr		# NCR/Symbios Logic=0A=
___device		sym		# NCR/Symbios Logic (newer chipsets)=0A=
___options		SYM_SETUP_LP_PROBE_MAP=3D0x40=0A=
___				# Allow ncr to attach legacy NCR devices when =0A=
___				# both sym and ncr are configured=0A=
___device		adw=0A=
___device		ncv		# NCR 53C500=0A=
___device		nsp		# Workbit Ninja SCSI-3=0A=
___device		stg		# TMC 18C30/18C50=0A=
___# SCSI peripherals=0A=
___device		scbus		# SCSI bus (required)=0A=
___device		da		# Direct Access (disks)=0A=
___device		sa		# Sequential Access (tape etc)=0A=
___device		cd		# CD=0A=
___device		pass		# Passthrough device (direct SCSI access)=0A=
___# RAID controllers interfaced to the SCSI subsystem=0A=
___device		asr		# DPT SmartRAID V, VI and Adaptec SCSI RAID=0A=
___device		dpt		# DPT Smartcache - See LINT for options!=0A=
___device		mly		# Mylex AcceleRAID/eXtremeRAID=0A=
___device          ciss		# Compaq SmartRAID 5* series=0A=
___# RAID controllers=0A=
___device		aac		# Adaptec FSA RAID, Dell PERC2/PERC3=0A=
___device		ida		# Compaq Smart RAID=0A=
___device		amr		# AMI MegaRAID=0A=
___device		mlx		# Mylex DAC960 family=0A=
___device		twe		# 3ware Escalade=0A=
___# atkbdc0 controls both the keyboard and the PS/2 mouse=0A=
___device		atkbdc0	at isa? port IO_KBD=0A=
___device		atkbd0	at atkbdc? irq 1 flags 0x1=0A=
___device		psm0	at atkbdc? irq 12=0A=
___device		vga0	at isa?=0A=
___# splash screen/screen saver=0A=
___pseudo-device	splash=0A=
___# syscons is the default console driver, resembling an SCO =
console=0A=
___device		sc0	at isa? flags 0x100=0A=
___# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console =
driver=0A=
___#device		vt0	at isa?=0A=
___#options 	XSERVER			# support for X server on a vt console=0A=
___#options 	FAT_CURSOR		# start with block cursor=0A=
___# If you have a ThinkPAD, uncomment this along with the rest of the =
PCVT lines=0A=
___#options 	PCVT_SCANSET=3D2		# IBM keyboards are non-std=0A=
___# Floating point support - do not disable.=0A=
___device		npx0	at nexus? port IO_NPX irq 13=0A=
___# Power management support (see LINT for more options)=0A=
___#device		apm0    at nexus? disable flags 0x20 # Advanced Power =
Management=0A=
___# Serial (COM) ports=0A=
___device		sio0	at isa? port IO_COM1 flags 0x10 irq 4=0A=
___device		sio1	at isa? port IO_COM2 irq 3=0A=
___# PCI Ethernet NICs that use the common MII bus controller code.=0A=
___# NOTE: Be sure to keep the 'device miibus' line in order to use =
these NICs!=0A=
___#device		miibus		# MII bus support=0A=
___#device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)=0A=
___#device		wx		# Intel Gigabit Ethernet Card (``Wiseman'')=0A=
___#device		xl		# 3Com 3c90x (``Boomerang'', ``Cyclone'')=0A=
___#device		bge		# Broadcom BCM570x (``Tigon III'')=0A=
___#device		gx=0A=
___#device		em		# Intel Gigabit cards=0A=
___# Pseudo devices - the number indicates how many units to =
allocate.=0A=
___pseudo-device	loop		# Network loopback=0A=
___pseudo-device	ether		# Ethernet support=0A=
___#pseudo-device	sl	1	# Kernel SLIP=0A=
___#pseudo-device	ppp	1	# Kernel PPP=0A=
___pseudo-device	tun		# Packet tunnel.=0A=
___pseudo-device	pty		# Pseudo-ttys (telnet etc)=0A=
___pseudo-device	md		# Memory "disks"=0A=
___#pseudo-device	gif		# IPv6 and IPv4 tunneling=0A=
___#pseudo-device	faith	1	# IPv6-to-IPv4 relaying (translation)=0A=
___# The `bpf' pseudo-device enables the Berkeley Packet Filter.=0A=
___# Be aware of the administrative consequences of enabling this!=0A=
___pseudo-device	bpf		#Berkeley packet filter=0A=
___# USB support=0A=
___device		uhci		# UHCI PCI->USB interface=0A=
___device		ohci		# OHCI PCI->USB interface=0A=
___device		usb		# USB Bus (required)=0A=
___device		ugen		# Generic=0A=
___device		uhid		# "Human Interface Devices"=0A=
___device		ukbd		# Keyboard=0A=
___device		ulpt		# Printer=0A=
___device		umass		# Disks/Mass storage - Requires scbus and da=0A=
___device		ums		# Mouse=0A=
___device		uscanner	# Scanners=0A=
___device		urio		# Diamond Rio MP3 Player=0A=
___# USB Ethernet, requires mii=0A=
___#device		aue		# ADMtek USB ethernet=0A=
___#device		cue		# CATC USB ethernet=0A=
___#device		kue		# Kawasaki LSI USB ethernet=0A=
___# Local options=0A=
___options 	HZ=3D1000=0A=
___options 	INCLUDE_CONFIG_FILE	# Include this file in kernel=0A=
___options 	IPFIREWALL		#firewall=0A=
___options 	IPFIREWALL_DEFAULT_TO_ACCEPT	#allow everything by =
default=0A=
___options 	IPFIREWALL_FORWARD	#enable transparent proxy support=0A=
___options 	IPDIVERT		#divert sockets=0A=
___#options 	DUMMYNET=0A=
___#options 	BRIDGE=0A=
___options 	RANDOM_IP_ID=0A=
___#options 	TCP_DROP_SYNFIN		#drop TCP packets with SYN+FIN=0A=
___options 	EXT2FS			#Add linux FS support=0A=
___options 	MAXDSIZ=3D"(512*1024*1024)"=0A=
___options 	DFLDSIZ=3D"(512*1024*1024)"=0A=
___options 	NETSMB			#SMB/CIFS requester=0A=
___options 	NETSMBCRYPTO		#encrypted password support for SMB=0A=
___options 	LIBMCHAIN		#mbuf management library=0A=
___options 	LIBICONV		#Kernel side iconv library=0A=
___options		SMBFS			#SMB/CIFS filesystem=0A=
___options 	CONSPEED=3D115200		# speed for serial console=0A=
___options 	USER_LDT		#allow user-level control of i386 ldt=0A=
___options 	CPU_ENABLE_SSE=0A=
___#options		IPFW2=0A=
___device smbus=0A=
___device iicbus=0A=
___device iicbb=0A=
___device intpm=0A=
___device alpm=0A=
___device ichsmb=0A=
___device smb=0A=
___device pcf=0A=

------_=_NextPart_000_01C3B6D0.6DD9F800--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE045D4D9F7AED4CBFF1B3B813C85337035E3F6B>