Date: Sat, 31 Aug 2002 16:48:20 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: hardware@freebsd.org Subject: PCI latency timer vs interrupt latency and ISA bus latency Message-ID: <20020831160511.O3960-100000@gamplex.bde.org>
next in thread | raw e-mail | index | archive | help
Debugging of interrupt latency caused by critical_enter() showed that DELAY(2) sometimes delayed for 170 or more usec for an Athlon1600 CPU overclocked on an ASUS A7V266-E motherboard, apparently due to the 3 ISA i/o's done in getit() taking 170+ usec altogether. _Increasing_ the PCI latency timeout significantly reduced the getit() latency. I first increased it from 32 to 64 and then 96 in the BIOS (96 worked significantly better) and then increased it for individual PCI devices using pciconf (increasing it to 96 for fxp0 was enough). Not overclocking helpd a little. I would have thought that increasing the latency timeouts would have increased ISA bus latency. The large ISA latency doesn't seem to occur often. My theory is that it often occurs for fxp because fxp_start() calls DELAY(2) and fxp_start() is called just before fxp DMA completes if fxp's latency timeout is small but not if it is large. The default latency timeout seems to be out of spec for some devices including fxp, especially when everything is overclocked: %%% Copyright (c) 1992-2002 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 5.0-CURRENT #1653: Wed Aug 28 20:20:38 EST 2002 bde@besplex.bde.org:/c/obj/usr/src/sys/compile/BESPLEX Preloaded elf kernel "kernel" at 0xc0336760. Calibrating clock(s) ... TSC clock: 1532744548 Hz, i8254 clock: 1193120 Hz Press a key on the console to abort clock calibration Calibrating clock(s) ... new getit_delta_max = 3900 nsec new getit_delta_max = 3907 nsec new getit_delta_max = 3912 nsec TSC clock: 1532480726 Hz, i8254 clock: 1193129 Hz Calibrating clock(s) ... TSC clock: 1532744631 Hz, i8254 clock: 1193121 Hz Calibrating clock(s) ... TSC clock: 1532744631 Hz, i8254 clock: 1193121 Hz Calibrating clock(s) ... TSC clock: 1532758743 Hz, i8254 clock: 1193131 Hz Calibrating clock(s) ... TSC clock: 1532744631 Hz, i8254 clock: 1193121 Hz Calibrating clock(s) ... TSC clock: 1532758743 Hz, i8254 clock: 1193131 Hz Calibrating clock(s) ... TSC clock: 1532758743 Hz, i8254 clock: 1193131 Hz Timecounter "i8254" frequency 1193120 Hz Timecounter "TSC" frequency 1532758743 Hz CPU: AMD Athlon(TM) XP1600+ (1532.76-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x662 Stepping = 2 Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE> AMD Features=0xffffffffc0480000<MP,AMIE,DSP,3DNow!> Data TLB: 32 entries, fully associative Instruction TLB: 16 entries, fully associative L1 data cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative L1 instruction cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative L2 internal cache: 256 kbytes, 64 bytes/line, 1 lines/tag, 8-way associative real memory = 536788992 (524208K bytes) Physical memory chunk(s): 0x00001000 - 0x0009ffff, 651264 bytes (159 pages) 0x00419000 - 0x1ffe3fff, 532459520 bytes (129995 pages) avail memory = 516382720 (504280K bytes) bios32: Found BIOS32 Service Directory header at 0xc00f1470 bios32: Entry = 0xf0bf0 (c00f0bf0) Rev = 0 Len = 1 pcibios: PCI BIOS entry at 0xf0000+0xdf0 pnpbios: Found PnP BIOS data at 0xc00fbd70 pnpbios: Entry = f0000:bda0 Rev = 1.0 pnpbios: OEM ID cd041 Other BIOS signatures found: vm_init_limits: 1ec69000 free null: <null device, zero device> random: <entropy source> mem: <memory & I/O> Pentium Pro MTRR support enabled pci_open(1): mode 1 addr port (0x0cf8) is 0x80000060 pci_open(1a): mode1res=0x80000000 (0x80000000) pci_cfgcheck: device 0 [class=060000] [hdr=00] is there (id=30991106) Using $PIR table, 10 entries at 0xc00f13a0 new getit_delta_max = 4082 nsec npx0: <math processor> on motherboard npx0: INT 16 interface pcib0: <Host to PCI bridge> at pcibus 0 on motherboard pci0: <PCI bus> on pcib0 pci0: physical bus=0 map[10]: type 3, range 32, base fc000000, size 25, enabled found-> vendor=0x1106, dev=0x3099, revid=0x00 bus=0, slot=0, func=0 class=06-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0006, statreg=0x2210, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) powerspec 2 supports D0 D3 current D0 found-> vendor=0x1106, dev=0xb099, revid=0x00 bus=0, slot=1, func=0 class=06-04-00, hdrtype=0x01, mfdev=0 cmdreg=0x0007, statreg=0x2230, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) map[10]: type 1, range 32, base f4000000, size 26, enabled found-> vendor=0x5333, dev=0x5631, revid=0x06 bus=0, slot=12, func=0 class=03-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0200, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x04 (1000 ns), maxlat=0xff (63750 ns) intpin=a, irq=10 map[10]: type 3, range 32, base fb000000, size 12, enabled map[14]: type 4, range 32, base 0000d800, size 5, enabled map[18]: type 1, range 32, base f3800000, size 20, enabled found-> vendor=0x8086, dev=0x1229, revid=0x05 bus=0, slot=13, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0017, statreg=0x0290, cachelnsz=8 (dwords) lattimer=0x40 (1920 ns), mingnt=0x08 (2000 ns), maxlat=0x38 (14000 ns) intpin=a, irq=5 powerspec 1 supports D0 D1 D2 D3 current D0 map[10]: type 1, range 32, base f3000000, size 7, enabled map[14]: type 4, range 32, base 0000d400, size 7, enabled map[18]: type 1, range 20, base 000c8000, size 14, enabled found-> vendor=0x120e, dev=0x0100, revid=0x01 bus=0, slot=14, func=0 class=07-80-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 found-> vendor=0x1106, dev=0x3074, revid=0x00 bus=0, slot=17, func=0 class=06-01-00, hdrtype=0x00, mfdev=1 cmdreg=0x0087, statreg=0x0210, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) powerspec 2 supports D0 D3 current D0 map[20]: type 4, range 32, base 0000d000, size 4, enabled found-> vendor=0x1106, dev=0x0571, revid=0x06 bus=0, slot=17, func=1 class=01-01-8a, hdrtype=0x00, mfdev=0 cmdreg=0x0087, statreg=0x0290, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=255 powerspec 2 supports D0 D3 current D0 pcib1: <PCI-PCI bridge> at device 1.0 on pci0 pcib1: secondary bus 1 pcib1: subordinate bus 1 pcib1: I/O decode 0xe000-0xdfff pcib1: memory decode 0xfae00000-0xfadfffff pcib1: prefetched decode 0xfc000000-0xfbffffff pci1: <PCI bus> on pcib1 pci1: physical bus=1 pci0: <display, VGA> at device 12.0 (no driver attached) fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0xd800-0xd81f mem 0xf3800000-0xf38fffff,0xfb000000-0xfb000fff irq 5 at device 13.0 on pci0 fxp0: using memory space register mapping fxp0: Ethernet address 00:90:27:25:64:ee fxp0: PCI IDs: 8086 1229 8086 0009 0005 fxp0: Dynamic Standby mode is disabled inphy0: <i82555 10/100 media interface> on miibus0 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto bpf: fxp0 attached cy0: <Cyclades Cyclom-Y Serial Adapter> port 0xd400-0xd47f mem 0xc8000-0xcbfff,0xf3000000-0xf300007f irq 11 at device 14.0 on pci0 isab0: <PCI-ISA bridge> at device 17.0 on pci0 isa0: <ISA bus> on isab0 atapci0: <VIA 8233 ATA100 controller> port 0xd000-0xd00f at device 17.1 on pci0 ata0: iobase=0x01f0 altiobase=0x03f6 bmaddr=0xd000 ata0: mask=03 ostat0=50 ostat2=50 ata0-master: ATAPI 00 00 ata0-slave: ATAPI 14 eb ata0: mask=03 stat0=50 stat1=10 ata0-master: ATA 01 a5 ata0: devices=09 ata0: at 0x1f0 irq 14 on atapci0 ata1: iobase=0x0170 altiobase=0x0376 bmaddr=0xd008 ata1: mask=03 ostat0=50 ostat2=00 ata1-master: ATAPI 00 00 ata1-slave: ATAPI 00 00 ata1: mask=03 stat0=50 stat1=00 ata1-master: ATA 01 a5 ata1: devices=01 ata1: at 0x170 irq 15 on atapci0 pnpbios: 14 devices, largest 114 bytes PNP0401: adding dma mask 0x8 PNP0401: adding irq mask 0x80 PNP0401: adding io range 0x378-0x37f, size=0x8, align=0 PNP0401: adding io range 0x778-0x77f, size=0x8, align=0 pnpbios: handle 1 device ID PNP0401 (0104d041) PNP0501: adding irq mask 0x10 PNP0501: adding io range 0x3f8-0x3ff, size=0x8, align=0 pnpbios: handle 2 device ID PNP0501 (0105d041) PNP0501: adding irq mask 0x8 PNP0501: adding io range 0x2f8-0x2ff, size=0x8, align=0 pnpbios: handle 3 device ID PNP0501 (0105d041) PNP0700: adding irq mask 0x40 PNP0700: adding dma mask 0x4 PNP0700: adding io range 0x3f2-0x3f5, size=0x4, align=0 pnpbios: handle 4 device ID PNP0700 (0007d041) PNP0c01: adding fixed memory32 range 0-0x9ffff, size=0xa0000 PNP0c01: adding fixed memory32 range 0x100000-0x1fffffff, size=0x1ff00000 PNP0c01: adding fixed memory32 range 0xe8000-0xeffff, size=0x8000 PNP0c01: adding fixed memory32 range 0xf0000-0xf3fff, size=0x4000 PNP0c01: adding fixed memory32 range 0xf4000-0xf7fff, size=0x4000 PNP0c01: adding fixed memory32 range 0xf8000-0xfbfff, size=0x4000 PNP0c01: adding fixed memory32 range 0xfc000-0xfffff, size=0x4000 PNP0c01: adding fixed memory32 range 0xfffe0000-0xffffffff, size=0x20000 pnpbios: handle 6 device ID PNP0c01 (010cd041) PNP0000: adding irq mask 0x4 PNP0000: adding io range 0x20-0x21, size=0x2, align=0 PNP0000: adding io range 0xa0-0xa1, size=0x2, align=0 PNP0000: adding io range 0x4d0-0x4d1, size=0x2, align=0 pnpbios: handle 7 device ID PNP0000 (0000d041) PNP0100: adding irq mask 0x1 PNP0100: adding io range 0x40-0x43, size=0x4, align=0 pnpbios: handle 8 device ID PNP0100 (0001d041) PNP0b00: adding irq mask 0x100 PNP0b00: adding io range 0x70-0x75, size=0x6, align=0 pnpbios: handle 9 device ID PNP0b00 (000bd041) PNP0303: adding irq mask 0x2 PNP0303: adding io range 0x60-0x60, size=0x1, align=0 PNP0303: adding io range 0x64-0x64, size=0x1, align=0 pnpbios: handle 10 device ID PNP0303 (0303d041) PNP0c04: adding irq mask 0x2000 PNP0c04: adding io range 0xf0-0xf0, size=0x1, align=0 pnpbios: handle 11 device ID PNP0c04 (040cd041) PNP0200: adding dma mask 0x10 PNP0200: adding io range 0-0xf, size=0x10, align=0 PNP0200: adding io range 0x80-0x90, size=0x11, align=0 PNP0200: adding io range 0x94-0x9f, size=0xc, align=0 PNP0200: adding io range 0xc0-0xde, size=0x1f, align=0 pnpbios: handle 12 device ID PNP0200 (0002d041) PNP0800: adding io range 0x61-0x61, size=0x1, align=0x1 pnpbios: handle 13 device ID PNP0800 (0008d041) PNP0a03: adding io range 0xcf8-0xcff, size=0x8, align=0 pnpbios: handle 14 device ID PNP0a03 (030ad041) PNP0c02: adding io range 0xe400-0xe47f, size=0x80, align=0 PNP0c02: adding io range 0xe800-0xe83f, size=0x40, align=0 pnpbios: handle 15 device ID PNP0c02 (020cd041) cy: cy0 already exists; skipping it Trying Read_Port at 203 Trying Read_Port at 243 Trying Read_Port at 283 Trying Read_Port at 2c3 Trying Read_Port at 303 Trying Read_Port at 343 Trying Read_Port at 383 Trying Read_Port at 3c3 sc: sc0 already exists; skipping it vga: vga0 already exists; skipping it isa_probe_children: disabling PnP devices isa_probe_children: probing non-PnP devices orm0: <Option ROM> at iomem 0xc0000-0xc7fff on isa0 fdc0: <enhanced floppy controller (i82077, NE72065 or clone)> at port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on isa0 fdc0: FIFO enabled, 8 bytes threshold fd0: <1440-KB 3.5" drive> on fdc0 drive 0 wdc0 failed to probe at port 0x1f0 irq 14 flags 0xa0ffa0ff on isa0 wdc1 failed to probe at port 0x170 irq 15 flags 0xa0ffa0ff on isa0 bt0 failed to probe on isa0 atkbdc0: <Keyboard controller (i8042)> at port 0x64,0x60 on isa0 atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0 atkbd: the current kbd controller command byte 0067 atkbd: keyboard ID 0x41ab (2) kbd0 at atkbd0 kbd0: atkbd0, AT 101/102 (2), config:0x1, flags:0x3d0000 psm0: current command byte:0067 psm0: failed to reset the aux device. vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 fb0: vga0, vga, type:VGA (5), flags:0x7007f fb0: port:0x3c0-0x3df, crtc:0x3d4, mem:0xa0000 0x20000 fb0: init mode:24, bios mode:3, current mode:24 fb0: window:0xc00b8000 size:32k gran:32k, buf:0 size:32k VGA parameters upon power-up 50 18 10 00 00 00 03 00 02 67 5f 4f 50 82 55 81 bf 1f 00 4f 0d 0e 00 00 07 80 9c 8e 8f 28 1f 96 b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff VGA parameters in BIOS for mode 24 50 18 10 00 10 00 03 00 02 67 5f 4f 50 82 55 81 bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f 96 b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff EGA/VGA parameters to be used for mode 24 50 18 10 00 10 00 03 00 02 67 5f 4f 50 82 55 81 bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f 96 b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff sc0: <System console> at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sc0: fb0, kbd0, terminal emulator: sc (syscons terminal) sio0: irq maps: 0x41 0x51 0x41 0x41 sio0 at port 0x3f8-0x3ff irq 4 flags 0x90 on isa0 sio0: type 16550A sio1: irq maps: 0x41 0x49 0x41 0x41 sio1 at port 0x2f8-0x2ff irq 3 on isa0 sio1: type 16550A sio2: irq maps: 0x41 0x41 0x41 0x41 sio2: probe failed test(s): 0 1 2 4 6 7 9 sio2 failed to probe at port 0x3e8-0x3ef on isa0 sio3: irq maps: 0x41 0x41 0x41 0x41 sio3: probe failed test(s): 0 1 2 4 6 7 9 sio3 failed to probe at port 0x2e8-0x2ef on isa0 ppc0: parallel port found at 0x378 ppc0: using extended I/O port range ppc0: ECP SPP ECP+EPP SPP ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/9 bytes threshold plip0: <PLIP network interface> on ppbus0 bpf: lp0 attached lpt0: <Printer> on ppbus0 lpt0: Interrupt-driven port ppi0: <Parallel I/O> on ppbus0 pca0 failed to probe at port 0x40 on isa0 ed0 failed to probe at port 0x300-0x31f iomem 0xd0000 irq 5 on isa0 isa_probe_children: probing PnP devices unknown: <PNP0401> can't assign resources (port) unknown: <PNP0401> at port 0x378-0x37f on isa0 unknown: <PNP0501> can't assign resources (port) unknown: <PNP0501> at port 0x3f8-0x3ff on isa0 unknown: <PNP0501> can't assign resources (port) unknown: <PNP0501> at port 0x2f8-0x2ff on isa0 unknown: <PNP0700> can't assign resources (port) unknown: <PNP0700> at port 0x3f2-0x3f5 on isa0 unknown: <PNP0303> can't assign resources (port) unknown: <PNP0303> at port 0x60 on isa0 pca1: <AT-style speaker sound> at port 0x61 on isa0 unknown: <PNP0a03> failed to probe at port 0xcf8-0xcff on isa0 BIOS Geometries: 0:03fffe3f 0..1023=1024 cylinders, 0..254=255 heads, 1..63=63 sectors 1:03fffe3f 0..1023=1024 cylinders, 0..254=255 heads, 1..63=63 sectors 0 accounted for Device configuration finished. new crit_delta_max = 587 nsec new crit_delta_max = 825 nsec procfs registered new crit_delta_max = 1289 nsec Timecounters tick every 10.000 msec new crit_delta_max = 2318 nsec bpf: lo0 attached Linux ELF exec handler installed new crit_delta_max = 4240 nsec new crit_delta_max = 4628 nsec new crit_delta_max = 4716 nsec ad0: success setting UDMA5 on VIA chip Creating DISK ad0 ar: FreeBSD check1 failed ad0: <IBM-DTLA-307030/TX4OA50C> ATA-5 disk at ata0-master ad0: 29314MB (60036480 sectors), 59560 C, 16 H, 63 S, 512 B ad0: 16 secs/int, 1 depth queue, UDMA100 ad0: piomode=4 dmamode=2 udmamode=5 cblid=1 ad2: success setting UDMA5 on VIA chip Creating DISK ad2 ar: FreeBSD check1 failed ad2: <IC35L060AVVA07-0/VA3OA50K> ATA-5 disk at ata1-master ad2: 58644MB (120103200 sectors), 119150 C, 16 H, 63 S, 512 B ad2: 16 secs/int, 1 depth queue, UDMA100 ad2: piomode=4 dmamode=2 udmamode=5 cblid=1 ata0-slave: piomode=4 dmamode=2 udmamode=5 dmaflag=1 ata0-slave: DMA limited to UDMA33, non-ATA66 cable or device ata0-slave: success setting UDMA2 on VIA chip new crit_delta_max = 4853 nsec new crit_delta_max = 4928 nsec acd0: <ASUS DVD-ROM E616/2.0> DVD-ROM drive at ata0 as slave acd0: read 343KB/s (32KB/s), 512KB buffer, UDMA33 acd0: Reads: CD-R, CD-RW, CD-DA stream, DVD-ROM, DVD-R, packet acd0: Writes: acd0: Audio: play, 255 volume levels acd0: Mechanism: ejectable tray, unlocked acd0: Medium: 120mm data disc Mounting root from ufs:ad0s2a new getit_delta_max = 4097 nsec new crit_delta_max = 212439 nsec crit_delta = 212439 nsec ad0s2: type 0xa5, start 2056320, end = 59569019, size 57512700 : OK inittodr: delta = 0.000037879 start_init: trying /sbin/init new getit_delta_max = 4127 nsec new crit_delta_max = 217090 nsec crit_delta = 217090 nsec new getit_delta_max = 4179 nsec crit_delta = 213694 nsec ad2s1: type 0x0, start 63, end = 2104514, size 2104452 : OK ad2s2: type 0xa5, start 2104515, end = 120103199, size 117998685 : OK ad2s1: type 0x0, start 63, end = 2104514, size 2104452 : OK ad2s2: type 0xa5, start 2104515, end = 120103199, size 117998685 : OK ad2s1: type 0x0, start 63, end = 2104514, size 2104452 : OK ad2s2: type 0xa5, start 2104515, end = 120103199, size 117998685 : OK ad2s1: type 0x0, start 63, end = 2104514, size 2104452 : OK ad2s2: type 0xa5, start 2104515, end = 120103199, size 117998685 : OK time delta is -36001.999999 new getit_delta_max = 4296 nsec crit_delta = 204364 nsec new getit_delta_max = 4341 nsec crit_delta = 190568 nsec ffs: flush fs control info WARNING: driver ptc should register devices with make_dev() (dev_t = "#ptc/0") new getit_delta_max = 4400 nsec crit_delta = 207726 nsec new getit_delta_max = 4617 nsec new crit_delta_max = 245431 nsec crit_delta = 245431 nsec new getit_delta_max = 4844 nsec crit_delta = 240250 nsec new getit_delta_max = 4885 nsec crit_delta = 235529 nsec new getit_delta_max = 14655 nsec crit_delta = 240496 nsec %%% Summary of relevant things in the above: VT8366/A Apollo KT266/A,KT333 CPU to PCI Bridge: lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) VT8366/A Apollo KT266/A CPU to AGP Controller: lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) 86C325 Virge 3D GUI Accelerator: lattimer=0x20 (960 ns), mingnt=0x04 (1000 ns), maxlat=0xff (63750 ns) ^^^^^^ ^^^^^^^ 960 is a little below the minimum. The actual time is approx 960 * 133/146 due to overclocking. 82557/8/9 EtherExpress PRO/100(B) Ethernet Adapter: lattimer=0x20 (960 ns), mingnt=0x08 (2000 ns), maxlat=0x38 (14000 ns) ^^^^^^ ^^^^^^^ 960 is a long way below the minimum. Cyclom-Y Multiport Serial Card: lattimer=0x20 (960 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) VT8233 PCI to ISA Bridge: lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) VT82C5x6/A/B,VT82C686A/B EIDE Controller: lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) ^^^^^^^ ^^^^ Another motherboard (ABIT BP6) sets the latency timer to exceed mingnt for some devices not including fxp0 and seems to have better interrupt latency despite its CPUs being much slower. Some of the latency debugging code is in: %%% Index: clock.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/clock.c,v retrieving revision 1.187 diff -u -2 -r1.187 clock.c --- clock.c 22 Jun 2002 16:30:18 -0000 1.187 +++ clock.c 29 Aug 2002 09:26:46 -0000 @@ -402,10 +600,28 @@ #endif /* DDB */ +static uint64_t getit_acq; +static uint64_t getit_rel; +static uint64_t getit_delta; +static uint64_t getit_delta_max; + static int getit(void) { + uint64_t lgetit_delta, lgetit_delta_max; + u_long ef; int high, low; - mtx_lock_spin(&clock_lock); +#ifdef DDB + if (!db_active) { +#endif + ef = read_eflags(); + disable_intr(); + mtx_lock_spin(&clock_lock); +#ifdef DDB + } else + ef = 0; /* XXX */ +#endif + + getit_acq = rdtsc(); /* Select timer0 and latch counter value. */ @@ -415,5 +631,22 @@ high = inb(TIMER_CNTR0); - mtx_unlock_spin(&clock_lock); + getit_rel = rdtsc(); + getit_delta = getit_rel - getit_acq; + lgetit_delta = getit_delta; + lgetit_delta_max = getit_delta_max; + if (getit_delta > getit_delta_max) + getit_delta_max = getit_delta; + +#ifdef DDB + if (!db_active) { +#endif + mtx_unlock_spin(&clock_lock); + write_eflags(ef); +#ifdef DDB + } +#endif + if (lgetit_delta > lgetit_delta_max && tsc_freq != 0) + printf("new getit_delta_max = %ju nsec\n", + lgetit_delta * 1000000000 / tsc_freq); return ((high << 8) | low); } %%% The ddb stuff is to prevent panics when the non-recursive spinlock clock_lock is recursed on. The lock really is recursive, but the low level keyboard driver uses it and this is fatal when ddb is invoked while the lock is held. The bug is mostly in DELAY(). I think getit() can just use a single inb() to read the low byte. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020831160511.O3960-100000>