I've got a problem. When I suspend my laptop (Lenovo X100e, dmesg
below), it suspends just fine, and resumes well too (thanks for that!).
But after resume I see high interrupt rates (like 77%) in top and
vmstat, it feels slower and fan never stops. Any ideas?

% top:

CPU0 states:  0.8% user,  0.0% nice,  0.6% system, 83.6% interrupt, 15.0% idle
CPU1 states:  3.6% user,  0.0% nice,  3.4% system,  0.0% interrupt, 93.0% idle

% vmstat -iv
interrupt                       total     rate
irq0/clock                     185246      199
irq0/ipi                       225445      242
irq0/ipi_nop                   216556      232
irq0/ipi_flushfp                   32        0
irq0/ipi_synchfp                 8746        9
irq0/ipi_mtrr                       1        0
irq0/ipi_setperf                  110        0
irq144/acpi0                     1160        1
irq99/re0                        6380        6
irq97/ahci0                     11188       12
irq98/ohci0                         1        0
irq98/ohci1                         1        0
irq100/ohci2                        1        0
irq101/ehci1                      260        0
irq98/azalia0                   25407       27
irq145/pckbc0                    3023        3
irq146/pckbc0                    3826        4
Total                          687383      739

(I hacked ipi.c a bit to get this output, patch below).

Index: amd64/amd64/ipi.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/ipi.c,v
retrieving revision 1.10
diff -u -p -r1.10 ipi.c
--- amd64/amd64/ipi.c   27 Dec 2010 20:22:23 -0000      1.10
+++ amd64/amd64/ipi.c   16 Oct 2011 21:55:18 -0000
@@ -101,6 +101,7 @@ void
 x86_ipi_handler(void)
 {
        extern struct evcount ipi_count;
+       extern struct evcount ipi_perfunc[X86_NIPI];
        struct cpu_info *ci = curcpu();
        u_int32_t pending;
        int bit;
@@ -111,6 +112,7 @@ x86_ipi_handler(void)
                if (pending & (1<<bit)) {
                        pending &= ~(1<<bit);
                        (*ipifunc[bit])(ci);
+                       ipi_perfunc[bit].ec_count++;
                        ipi_count.ec_count++;
                }
        }
Index: 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
--- amd64/amd64/lapic.c 20 Sep 2010 06:33:46 -0000      1.27
+++ amd64/amd64/lapic.c 16 Oct 2011 21:55:18 -0000
@@ -64,6 +64,7 @@
 struct evcount clk_count;
 #ifdef MULTIPROCESSOR
 struct evcount ipi_count;
+struct evcount ipi_perfunc[X86_NIPI];
 #endif
 
 void   lapic_delay(int);
@@ -247,6 +248,15 @@ lapic_boot_init(paddr_t lapic_base)
        evcount_attach(&clk_count, "clock", &clk_irq);
 #ifdef MULTIPROCESSOR
        evcount_attach(&ipi_count, "ipi", &ipi_irq);
+       /* per function counters */
+       evcount_attach(&ipi_perfunc[0], "ipi_halt", &ipi_irq);
+       evcount_attach(&ipi_perfunc[1], "ipi_nop", &ipi_irq);
+       evcount_attach(&ipi_perfunc[2], "ipi_flushfpu", &ipi_irq);
+       evcount_attach(&ipi_perfunc[3], "ipi_synchfpu", &ipi_irq);
+       evcount_attach(&ipi_perfunc[4], "ipi_NULL", &ipi_irq);
+       evcount_attach(&ipi_perfunc[5], "ipi_mtrr", &ipi_irq);
+       evcount_attach(&ipi_perfunc[6], "ipi_setperf", &ipi_irq);
+       evcount_attach(&ipi_perfunc[7], "ipi_ddb", &ipi_irq);
 #endif
 }

% dmesg

OpenBSD 5.0-current (kernel) #31: Mon Oct 17 01:35:15 MSK 2011
    r...@watashi.plhk.ru:/usr/obj/kernel
real mem = 1876754432 (1789MB)
avail mem = 1812717568 (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.97 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
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

-- 
Alexander Polakov | plhk.ru

Reply via email to