# Disk access puts CPU usage up to 100%

## wilsonsamm

I did a quick test, because I suspected something was not right:

```
for i in 1 2 3 4 5 6 7 8 9 0; 

do 

hdparm -Tt /dev/sda; 

done

```

And, the speeds are very good. A typical output was this:

```
/dev/sda:

 Timing cached reads:   442 MB in  2.00 seconds = 220.51 MB/sec

 Timing buffered disk reads:  140 MB in  3.02 seconds =  46.38 MB/sec
```

But whenever hdparm was accessing the disk, I saw the CPU usage shot up to 100%, and went right back down to 7% or so. What is the reason for this? How can I begin to debug if DMA is being used etc?

```
# hdparm -i /dev/sda

/dev/sda:

 Model=SAMSUNG, FwRev=LQ100-10, SerialNo=S12TJDRZ346224

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=16383/16/63, TrkSize=34902, SectSize=554, ECCbytes=4

 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=312581808

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 

 AdvancedPM=yes: disabled (255) WriteCache=enabled

 Drive conforms to: ATA/ATAPI-7 T13 1532D revision 0:  ATA/ATAPI-1,2,3,4,5,6,7

 * signifies the current active mode

```

It says UDMA5 is being used. If I understand correctly, DMA means the CPU needs to do barely any work to get data off the disk because the copying of data to memory is done by some other subsystem of the computer. But then, how to explain those spikes in CPU load?

----------

## eccerr0r

Does it do the same removing hdparm's -T (capital T) option?

hdparm -T, since it's a cache read, will pound the CPU hard.

----------

## wilsonsamm

 *eccerr0r wrote:*   

> Does it do the same removing hdparm's -T (capital T) option?
> 
> hdparm -T, since it's a cache read, will pound the CPU hard.

 

It did the same thing, minus the -T. I started the process and watched the CPU usage again and again shoot up to 100% and drop right down to round 10%.

----------

## chithanh

Check "dmesg" and "lspci -k" whether you are using the proper driver for your SATA chipset.

----------

## wilsonsamm

```
Linux version 2.6.35-gentoo-r4 (root@jennywren) (gcc version 4.4.3 (Gentoo 4.4.3-r2 p1.2) ) #17 Fri Sep 24 17:26:32 MSD 2010

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009f400 (usable)

 BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000e6400 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 000000000fee0000 (usable)

 BIOS-e820: 000000000fee0000 - 000000000feefc00 (ACPI data)

 BIOS-e820: 000000000feefc00 - 000000000fef0000 (ACPI NVS)

 BIOS-e820: 000000000fef0000 - 000000000ff00000 (reserved)

 BIOS-e820: 000000000ff00000 - 000000000ff80000 (usable)

 BIOS-e820: 000000000ff80000 - 0000000010000000 (reserved)

 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)

Notice: NX (Execute Disable) protection missing in CPU or disabled in BIOS!

DMI 2.3 present.

e820 update range: 0000000000000000 - 0000000000001000 (usable) ==> (reserved)

e820 remove range: 00000000000a0000 - 0000000000100000 (usable)

last_pfn = 0xff80 max_arch_pfn = 0x100000

MTRR default type: uncachable

MTRR fixed ranges enabled:

  00000-9FFFF write-back

  A0000-BFFFF uncachable

  C0000-C7FFF write-protect

  C8000-EFFFF uncachable

  F0000-FFFFF write-protect

MTRR variable ranges enabled:

  0 base 000000000 mask FF0000000 write-back

  1 base 00FF80000 mask FFFF80000 uncachable

  2 disabled

  3 disabled

  4 disabled

  5 disabled

  6 disabled

  7 disabled

PAT not supported by CPU.

initial memory mapped : 0 - 01800000

init_memory_mapping: 0000000000000000-000000000ff80000

 0000000000 - 0000400000 page 4k

 0000400000 - 000fc00000 page 2M

 000fc00000 - 000ff80000 page 4k

kernel direct mapping tables up to ff80000 @ 7000-c000

ACPI: RSDP 000f62c0 00014 (v00 FUJ   )

ACPI: RSDT 0feeba06 00028 (v01 FUJ    RICKWOOD 01070000 FUJ  00001000)

ACPI: FACP 0feefb8c 00074 (v01 FUJ    RICKWOOD 01070000 FUJ  00001000)

ACPI: DSDT 0feeba2e 0415E (v01 FUJ    RICKWOOD 01070000 MSFT 01000007)

ACPI: FACS 0feeffc0 00040

255MB LOWMEM available.

  mapped low ram: 0 - 0ff80000

  low ram: 0 - 0ff80000

  node 0 low ram: 00000000 - 0ff80000

  node 0 bootmap 00005000 - 00006ff0

(6/32 early reservations) ==> bootmem [0000000000 - 000ff80000]

  #0 [0001000000 - 00015b6f90]    TEXT DATA BSS ==> [0001000000 - 00015b6f90]

  #1 [000009f400 - 0000100000]    BIOS reserved ==> [000009f400 - 0000100000]

  #2 [00015b7000 - 00015bd0c9]              BRK ==> [00015b7000 - 00015bd0c9]

  #3 [0000001000 - 0000005000]      ACPI WAKEUP ==> [0000001000 - 0000005000]

  #4 [0000007000 - 0000008000]          PGTABLE ==> [0000007000 - 0000008000]

  #5 [0000005000 - 0000007000]          BOOTMAP ==> [0000005000 - 0000007000]

Zone PFN ranges:

  DMA      0x00000001 -> 0x00001000

  Normal   0x00001000 -> 0x0000ff80

Movable zone start PFN for each node

early_node_map[3] active PFN ranges

    0: 0x00000001 -> 0x0000009f

    0: 0x00000100 -> 0x0000fee0

    0: 0x0000ff00 -> 0x0000ff80

On node 0 totalpages: 65278

free_area_init_node: node 0, pgdat c1539988, node_mem_map c15be020

  DMA zone: 32 pages used for memmap

  DMA zone: 0 pages reserved

  DMA zone: 3966 pages, LIFO batch:0

  Normal zone: 479 pages used for memmap

  Normal zone: 60801 pages, LIFO batch:15

ACPI: PM-Timer IO Port: 0xfc08

PM: Registered nosave memory: 000000000009f000 - 00000000000a0000

PM: Registered nosave memory: 00000000000a0000 - 00000000000e7000

PM: Registered nosave memory: 00000000000e7000 - 0000000000100000

PM: Registered nosave memory: 000000000fee0000 - 000000000feef000

PM: Registered nosave memory: 000000000feef000 - 000000000fef0000

PM: Registered nosave memory: 000000000fef0000 - 000000000ff00000

Allocating PCI resources starting at 10000000 (gap: 10000000:eff00000)

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64767

Kernel command line: root=/dev/sda1 ro

PID hash table entries: 1024 (order: 0, 4096 bytes)

Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Initializing CPU#0

Memory: 252964k/261632k available (3657k kernel code, 8148k reserved, 1712k data, 284k init, 0k highmem)

virtual kernel memory layout:

    fixmap  : 0xfffe4000 - 0xfffff000   ( 108 kB)

    vmalloc : 0xd0780000 - 0xfffe2000   ( 760 MB)

    lowmem  : 0xc0000000 - 0xcff80000   ( 255 MB)

      .init : 0xc153f000 - 0xc1586000   ( 284 kB)

      .data : 0xc1392644 - 0xc153e798   (1712 kB)

      .text : 0xc1000000 - 0xc1392644   (3657 kB)

Checking if this processor honours the WP bit even in supervisor mode...Ok.

SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

NR_IRQS:16

Console: colour VGA+ 80x25

console [tty0] enabled

Fast TSC calibration using PIT

Detected 930.257 MHz processor.

Calibrating delay loop (skipped), value calculated using timer frequency.. 1861.03 BogoMIPS (lpj=3100856)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

mce: CPU supports 5 MCE banks

Performance Events: 

no APIC, boot with the "lapic" boot parameter to force-enable it.

no hardware sampling interrupt available.

p6 PMU driver.

... version:                0

... bit width:              32

... generic registers:      2

... value mask:             00000000ffffffff

... max period:             000000007fffffff

... fixed-purpose events:   0

... event mask:             0000000000000003

CPU: Intel(R) Pentium(R) III Mobile CPU       933MHz stepping 01

ACPI: Core revision 20100428

ACPI: setting ELCR to 0200 (from 0800)

NET: Registered protocol family 16

ACPI: bus type pci registered

PCI: PCI BIOS revision 2.10 entry at 0xfd97e, last bus=4

PCI: Using configuration type 1 for base access

bio: create slab <bio-0> at 0

ACPI: EC: Look up EC in DSDT

ACPI: Interpreter enabled

ACPI: (supports S0 S4 S5)

ACPI: Using PIC for interrupt routing

ACPI: EC: GPE = 0x17, I/O: command/status = 0x66, data = 0x62

PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug

ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])

pci_root PNP0A03:00: host bridge window [io  0x0000-0x0cf7] (ignored)

pci_root PNP0A03:00: host bridge window [io  0x0d00-0xffff] (ignored)

pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff] (ignored)

pci_root PNP0A03:00: host bridge window [mem 0x000ce000-0x000e3fff] (ignored)

pci_root PNP0A03:00: host bridge window [mem 0x10000000-0xfebfffff] (ignored)

pci 0000:00:00.0: reg 10: [mem 0xe0000000-0xefffffff pref]

pci 0000:00:1d.0: reg 20: [io  0x1c00-0x1c1f]

pci 0000:00:1d.2: reg 20: [io  0x1c20-0x1c3f]

pci 0000:00:1f.0: quirk: [io  0xfc00-0xfc7f] claimed by ICH4 ACPI/GPIO/TCO

pci 0000:00:1f.0: quirk: [io  0xfc80-0xfcbf] claimed by ICH4 GPIO

pci 0000:00:1f.1: reg 10: [io  0x01f0-0x01f7]

pci 0000:00:1f.1: reg 14: [io  0x03f4-0x03f7]

pci 0000:00:1f.1: reg 18: [io  0x0170-0x0177]

pci 0000:00:1f.1: reg 1c: [io  0x0374-0x0377]

pci 0000:00:1f.1: reg 20: [io  0x18e0-0x18ef]

pci 0000:00:1f.1: reg 24: [mem 0xd0000000-0xd00003ff]

pci 0000:00:1f.3: reg 20: [io  0x18c0-0x18df]

pci 0000:00:1f.5: reg 10: [io  0x1000-0x10ff]

pci 0000:00:1f.5: reg 14: [io  0x1880-0x18bf]

pci 0000:00:1f.6: reg 10: [io  0x1400-0x14ff]

pci 0000:00:1f.6: reg 14: [io  0x1800-0x187f]

pci 0000:01:00.0: reg 10: [mem 0xd8000000-0xdfffffff pref]

pci 0000:01:00.0: reg 14: [io  0x2000-0x20ff]

pci 0000:01:00.0: reg 18: [mem 0xd0100000-0xd010ffff]

pci 0000:01:00.0: reg 30: [mem 0x00000000-0x0001ffff pref]

pci 0000:01:00.0: supports D1 D2

pci 0000:00:01.0: PCI bridge to [bus 01-01]

pci 0000:00:01.0:   bridge window [io  0x2000-0x2fff]

pci 0000:00:01.0:   bridge window [mem 0xd0100000-0xd01fffff]

pci 0000:00:01.0:   bridge window [mem 0xd8000000-0xdfffffff pref]

pci 0000:02:0a.0: reg 10: [mem 0x00000000-0x00000fff]

pci 0000:02:0a.0: supports D1 D2

pci 0000:02:0a.0: PME# supported from D0 D1 D2 D3hot D3cold

pci 0000:02:0a.0: PME# disabled

pci 0000:02:0a.1: reg 10: [mem 0x00000000-0x00000fff]

pci 0000:02:0a.1: supports D1 D2

pci 0000:02:0a.1: PME# supported from D0 D1 D2 D3hot D3cold

pci 0000:02:0a.1: PME# disabled

pci 0000:02:0d.0: reg 10: [io  0x3000-0x30ff]

pci 0000:02:0d.0: reg 14: [mem 0xd0200000-0xd02000ff]

pci 0000:02:0d.0: supports D1 D2

pci 0000:02:0d.0: PME# supported from D1 D2 D3hot D3cold

pci 0000:02:0d.0: PME# disabled

pci 0000:00:1e.0: PCI bridge to [bus 02-04] (subtractive decode)

pci 0000:00:1e.0:   bridge window [io  0x3000-0x3fff]

pci 0000:00:1e.0:   bridge window [mem 0xd0200000-0xd02fffff]

pci 0000:00:1e.0:   bridge window [mem 0xfff00000-0x000fffff pref] (disabled)

pci 0000:00:1e.0:   bridge window [io  0x0000-0xffff] (subtractive decode)

pci 0000:00:1e.0:   bridge window [mem 0x00000000-0xffffffff] (subtractive decode)

pci_bus 0000:04: [bus 04-07] partially hidden behind transparent bridge 0000:02 [bus 02-04]

pci_bus 0000:00: on NUMA node 0

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGP_._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.HUB_._PRT]

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 10 *11)

ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 9 10 *11)

ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 9 10 *11)

ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 11) *0, disabled.

ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 9 10 11) *0, disabled.

ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 9 10 11) *0, disabled.

ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 9 10 11) *0, disabled.

ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 7 9 10 11) *0, disabled.

vgaarb: device added: PCI:0000:01:00.0,decodes=io+mem,owns=io+mem,locks=none

vgaarb: loaded

SCSI subsystem initialized

libata version 3.00 loaded.

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

PCI: Using ACPI for IRQ routing

PCI: pci_cache_line_size set to 32 bytes

reserve RAM buffer: 000000000009f400 - 000000000009ffff 

reserve RAM buffer: 000000000fee0000 - 000000000fffffff 

reserve RAM buffer: 000000000ff80000 - 000000000fffffff 

cfg80211: Calling CRDA to update world regulatory domain

Switching to clocksource tsc

pnp: PnP ACPI init

ACPI: bus type pnp registered

pnp: PnP ACPI: found 13 devices

ACPI: ACPI bus type pnp unregistered

system 00:01: [io  0x04d0-0x04d1] has been reserved

system 00:01: [io  0xf800-0xf87f] has been reserved

system 00:01: [io  0xf880-0xf8ff] has been reserved

system 00:01: [io  0xfd00-0xfd6f] has been reserved

system 00:01: [io  0xfe00] has been reserved

system 00:01: [io  0xfc00-0xfc7f] has been reserved

system 00:01: [io  0xfc80-0xfcbf] has been reserved

system 00:01: [io  0xfcc0-0xfcc7] has been reserved

system 00:01: [mem 0x000ce000-0x000cffff] has been reserved

pci 0000:00:1e.0: BAR 9: assigned [mem 0x10000000-0x17ffffff pref]

pci 0000:01:00.0: BAR 6: assigned [mem 0xd0120000-0xd013ffff pref]

pci 0000:00:01.0: PCI bridge to [bus 01-01]

pci 0000:00:01.0:   bridge window [io  0x2000-0x2fff]

pci 0000:00:01.0:   bridge window [mem 0xd0100000-0xd01fffff]

pci 0000:00:01.0:   bridge window [mem 0xd8000000-0xdfffffff pref]

pci 0000:02:0a.0: BAR 9: assigned [mem 0x10000000-0x13ffffff pref]

pci 0000:02:0a.0: BAR 10: assigned [mem 0x18000000-0x1bffffff]

pci 0000:02:0a.1: BAR 9: assigned [mem 0x14000000-0x17ffffff pref]

pci 0000:02:0a.1: BAR 10: assigned [mem 0x1c000000-0x1fffffff]

pci 0000:02:0a.0: BAR 0: assigned [mem 0xd0201000-0xd0201fff]

pci 0000:02:0a.0: BAR 0: set to [mem 0xd0201000-0xd0201fff] (PCI address [0xd0201000-0xd0201fff]

pci 0000:02:0a.1: BAR 0: assigned [mem 0xd0202000-0xd0202fff]

pci 0000:02:0a.1: BAR 0: set to [mem 0xd0202000-0xd0202fff] (PCI address [0xd0202000-0xd0202fff]

pci 0000:02:0a.0: BAR 7: assigned [io  0x3400-0x34ff]

pci 0000:02:0a.0: BAR 8: assigned [io  0x3800-0x38ff]

pci 0000:02:0a.1: BAR 7: assigned [io  0x3c00-0x3cff]

pci 0000:02:0a.1: BAR 8: assigned [io  0x4000-0x40ff]

pci 0000:02:0a.0: CardBus bridge to [bus 03-03]

pci 0000:02:0a.0:   bridge window [io  0x3400-0x34ff]

pci 0000:02:0a.0:   bridge window [io  0x3800-0x38ff]

pci 0000:02:0a.0:   bridge window [mem 0x10000000-0x13ffffff pref]

pci 0000:02:0a.0:   bridge window [mem 0x18000000-0x1bffffff]

pci 0000:02:0a.1: CardBus bridge to [bus 04-07]

pci 0000:02:0a.1:   bridge window [io  0x3c00-0x3cff]

pci 0000:02:0a.1:   bridge window [io  0x4000-0x40ff]

pci 0000:02:0a.1:   bridge window [mem 0x14000000-0x17ffffff pref]

pci 0000:02:0a.1:   bridge window [mem 0x1c000000-0x1fffffff]

pci 0000:00:1e.0: PCI bridge to [bus 02-04]

pci 0000:00:1e.0:   bridge window [io  0x3000-0x3fff]

pci 0000:00:1e.0:   bridge window [mem 0xd0200000-0xd02fffff]

pci 0000:00:1e.0:   bridge window [mem 0x10000000-0x17ffffff pref]

pci 0000:00:1e.0: setting latency timer to 64

ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11

PCI: setting IRQ 11 as level-triggered

pci 0000:02:0a.0: PCI INT A -> Link[LNKA] -> GSI 11 (level, low) -> IRQ 11

ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11

pci 0000:02:0a.1: PCI INT B -> Link[LNKB] -> GSI 11 (level, low) -> IRQ 11

pci_bus 0000:00: resource 0 [io  0x0000-0xffff]

pci_bus 0000:00: resource 1 [mem 0x00000000-0xffffffff]

pci_bus 0000:01: resource 0 [io  0x2000-0x2fff]

pci_bus 0000:01: resource 1 [mem 0xd0100000-0xd01fffff]

pci_bus 0000:01: resource 2 [mem 0xd8000000-0xdfffffff pref]

pci_bus 0000:02: resource 0 [io  0x3000-0x3fff]

pci_bus 0000:02: resource 1 [mem 0xd0200000-0xd02fffff]

pci_bus 0000:02: resource 2 [mem 0x10000000-0x17ffffff pref]

pci_bus 0000:02: resource 4 [io  0x0000-0xffff]

pci_bus 0000:02: resource 5 [mem 0x00000000-0xffffffff]

pci_bus 0000:03: resource 0 [io  0x3400-0x34ff]

pci_bus 0000:03: resource 1 [io  0x3800-0x38ff]

pci_bus 0000:03: resource 2 [mem 0x10000000-0x13ffffff pref]

pci_bus 0000:03: resource 3 [mem 0x18000000-0x1bffffff]

pci_bus 0000:04: resource 0 [io  0x3c00-0x3cff]

pci_bus 0000:04: resource 1 [io  0x4000-0x40ff]

pci_bus 0000:04: resource 2 [mem 0x14000000-0x17ffffff pref]

pci_bus 0000:04: resource 3 [mem 0x1c000000-0x1fffffff]

NET: Registered protocol family 2

IP route cache hash table entries: 2048 (order: 1, 8192 bytes)

TCP established hash table entries: 8192 (order: 4, 65536 bytes)

TCP bind hash table entries: 8192 (order: 3, 32768 bytes)

TCP: Hash tables configured (established 8192 bind 8192)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

pci 0000:01:00.0: Boot video device

PCI: CLS 32 bytes, default 32

HugeTLB registered 4 MB page size, pre-allocated 0 pages

VFS: Disk quotas dquot_6.5.2

Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)

JFS: nTxBlock = 1976, nTxLock = 15810

msgmni has been set to 494

Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)

io scheduler noop registered (default)

pci_hotplug: PCI Hot Plug PCI Core version: 0.5

Intel 82802 RNG detected

Linux agpgart interface v0.103

agpgart-intel 0000:00:00.0: Intel 830M Chipset

agpgart-intel 0000:00:00.0: AGP aperture is 256M @ 0xe0000000

ACPI: AC Adapter [AC] (on-line)

input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0

ACPI: Power Button [PWRB]

input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input1

ACPI: Lid Switch [LID]

input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2

ACPI: Power Button [PWRF]

ACPI: acpi_idle registered with cpuidle

Marking TSC unstable due to TSC halts in idle

Switching to clocksource acpi_pm

Switched to NOHz mode on CPU #0

[drm] Initialized drm 1.1.0 20060810

[drm] radeon defaulting to userspace modesetting.

pci 0000:01:00.0: PCI INT A -> Link[LNKA] -> GSI 11 (level, low) -> IRQ 11

ACPI: Battery Slot [CMB1] (battery present)

ACPI: Battery Slot [CMB2] (battery absent)

[drm] Initialized radeon 1.33.0 20080528 for 0000:01:00.0 on minor 0

brd: module loaded

loop: module loaded

ata_piix 0000:00:1f.1: version 2.13

ata_piix 0000:00:1f.1: power state changed by ACPI to D0

ata_piix 0000:00:1f.1: power state changed by ACPI to D0

ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11

ata_piix 0000:00:1f.1: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11

ata_piix 0000:00:1f.1: setting latency timer to 64

scsi0 : ata_piix

scsi1 : ata_piix

ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x18e0 irq 14

ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x18e8 irq 15

Atheros(R) L2 Ethernet Driver - version 2.2.3

Copyright (c) 2007 Atheros Corporation.

e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI

e100: Copyright(c) 1999-2006 Intel Corporation

8139cp: 8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)

8139cp 0000:02:0d.0: This (id 10ec:8139 rev 10) is not an 8139C+ compatible chip, use 8139too

8139too: 8139too Fast Ethernet driver 0.9.28

8139too 0000:02:0d.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11

8139too 0000:02:0d.0: eth0: RealTek RTL8139 at 0x3000, 00:e0:00:5c:0d:b7, IRQ 11

yenta_cardbus 0000:02:0a.0: CardBus bridge found [10cf:10e6]

yenta_cardbus 0000:02:0a.0: O2: disabling read prefetch/write burst

ata2.00: ATAPI: NEC CD-ROM DRIVE:282, 5.d3, max UDMA/33

ata1.00: ATA-8: SAMSUNG HM160HC, LQ100-10, max UDMA/100

ata1.00: 312581808 sectors, multi 16: LBA48 

ata2.00: configured for UDMA/33

ata1.00: configured for UDMA/100

scsi 0:0:0:0: Direct-Access     ATA      SAMSUNG HM160HC  LQ10 PQ: 0 ANSI: 5

sd 0:0:0:0: [sda] 312581808 512-byte logical blocks: (160 GB/149 GiB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

 sda:

sd 0:0:0:0: Attached scsi generic sg0 type 0

scsi 1:0:0:0: CD-ROM            NEC      CD-ROM DRIVE:282 5.d3 PQ: 0 ANSI: 5

sr0: scsi3-mmc drive: 24x/24x cd/rw xa/form2 cdda tray

Uniform CD-ROM driver Revision: 3.20

sr 1:0:0:0: Attached scsi CD-ROM sr0

sr 1:0:0:0: Attached scsi generic sg1 type 5

 sda1 sda2 sda3 sda4

sd 0:0:0:0: [sda] Attached SCSI disk

yenta_cardbus 0000:02:0a.0: ISA IRQ mask 0x04b8, PCI irq 11

yenta_cardbus 0000:02:0a.0: Socket status: 30000006

yenta_cardbus 0000:02:0a.1: CardBus bridge found [10cf:10e6]

yenta_cardbus 0000:02:0a.1: ISA IRQ mask 0x04b8, PCI irq 11

yenta_cardbus 0000:02:0a.1: Socket status: 30000006

pci_bus 0000:02: Raising subordinate bus# of parent bus (#02) from #04 to #07

uhci_hcd: USB Universal Host Controller Interface driver

uhci_hcd 0000:00:1d.0: enabling device (0000 -> 0001)

uhci_hcd 0000:00:1d.0: PCI INT A -> Link[LNKA] -> GSI 11 (level, low) -> IRQ 11

uhci_hcd 0000:00:1d.0: setting latency timer to 64

uhci_hcd 0000:00:1d.0: UHCI Host Controller

drivers/usb/core/inode.c: creating file 'devices'

drivers/usb/core/inode.c: creating file '001'

uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 1

uhci_hcd 0000:00:1d.0: detected 2 ports

uhci_hcd 0000:00:1d.0: uhci_check_and_reset_hc: legsup = 0x2f00

uhci_hcd 0000:00:1d.0: Performing full reset

uhci_hcd 0000:00:1d.0: irq 11, io base 0x00001c00

usb usb1: default language 0x0409

usb usb1: udev 1, busnum 1, minor = 0

usb usb1: New USB device found, idVendor=1d6b, idProduct=0001

usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

usb usb1: Product: UHCI Host Controller

usb usb1: Manufacturer: Linux 2.6.35-gentoo-r4 uhci_hcd

usb usb1: SerialNumber: 0000:00:1d.0

usb usb1: usb_probe_device

usb usb1: configuration #1 chosen from 1 choice

usb usb1: adding 1-0:1.0 (config #1, interface 0)

hub 1-0:1.0: usb_probe_interface

hub 1-0:1.0: usb_probe_interface - got id

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

hub 1-0:1.0: standalone hub

hub 1-0:1.0: no power switching (usb 1.0)

hub 1-0:1.0: individual port over-current protection

hub 1-0:1.0: power on to power good time: 2ms

hub 1-0:1.0: local power source is good

hub 1-0:1.0: trying to enable port power on non-switchable hub

drivers/usb/core/inode.c: creating file '001'

uhci_hcd 0000:00:1d.2: enabling device (0000 -> 0001)

uhci_hcd 0000:00:1d.2: PCI INT C -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11

uhci_hcd 0000:00:1d.2: setting latency timer to 64

uhci_hcd 0000:00:1d.2: UHCI Host Controller

drivers/usb/core/inode.c: creating file '002'

uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 2

uhci_hcd 0000:00:1d.2: detected 2 ports

uhci_hcd 0000:00:1d.2: uhci_check_and_reset_hc: legsup = 0x2000

uhci_hcd 0000:00:1d.2: Performing full reset

uhci_hcd 0000:00:1d.2: irq 11, io base 0x00001c20

usb usb2: default language 0x0409

usb usb2: udev 1, busnum 2, minor = 128

usb usb2: New USB device found, idVendor=1d6b, idProduct=0001

usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1

usb usb2: Product: UHCI Host Controller

usb usb2: Manufacturer: Linux 2.6.35-gentoo-r4 uhci_hcd

usb usb2: SerialNumber: 0000:00:1d.2

usb usb2: usb_probe_device

usb usb2: configuration #1 chosen from 1 choice

usb usb2: adding 2-0:1.0 (config #1, interface 0)

hub 2-0:1.0: usb_probe_interface

hub 2-0:1.0: usb_probe_interface - got id

hub 2-0:1.0: USB hub found

hub 2-0:1.0: 2 ports detected

hub 2-0:1.0: standalone hub

hub 2-0:1.0: no power switching (usb 1.0)

hub 2-0:1.0: individual port over-current protection

hub 2-0:1.0: power on to power good time: 2ms

hub 2-0:1.0: local power source is good

hub 2-0:1.0: trying to enable port power on non-switchable hub

drivers/usb/core/inode.c: creating file '001'

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

usbcore: registered new interface driver libusual

usbcore: registered new interface driver ums-alauda

usbcore: registered new interface driver ums-cypress

usbcore: registered new interface driver ums-datafab

usbcore: registered new interface driver ums-freecom

usbcore: registered new interface driver ums-isd200

usbcore: registered new interface driver ums-jumpshot

usbcore: registered new interface driver ums-karma

usbcore: registered new interface driver ums-onetouch

usbcore: registered new interface driver ums-sddr09

usbcore: registered new interface driver ums-sddr55

usbcore: registered new interface driver ums-usbat

PNP: PS/2 Controller [PNP0303:KBC,PNP0f13:PS2M] at 0x60,0x64 irq 1,12

serio: i8042 KBD port at 0x60,0x64 irq 1

serio: i8042 AUX port at 0x60,0x64 irq 12

mice: PS/2 mouse device common for all mice

rtc_cmos 00:04: rtc core: registered rtc_cmos as rtc0

rtc0: alarms up to one month, y3k, 114 bytes nvram

i801_smbus 0000:00:1f.3: PCI INT B -> Link[LNKB] -> GSI 11 (level, low) -> IRQ 11

cpuidle: using governor ladder

cpuidle: using governor menu

usbcore: registered new interface driver hiddev

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

Netfilter messages via NETLINK v0.30.

nf_conntrack version 0.5.0 (3952 buckets, 15808 max)

ctnetlink v0.93: registering with nfnetlink.

ip_tables: (C) 2000-2006 Netfilter Core Team

TCP cubic registered

Initializing XFRM netlink socket

NET: Registered protocol family 10

ip6_tables: (C) 2000-2006 Netfilter Core Team

IPv6 over IPv4 tunneling driver

NET: Registered protocol family 17

input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input3

uhci_hcd 0000:00:1d.0: port 2 portsc 01ab,00

hub 1-0:1.0: port 2: status 0301 change 0003

hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0000

hub 1-0:1.0: state 7 ports 2 chg 0004 evt 0000

hub 1-0:1.0: port 2, status 0301, change 0000, 1.5 Mb/s

usb 1-2: new low speed USB device using uhci_hcd and address 2

input: PS/2 Mouse as /devices/platform/i8042/serio1/input/input4

input: AlpsPS/2 ALPS GlidePoint as /devices/platform/i8042/serio1/input/input5

VFS: Mounted root (jfs filesystem) readonly on device 8:1.

Freeing unused kernel memory: 284k freed

usb 1-2: skipped 1 descriptor after interface

usb 1-2: default language 0x0409

usb 1-2: udev 2, busnum 1, minor = 1

usb 1-2: New USB device found, idVendor=046d, idProduct=c00e

usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0

usb 1-2: Product: USB-PS/2 Optical Mouse

usb 1-2: Manufacturer: Logitech

usb 1-2: usb_probe_device

usb 1-2: configuration #1 chosen from 1 choice

usb 1-2: adding 1-2:1.0 (config #1, interface 0)

usbhid 1-2:1.0: usb_probe_interface

usbhid 1-2:1.0: usb_probe_interface - got id

input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/input/input6

generic-usb 0003:046D:C00E.0001: input,hidraw0: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:1d.0-2/input0

drivers/usb/core/inode.c: creating file '002'

usb usb2: suspend_rh (auto-stop)

udev: starting version 151

Intel ICH 0000:00:1f.5: PCI INT B -> Link[LNKB] -> GSI 11 (level, low) -> IRQ 11

Intel ICH 0000:00:1f.5: setting latency timer to 64

intel8x0_measure_ac97_clock: measured 52730 usecs (2534 samples)

intel8x0: clocking to 48000

Adding 996024k swap on /dev/sda3.  Priority:-1 extents:1 across:996024k 

eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

eth0: no IPv6 routers present

agpgart-intel 0000:00:00.0: AGP 2.0 bridge

agpgart-intel 0000:00:00.0: putting AGP V2 device into 4x mode

pci 0000:01:00.0: putting AGP V2 device into 4x mode

[drm] Setting GART location based on new memory map

[drm] Loading R100 Microcode

[drm] writeback test succeeded in 1 usecs

uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 93 us

uhci_hcd 0000:00:1d.0: release dev 2 ep81-INT, period 8, phase 4, 93 us

uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 93 us

process `skype' is using obsolete setsockopt SO_BSDCOMPAT

```

That was my dmesg. I didn't spot anything, can you? And here is my lspci -k:

```
00:00.0 Host bridge: Intel Corporation 82830 830 Chipset Host Bridge (rev 02)

   Subsystem: Fujitsu Limited. Device 113b

   Kernel driver in use: agpgart-intel

00:01.0 PCI bridge: Intel Corporation 82830 830 Chipset AGP Bridge (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801CA/CAM USB Controller #1 (rev 01)

   Subsystem: Fujitsu Limited. Device 113d

   Kernel driver in use: uhci_hcd

00:1d.2 USB Controller: Intel Corporation 82801CA/CAM USB Controller #3 (rev 01)

   Subsystem: Fujitsu Limited. Device 113d

   Kernel driver in use: uhci_hcd

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 41)

00:1f.0 ISA bridge: Intel Corporation 82801CAM ISA Bridge (LPC) (rev 01)

00:1f.1 IDE interface: Intel Corporation 82801CAM IDE U100 Controller (rev 01)

   Subsystem: Fujitsu Limited. Device 113d

   Kernel driver in use: ata_piix

00:1f.3 SMBus: Intel Corporation 82801CA/CAM SMBus Controller (rev 01)

   Subsystem: Fujitsu Limited. Device 113d

   Kernel driver in use: i801_smbus

00:1f.5 Multimedia audio controller: Intel Corporation 82801CA/CAM AC'97 Audio Controller (rev 01)

   Subsystem: Fujitsu Limited. Device 1099

   Kernel driver in use: Intel ICH

   Kernel modules: snd-intel8x0

00:1f.6 Modem: Intel Corporation 82801CA/CAM AC'97 Modem Controller (rev 01)

   Subsystem: Fujitsu Limited. Device 10d1

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY

   Subsystem: Fujitsu Limited. Device 113e

02:0a.0 CardBus bridge: O2 Micro, Inc. OZ6933/711E1 CardBus/SmartCardBus Controller (rev 02)

   Subsystem: Fujitsu Limited. Device 10e6

   Kernel driver in use: yenta_cardbus

02:0a.1 CardBus bridge: O2 Micro, Inc. OZ6933/711E1 CardBus/SmartCardBus Controller (rev 02)

   Subsystem: Fujitsu Limited. Device 10e6

   Kernel driver in use: yenta_cardbus

02:0d.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

   Subsystem: Fujitsu Limited. Device 111c

   Kernel driver in use: 8139too

```

----------

## wilsonsamm

Having had a closer look, in top, the CPU usage show something like 95% in "wa" (I guess this means "waiting" for I/O). Shouldn't the process be actually not waiting, but being preempted so that another process can run?

I don't see this same behaviour when waiting for a file to transfer over LAN or something, for example   :Rolling Eyes: 

----------

## krinn

well, your kernel only provide

NR_IRQS:16 

Because for a reason your apic isn't working, did you build your kernel without local apic or disable apic ?

This is mean that you are short on irq, and that many interfaces might plug themself on the same irq, sharing it. And sharing = a load balance need to be made by your cpu.

```
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 10 *11)
```

- Here i suppose kernel is showing you that irq 11 is shared with the *

```
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11 
```

- Here kernel show you that at least irq 11 is used by your drive controller

So irq 11 shared, and irq 11 used by your controller = that irq get really busy

And as your cpu is weak (it's an old laptop no?), having to do that irq balancing task might get your cpu working hard at doing it, and put your system in high io wait state.

There's also a switch for the kernel to force a (better?) irq balancing by booting it with irqbalance flag (but i think you should have a kernel ready to do that, so the option should be avaiable in kernel, someone could told you more than me about that)

I'm really sorry because i forgot how you can do that on an single cpu (i didn't build a kernel for single cpu for years), i just remember how it was working:

1- earlier, irq16 max, that's really old behavior (?)

2- next, we got upto 23, this is what you should get for your cpu type (PIC ?)

3- now, we get get upto 55 with multi-core cpus (APIC?)

If i remember well, i think kernel got an option to provide local apic (the 3) even on a single cpu, but even without using the newest apic you should be able to get the 2 (sadly as i said, i don't remember the kernel option to get that)

So you should get option 2 or 3 to get more irq (23 would be enough, i'm not sure you could get more than that)

But as i forgot the kernel options names to select it for a single cpu, you should ask to pappy_mcfae the names of the option to select it.

That's a question you could ask here  : https://forums.gentoo.org/viewtopic-t-829476.html

What i could tell you, is that you can : cat /proc/interrupts you will see there that irq11 number should be really higher than others, you will also get your current "method" to handle your irqs (last column).

You will also get the name of devices that are assign to that irq11, if you want a simple way to correct (or to test before modifying your kernel), you will certainly have the option in your bios to disable some devices to free that irq11 a bit (lol i'm not speaking about disable your hdd controller, but for example you might disable your network/sound or usb if they are sharing that irq 11 to test your computer with the same kernel config but with a lighter irq11 charge)

I could also just to make it clearer tell you that APIC and ACPI are two different things, and i didn't mistake while typing letters

You can also check cat /usr/src/linux/.config | grep PIC to see what options are showing, i think first one is for single processor usage (the local apic)

```
CONFIG_X86_LOCAL_APIC=y

CONFIG_X86_IO_APIC=y

CONFIG_PCI_IOAPIC=y

CONFIG_KVM_APIC_ARCHITECTURE=y

```

But as i said, i forgot them, so don't trust me on that one, better ask pappy_mcfae (or hoping a user with a better memory than me coming here)

----------

## roarinelk

 *wilsonsamm wrote:*   

> Having had a closer look, in top, the CPU usage show something like 95% in "wa" (I guess this means "waiting" for I/O). Shouldn't the process be actually not waiting, but being preempted so that another process can run?
> 
> I don't see this same behaviour when waiting for a file to transfer over LAN or something, for example  :roll:

 

IO-wait means the process is waiting for block (disk) IO to finish, and while it is waiting it doesn't consume (lots of) CPU cycles.

Networking is a different class.

----------

## wilsonsamm

```
$ cat /proc/interrupts 

           CPU0       

  0:       9444    XT-PIC-XT        timer

  1:       1353    XT-PIC-XT        i8042

  2:          0    XT-PIC-XT        cascade

  3:          4    XT-PIC-XT      

  4:          4    XT-PIC-XT      

  5:          2    XT-PIC-XT      

  7:          2    XT-PIC-XT      

  8:          2    XT-PIC-XT        rtc0

  9:          0    XT-PIC-XT        acpi

 10:          2    XT-PIC-XT      

 11:      19991    XT-PIC-XT        yenta, yenta, uhci_hcd:usb1, uhci_hcd:usb2, Intel 82801CA-ICH3, radeon@pci:0000:01:00.0, eth0

 12:        106    XT-PIC-XT        i8042

 14:       5006    XT-PIC-XT        ata_piix

 15:         67    XT-PIC-XT        ata_piix

NMI:          0   Non-maskable interrupts

LOC:     677006   Local timer interrupts

SPU:          0   Spurious interrupts

PMI:          0   Performance monitoring interrupts

PND:          0   Performance pending work

RES:          0   Rescheduling interrupts

CAL:          0   Function call interrupts

TLB:          0   TLB shootdowns

TRM:          0   Thermal event interrupts

THR:          0   Threshold APIC interrupts

MCE:          0   Machine check exceptions

MCP:          3   Machine check polls

ERR:          0

MIS:          0

```

Here's my /proc/interrupts. I've since enabled APIC in my kernel, I booted with the "lapic" option to force-enable it. The disk drives are on quite separate lines, but, everything else, almost, is one IRQ11. I'll see if I can shuffle them about a bit.

----------

