Hi,

here's another problem I get with my X100e. I see lots of stray
interrupts after booting the system but they disappear after
suspend/resume.
It affects performance, I get the numbers in openssl speed md5 doubled
after resume (no, apmd is not running).

right after the boot
--------------------
OpenSSL 1.0.0e 6 Sep 2011
built on: date not available
options:bn(64,64) rc4(8x,char) des(idx,cisc,16,int) aes(partial) blowfish(idx) 
compiler: information not available
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5               5917.13k    20792.58k    59427.38k   114400.53k   157177.54k

interrupt                       total     rate
irq0/clock                      24714      202
irq0/ipi                        10522       86
irq0/spurious                       0        0
irq0/stray                       9633       78 <- here
irq0/unhandled                    238        1
irq144/acpi0                      161        1
irq96/ppb1                          0        0
irq99/re0                         114        0
irq97/ahci0                      3332       27
irq98/ohci0                         1        0
irq98/ohci1                         1        0
irq99/ehci0                         0        0
irq100/ohci2                        1        0
irq101/ehci1                      140        1
irq98/azalia0                       1        0
irq145/pckbc0                     367        3
irq146/pckbc0                     238        1
Total                           49463      405

after resume
------------
OpenSSL 1.0.0e 6 Sep 2011
built on: date not available
options:bn(64,64) rc4(8x,char) des(idx,cisc,16,int) aes(partial) blowfish(idx) 
compiler: information not available
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5              12054.76k    42226.86k   122625.19k   234398.04k   315051.80k

interrupt                       total     rate
irq0/clock                      33997      195
irq0/ipi                        12158       69
irq0/spurious                       0        0
irq0/stray                      10405       59 <- not counting any more
irq0/unhandled                    238        1
irq144/acpi0                      226        1
irq96/ppb1                          0        0
irq99/re0                         136        0
irq97/ahci0                      3419       19
irq98/ohci0                         1        0
irq98/ohci1                         1        0
irq99/ehci0                         0        0
irq100/ohci2                        1        0
irq101/ehci1                      260        1
irq98/azalia0                     192        1
irq145/pckbc0                     535        3
irq146/pckbc0                     288        1
Total                           61857      355

print_strays [1]

ddb{0}> stray interrupts:
  0: 5122
  1: 8
  7: 5275
unhandled interrupts:
1: 238: pin 1@ioapic0 pin 1 flags 0 type 2 idtvec 145 levels 9/9
11: 19: pin 22@ioapic0 pin 22 flags 0 type 3 idtvec 97 levels 6/6
0x42
ddb{0}> 

[1] print_strays() is from this diff by mikeb@

Index: arch/amd64/amd64/intr.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/intr.c,v
retrieving revision 1.30
diff -u -p -r1.30 intr.c
--- arch/amd64/amd64/intr.c     21 Oct 2011 20:48:11 -0000      1.30
+++ arch/amd64/amd64/intr.c     22 Oct 2011 17:50:07 -0000
@@ -744,3 +744,80 @@ softintr(int sir)
        __asm __volatile("lock; orq %1, %0" :
            "=m"(ci->ci_ipending) : "ir" (1UL << sir));
 }
+
+void
+intr_spurious(void)
+{
+       extern struct evcount spur_count;
+
+       spur_count.ec_count++;
+}
+
+int strayvec[MAX_INTR_SOURCES];
+
+void
+intr_stray(int num)
+{
+       extern struct evcount stray_count;
+
+       if (cold)
+               return;
+       if (num >= MAX_INTR_SOURCES)
+               printf("stray interrupt %d\n", num);
+       else
+               strayvec[num]++;
+
+       stray_count.ec_count++;
+}
+
+int uhndlvec[MAX_INTR_SOURCES];
+
+void
+intr_unhandled(int num)
+{
+       extern struct evcount uhndl_count;
+
+       if (cold)
+               return;
+       if (num >= MAX_INTR_SOURCES)
+               printf("unhandled interrupt %d\n", num);
+       else
+               uhndlvec[num]++;
+
+       uhndl_count.ec_count++;
+}
+
+#ifdef DDB
+void print_strays(void);
+
+void
+print_strays(void)
+{
+       struct intrsource *is;
+       int i;
+
+       printf("stray interrupts:\n");
+       for (i = 0; i < MAX_INTR_SOURCES; i++) {
+               if (strayvec[i])
+                       printf("  %d: %d\n", i, strayvec[i]);
+       }
+
+       printf("unhandled interrupts:\n");
+       for (i = 0; i < MAX_INTR_SOURCES; i++) {
+               if (uhndlvec[i]) {
+                       is = cpu_info_primary.ci_isources[i];
+                       if (!is) {
+                               printf("%d: %d (no intrsource)\n", i,
+                                   uhndlvec[i]);
+                               continue;
+                       }
+                       printf("%d: %d: pin %d%s%s %s flags %x type %d "
+                           "idtvec %d levels %d/%d\n", i, uhndlvec[i],
+                           is->is_pin, is->is_pic ? "@" : "",
+                           is->is_pic ? is->is_pic->pic_name : "",
+                           is->is_evname, is->is_flags, is->is_type,
+                           is->is_idtvec, is->is_minlevel, is->is_maxlevel);
+               }
+       }
+}
+#endif
Index: arch/amd64/amd64/lapic.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/lapic.c,v
retrieving revision 1.27
diff -u -p -r1.27 lapic.c
--- arch/amd64/amd64/lapic.c    20 Sep 2010 06:33:46 -0000      1.27
+++ arch/amd64/amd64/lapic.c    22 Oct 2011 17:50:07 -0000
@@ -65,6 +65,9 @@ struct evcount clk_count;
 #ifdef MULTIPROCESSOR
 struct evcount ipi_count;
 #endif
+struct evcount spur_count;
+struct evcount stray_count;
+struct evcount uhndl_count;
 
 void   lapic_delay(int);
 static u_int32_t lapic_gettick(void);
@@ -225,6 +228,7 @@ lapic_boot_init(paddr_t lapic_base)
 #ifdef MULTIPROCESSOR
        static u_int64_t ipi_irq = 0;
 #endif
+       static u_int64_t fake_irq = 0;
 
        lapic_map(lapic_base);
 
@@ -248,6 +252,9 @@ lapic_boot_init(paddr_t lapic_base)
 #ifdef MULTIPROCESSOR
        evcount_attach(&ipi_count, "ipi", &ipi_irq);
 #endif
+       evcount_attach(&spur_count, "spurious", &fake_irq);
+       evcount_attach(&stray_count, "stray", &fake_irq);
+       evcount_attach(&uhndl_count, "unhandled", &fake_irq);
 }
 
 static __inline u_int32_t
Index: arch/amd64/amd64/vector.S
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/vector.S,v
retrieving revision 1.31
diff -u -p -r1.31 vector.S
--- arch/amd64/amd64/vector.S   16 Jun 2011 19:46:40 -0000      1.31
+++ arch/amd64/amd64/vector.S   22 Oct 2011 17:50:07 -0000
@@ -178,6 +178,7 @@ IDTVEC(trap0d)
 IDTVEC(trap0e)
        TRAP(T_PAGEFLT)
 IDTVEC(intrspurious)
+       call    _C_LABEL(intr_spurious)
 IDTVEC(trap0f)
        iretq
 IDTVEC(trap10)
@@ -494,6 +495,8 @@ IDTVEC(intr_##name##num)                                    
        ;\
 4:     movq    IH_NEXT(%rbx),%rbx      /* next handler in chain */     ;\
        testq   %rbx,%rbx                                               ;\
        jnz     6b                                                      ;\
+       movq    $(num),%rdi                                             ;\
+       call    _C_LABEL(intr_unhandled)                                ;\
 5:                                                                     \
        UNLOCK_KERNEL                                                   ;\
        cli                                                             ;\
@@ -519,6 +522,8 @@ IDTVEC(intr_##name##num)                                    
        ;\
        sti                                                             ;\
        INTRFASTEXIT                                                    ;\
 9:                                                                     \
+       movq    $(num),%rdi                                             ;\
+       call    _C_LABEL(intr_stray)                                    ;\
        unmask(num)                                                     ;\
        late_ack(num)                                                   ;\
        sti                                                             ;\
Index: arch/amd64/include/intr.h
===================================================================
RCS file: /cvs/src/sys/arch/amd64/include/intr.h,v
retrieving revision 1.23
diff -u -p -r1.23 intr.h
--- arch/amd64/include/intr.h   16 Apr 2011 00:40:58 -0000      1.23
+++ arch/amd64/include/intr.h   22 Oct 2011 17:50:08 -0000
@@ -207,6 +207,9 @@ void intr_disestablish(struct intrhand *
 void cpu_intr_init(struct cpu_info *);
 int intr_find_mpmapping(int bus, int pin, int *handle);
 void intr_printconfig(void);
+void intr_spurious(void);
+void intr_stray(int);
+void intr_unhandled(int);
 
 #ifdef MULTIPROCESSOR
 int x86_send_ipi(struct cpu_info *, int);

OpenBSD 5.0-current (kernel) #101: Fri Nov  4 11:34:29 MSK 2011
    r...@watashi.plhk.ru:/usr/obj/kernel
real mem = 1876754432 (1789MB)
avail mem = 1812709376 (1728MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xf0920 (43 entries)
bios0: vendor LENOVO version "6XET47WW (1.30 )" date 12/30/2010
bios0: LENOVO 3508RL6
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP TCPA SSDT APIC MCFG HPET SLIC
acpi0: wakeup devices PB5_(S5) OHC0(S3) OHC1(S3) OHC2(S3) OHC3(S3) OHC4(S3) 
P2P_(S5) LID_(S3)
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Athlon(tm) Neo X2 Dual Core Processor L335, 1596.41 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,CX16,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 256KB 64b/line 
16-way L2 cache
cpu0: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu0: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD Athlon(tm) Neo X2 Dual Core Processor L335, 1596.00 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,CX16,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW
cpu1: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 256KB 64b/line 
16-way L2 cache
cpu1: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu1: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 21, 24 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-3
acpihpet0 at acpi0: 14318180 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (PB5_)
acpiprt2 at acpi0: bus 4 (P2P_)
acpiprt3 at acpi0: bus 1 (AGP_)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, PSS
acpicpu1 at acpi0: PSS
acpitz0 at acpi0: critical temperature is 92 degC
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi0: SLPB
acpithinkpad0 at acpi0
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT1 model "42T4785" serial   958 type LION oem "SANYO"
acpibtn2 at acpi0: LID_
cpu0: PowerNow! K8 1596 MHz: speeds: 1600 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "AMD RS780 Host" rev 0x00
ppb0 at pci0 dev 1 function 0 "AMD RS780 PCIE" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 5 function 0 "ATI Radeon HD 3200" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
radeondrm0 at vga1: apic 2 int 18
drm0 at radeondrm0
ppb1 at pci0 dev 5 function 0 "AMD RS780 PCIE" rev 0x00: msi
pci2 at ppb1 bus 2
re0 at pci2 dev 0 function 0 "Realtek 8168" rev 0x03: RTL8168D/8111D (0x2800), 
apic 2 int 17, address c8:0a:a9:cc:b0:01
rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 2
ahci0 at pci0 dev 17 function 0 "ATI SBx00 SATA" rev 0x00: apic 2 int 22, AHCI 
1.1
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, WDC WD2500BEVT-0, 02.0> SCSI3 0/direct 
fixed naa.50014ee204a69fb1
sd0: 238475MB, 512 bytes/sector, 488397168 sectors
ohci0 at pci0 dev 18 function 0 "ATI SB700 USB" rev 0x00: apic 2 int 16, 
version 1.0, legacy support
ohci1 at pci0 dev 18 function 1 "ATI SB700 USB" rev 0x00: apic 2 int 16, 
version 1.0, legacy support
ehci0 at pci0 dev 18 function 2 "ATI SB700 USB2" rev 0x00: apic 2 int 17
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "ATI EHCI root hub" rev 2.00/1.00 addr 1
ohci2 at pci0 dev 19 function 0 "ATI SB700 USB" rev 0x00: apic 2 int 18, 
version 1.0, legacy support
ehci1 at pci0 dev 19 function 2 "ATI SB700 USB2" rev 0x00: apic 2 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "ATI EHCI root hub" rev 2.00/1.00 addr 1
piixpm0 at pci0 dev 20 function 0 "ATI SBx00 SMBus" rev 0x3c: SMI
iic0 at piixpm0
spdmem0 at iic0 addr 0x51: 2GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
azalia0 at pci0 dev 20 function 2 "ATI SBx00 HD Audio" rev 0x00: apic 2 int 16
azalia0: codecs: Conexant/0x5066
audio0 at azalia0
pcib0 at pci0 dev 20 function 3 "ATI SB700 ISA" rev 0x00
ppb2 at pci0 dev 20 function 4 "ATI SB600 PCI" rev 0x00
pci3 at ppb2 bus 4
pchb1 at pci0 dev 24 function 0 "AMD AMD64 0Fh HyperTransport" rev 0x00
pchb2 at pci0 dev 24 function 1 "AMD AMD64 0Fh Address Map" rev 0x00
pchb3 at pci0 dev 24 function 2 "AMD AMD64 0Fh DRAM Cfg" rev 0x00
kate0 at pci0 dev 24 function 3 "AMD AMD64 0Fh Misc Cfg" rev 0x00: core rev 
BH-G2
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb4 at ohci2: USB revision 1.0
uhub4 at usb4 "ATI OHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
wsmouse1 at pms0 mux 0
pms0: Synaptics touchpad, firmware 7.4
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
mtrr: Pentium Pro MTRR support
umass0 at uhub1 port 1 configuration 1 interface 0 "Generic USB2.0-CRW" rev 
2.00/58.88 addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Generic-, Multi-Card, 1.00> SCSI0 0/direct 
removable serial.0bda0158114173400000
uvideo0 at uhub1 port 2 configuration 1 interface 0 "Image Processor Integrated 
Camera" rev 2.00/30.08 addr 3
video0 at uvideo0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (ef779c8e627ac39e.a) swap on sd0b dump on sd0b
sd2 at scsibus3 targ 1 lun 0: <OPENBSD, SR CRYPTO, 005> SCSI2 0/direct fixed
sd2: 206221MB, 512 bytes/sector, 422340976 sectors
softraid0: volume sd2 is roaming, it used to be sd1, updating metadata
Stopped at      Debugger+0x5:   leave   
ddb{0}> stray interrupts:
  0: 2789
  1: 3
  7: 2841
unhandled interrupts:
1: 142: pin 1@ioapic0 pin 1 flags 0 type 2 idtvec 145 levels 9/9
0x41
ddb{0}> pci1: performing msi suspend for 80012800
pci2: performing msi suspend for 80020000
pci1: performing msi resume for 80012800
pci2: performing msi resume for 80020000
sd1 detached
scsibus1 detached
umass0 detached
umass0 at uhub1 port 1 configuration 1 interface 0 "Generic USB2.0-CRW" rev 
2.00/58.88 addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Generic-, Multi-Card, 1.00> SCSI0 0/direct 
removable serial.0bda0158114173400000
video0 detached
uvideo0 detached
uvideo0 at uhub1 port 2 configuration 1 interface 0 "Image Processor Integrated 
Camera" rev 2.00/30.08 addr 3
video0 at uvideo0
Stopped at      Debugger+0x5:   leave   
ddb{0}> stray interrupts:
  0: 5122
  1: 8
  7: 5275
unhandled interrupts:
1: 238: pin 1@ioapic0 pin 1 flags 0 type 2 idtvec 145 levels 9/9
11: 19: pin 22@ioapic0 pin 22 flags 0 type 3 idtvec 97 levels 6/6
0x42
ddb{0}> umass1 at uhub0 port 2 configuration 1 interface 0 "COWON Systems, Inc. 
iAUDIO 7" rev 2.00/1.00 addr 2
umass1: using SCSI over Bulk-Only
scsibus4 at umass1: 2 targets, initiator 0
sd3 at scsibus4 targ 1 lun 0: <COWON, iAUDIO 7, 0100> SCSI0 0/direct removable 
serial.0e2107500013D304E8A7
sd3: 3896MB, 512 bytes/sector, 7979008 sectors

-- 
Alexander Polakov | plhk.ru

Reply via email to