Re: Timekeeping hosed by factor 3, high lapic[01] interrupt rates

From: Jens Schweikhardt <schweikh_at_schweikhardt.net>
Date: Thu, 19 May 2005 21:01:29 +0200
Doug et al,

On Wed, May 18, 2005 at 03:04:39PM -0700, Doug White wrote:
# On Mon, 16 May 2005, Jens Schweikhardt wrote:
# 
# > hello, world\n
# >
# > the timekeeping on my CURRENT system as of May 15 is very strange. The
# > time as reported by date(1) increases too slow by a factor of 3. Things
# > with second intervals like sleep 1, tail -f, iostat 1, changing folders
# > in mutt all go slower by a factor of 3.
# >
# > The system bios date however is correct, and a kernel as of March does
# > not have this problem, so it's clearly the kernel or some other software
# > problem. I have investigated a bit and found the interrupt rates for the
# > lapic[01] being three times the value on the broken kernel (about 2kHz
# > vs 6kHz),
# 
# Are you running with kern.hz or HZ set to something other than the
# default?

No,
$ sysctl -a | grep hz
kern.clockrate: { hz = 1000, tick = 1000, profhz = 666, stathz = 133 }
debug.psm.hz: 20

is the same on both systems.
...
# the lapic timer values should run about 2*hz.

Then something is out of whack... this is from the strange system:

$ vmstat -i
interrupt                          total       rate
irq1: atkbd0                         211          8
irq13: npx0                            1          0
irq14: ata0                           63          2
irq15: ata1                          109          4
irq18: em0                            17          0
irq24: ahd0                         4511        187
irq25: ahc0                           16          0
lapic0: timer                     190869       7952
lapic1: timer                     176174       7340
Total                             371971      15498

Note that there's no
irq0: clk                         745029       1000
appearing. I'm not an expert, but that's unexpected to my eyes.

My /boot/device.hints deviate from GENERIC.hints only through
hint.atkbd.0.flags="0x1"
hint.ppc.0.irq="5"
hint.ppc.0.flags="0x20"
hint.cd.0.at="scbus0"
hint.cd.0.target="3"
hint.cd.1.at="scbus0"
hint.cd.1.target="4"

dmesg and kernel config of the strange system follow. I never used the
NO_MIXED_MODE mentioned in UPDATING.

Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 6.0-CURRENT #0: Tue May 17 20:29:49 CEST 2005
    toor_at_hal9000.schweikhardt.net:/share/HEAD/obj/share/HEAD/src/sys/HAL9000
MPTable: <OEM00000 PROD00000000>
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (2994.90-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf33  Stepping = 3
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x41d<SSE3,RSVD2>,MON,DS_CPL,CNTX-ID>
  Hyperthreading: 2 logical CPUs
real memory  = 1072627712 (1022 MB)
avail memory = 1040842752 (992 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0: Changing APIC ID to 2
ioapic0: Assuming intbase of 0
ioapic1: Assuming intbase of 24
ioapic0 <Version 2.0> irqs 0-23 on motherboard
ioapic1 <Version 2.0> irqs 24-47 on motherboard
bktr_mem: memory holder loaded
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
cpu0 on motherboard
cpu1 on motherboard
pcib0: <MPTable Host-PCI bridge> pcibus 0 on motherboard
pci0: <PCI bus> on pcib0
pcib1: <MPTable PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
pci1: <display> at device 0.1 (no driver attached)
pcib2: <MPTable PCI-PCI bridge> at device 3.0 on pci0
pci2: <PCI bus> on pcib2
em0: <Intel(R) PRO/1000 Network Connection, Version - 1.7.35> port 0xb000-0xb01f mem 0xec000000-0xec01ffff irq 18 at device 1.0 on pci2
em0: Ethernet address: 00:30:48:80:79:71
em0:  Speed:N/A  Duplex:N/A
pcib3: <MPTable PCI-PCI bridge> at device 28.0 on pci0
pci3: <PCI bus> on pcib3
ahd0: <Adaptec 29320LP Ultra320 SCSI adapter> port 0xc000-0xc0ff,0xc400-0xc4ff mem 0xeb000000-0xeb001fff irq 24 at device 1.0 on pci3
ahd0: [GIANT-LOCKED]
aic7901A: Ultra320 Wide Channel A, SCSI Id=7, PCI 33 or 66Mhz, 512 SCBs
ahc0: <Adaptec 29160 Ultra160 SCSI adapter> port 0xc800-0xc8ff mem 0xeb002000-0xeb002fff irq 25 at device 2.0 on pci3
ahc0: [GIANT-LOCKED]
aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
uhci0: <UHCI (generic) USB controller> port 0xd000-0xd01f irq 16 at device 29.0 on pci0
uhci0: [GIANT-LOCKED]
usb0: <UHCI (generic) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <UHCI (generic) USB controller> port 0xd400-0xd41f irq 19 at device 29.1 on pci0
uhci1: [GIANT-LOCKED]
usb1: <UHCI (generic) USB controller> on uhci1
usb1: USB revision 1.0
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
pci0: <base peripheral> at device 29.4 (no driver attached)
pci0: <base peripheral, interrupt controller> at device 29.5 (no driver attached)
pci0: <serial bus, USB> at device 29.7 (no driver attached)
pcib4: <MPTable PCI-PCI bridge> at device 30.0 on pci0
pci4: <PCI bus> on pcib4
bktr0: <BrookTree 878> mem 0xec300000-0xec300fff irq 20 at device 1.0 on pci4
bktr0: [GIANT-LOCKED]
bktr0: Hauppauge Model 38104 B208
bktr0: Hauppauge WinCast/TV, Philips PAL I tuner.
pci4: <multimedia> at device 1.1 (no driver attached)
csa0: <CS4280/CS4614/CS4622/CS4624/CS4630> mem 0xec200000-0xec200fff,0xec100000-0xec1fffff irq 21 at device 2.0 on pci4
csa: card is Unknown/invalid SSID (CS4614)
csa0: [GIANT-LOCKED]
pcm0: <CS461x PCM Audio> on csa0
pcm0: <Cirrus Logic CS4294 AC97 Codec>
pcm0: [GIANT-LOCKED]
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel 6300ESB UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xf000-0xf00f at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
orm0: <ISA Option ROM> at iomem 0xc0000-0xccfff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse, device ID 3
fdc0: <Enhanced floppy controller> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: [FAST]
ppc0: <Parallel port> at port 0x278-0x27f irq 5 flags 0x20 on isa0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
lpt0: <Printer> on ppbus0
lpt0: Polled port
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
unknown: <PNP0303> can't assign resources (port)
unknown: <PNP0c01> can't assign resources (memory)
unknown: <PNP0f13> can't assign resources (irq)
unknown: <PNP0501> can't assign resources (port)
unknown: <PNP0700> can't assign resources (port)
unknown: <PNP0400> can't assign resources (port)
unknown: <PNP0501> can't assign resources (port)
Timecounters tick every 1.000 msec
ipfw2 (+ipv6) initialized, divert loadable, rule-based forwarding disabled, default to deny, logging limited to 100 packets/entry by default
ad0: 76319MB <Seagate ST380023A 3.33> at ata0-master UDMA100
acd0: DVDR <NEC DVD RW ND-2500A/1.06> at ata1-master UDMA33
da0 at ahd0 bus 0 target 0 lun 0
da0: <FUJITSU MAN3367MP 0108> Fixed Direct Access SCSI-3 device 
da0: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da0: 35044MB (71771688 512 byte sectors: 255H 63S/T 4467C)
da1 at ahd0 bus 0 target 1 lun 0
da1: <FUJITSU MAN3367MP 0108> Fixed Direct Access SCSI-3 device 
da1: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da1: 35044MB (71771688 512 byte sectors: 255H 63S/T 4467C)
da2 at ahd0 bus 0 target 5 lun 0
da2: <FUJITSU MAP3367NP 0108> Fixed Direct Access SCSI-3 device 
da2: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da2: 35046MB (71775284 512 byte sectors: 255H 63S/T 4467C)
da3 at ahd0 bus 0 target 6 lun 0
da3: <FUJITSU MAP3367NP 0108> Fixed Direct Access SCSI-3 device 
da3: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da3: 35046MB (71775284 512 byte sectors: 255H 63S/T 4467C)
SMP: AP CPU #1 Launched!
cd2 at ata1 bus 0 target 0 lun 0
cd2: <_NEC DVD_RW ND-2500A 1.06> Removable CD-ROM SCSI-0 device 
cd2: 33.000MB/s transfers
cd2: Attempt to query device size failed: NOT READY, Medium not present
Trying to mount root from ufs:/dev/da3s1a

-----------------------------------------------------------------------------------
machine		i386
cpu		I686_CPU
ident		HAL9000

# To statically compile in device wiring instead of /boot/device.hints
#hints		"GENERIC.hints"		# Default places to look for devices.

makeoptions	DEBUG=-g		# Build kernel with gdb(1) debug symbols

options 	SCHED_4BSD 		# SCHED_4BSD scheduler
#options	PREEMPTION		# Enable kernel thread preemption
options 	INET			# InterNETworking
options 	FFS			# Berkeley Fast Filesystem
options 	SOFTUPDATES		# Enable FFS soft updates support
options 	UFS_ACL			# Support for access control lists
options 	UFS_DIRHASH		# Improve performance on big directories
options 	MD_ROOT			# MD is a potential root device
options		GEOM_GPT		# GUID Partition Tables.
options 	COMPAT_43		# Compatible with BSD 4.3 [KEEP THIS!]
options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
options 	SCSI_DELAY=1000		# Delay (in ms) before probing SCSI
options 	KTRACE			# ktrace(1) support
options 	_KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
#options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
					# output.  Adds ~128k to driver.
# Debugging for use in -current
options		KDB			# Enable kernel debugger support.
options		DDB			# Support DDB.
#options	GDB			# Support remote GDB.
#options 	INVARIANTS		# Enable calls of extra sanity checking
#options 	INVARIANT_SUPPORT	# Extra sanity checks of internal structures, required by INVARIANTS
#options 	WITNESS			# Enable checks to detect deadlocks and cycles
#options 	WITNESS_SKIPSPIN	# Don't run witness on spinlocks for speed

device		isa                     # Do not remove.
device		pci

# Floppy drives
device		fdc

# ATA and ATAPI devices
device		ata
device		atadisk			# ATA disk drives
device		atapicd			# ATAPI cd drives
device		atapicam

# SCSI Controllers
device		ahc		# AHA2940 and onboard AIC7xxx devices
device		ahd		# Adaptec PCI/PCI-X Ultra320 SCSI
# SCSI peripherals
device		scbus		# SCSI bus (required for SCSI)
device		da		# Direct Access (disks)
device		cd		# CD
device		pass		# Passthrough device (direct SCSI access)

# atkbdc0 controls both the keyboard and the PS/2 mouse
device		atkbdc		# AT keyboard controller
device		atkbd		# AT keyboard
device		vga		# VGA video card driver
device		splash		# Splash screen and screen saver support
# syscons is the default console driver, resembling an SCO console
device		sc

# Floating point support - do not disable.
device		npx

# Serial (COM) ports
device		sio		# 8250, 16[45]50 based serial ports

# Parallel port
device		ppc
device		ppbus		# Parallel port bus (required)

# Pseudo devices.
device		loop		# Network loopback
device		mem             # Memory and kernel memory devices
device		io              # I/O device
device		random          # Entropy device
device		ether		# Ethernet support
device		pty		# Pseudo-ttys (telnet etc)

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
device		bpf		# Berkeley packet filter

# USB support
device		uhci		# UHCI PCI->USB interface
device		ohci		# OHCI PCI->USB interface
device		usb		# USB Bus (required)
device		umass		# Disks/Mass storage - Requires scbus and da

device		psm		# ps/2 mouse
# Other customization.
options		EXT2FS
options		AHC_ALLOW_MEMIO
options		ATKBD_DFLT_KEYMAP
makeoptions	ATKBD_DFLT_KEYMAP="german.iso"
options		SC_HISTORY_SIZE=200
options		SC_DFLT_FONT
makeoptions	SC_DFLT_FONT=iso
options		IPFIREWALL
options		IPFIREWALL_VERBOSE
options		IPFIREWALL_VERBOSE_LIMIT=100
options		IPDIVERT
options		CPU_ENABLE_SSE
# To make an SMP kernel, the next two lines are needed
options		SMP
device		apic


Regards,

	Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
Received on Thu May 19 2005 - 17:01:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:34 UTC