# Abnormal disk I/O on new laptop



## G_Nerc (Nov 2, 2012)

Good day!
I have a some problems with my new laptop:

Laptop info:

*Processor:* Core i5 3210M 2500Mhz
*CPU Cores:* 2 (4 virtual HyperThreading core)
*RAM:* 4Gb
*Video:* NVIDIA GeForce GT 630M 1Gb VRAM
*HDD:* 500Gb SATA AHCI
*dmesg* on pastebin.com
First of all I'm setup on that laptop *FreeBSD 9.0 amd64 memstick*. Without any port installing and system tuning (only add user and set root password). After that I see that when I'm run `# portsnap fetch extract` it start extract ports after fetching it is very slow (after 20 minutes it extract only games section) and I can't wait for it ends.

After that I'm csup to HEAD and buildworld and kernel (kernel - GENERIC without all debug - options like WITNESS,DEBUG, DTRACE,DDB etc.) I'm do all step by step from /usr/src/Makefile but after that problem not solved.

Also I notice that moment: 
If I start diskinfo -t ada0 after system starts, all ok with I/O. Disk speed is fine and no problem. When I start portsnap extract first category (audio) extracts fine and fast, after that all speeds down and gstat shows that disk 100% busy. If I stop portsnap extract and start diskinfo -t at once it show speed about 8Mb/s. But when I restart that test after several minutes it shows speed fine about 100MB/s. 
Seems like many small files from portsnap extract fill disk queue or something like this.

/var/log/messages have not any errors, and console output have not it too.

I'm install on that laptop windows 7 and it has not that problems.

Below output various data when portsnap extract run.

*make.conf*

```
CPUTYPE?=core2
TARGET_ARCH=amd64
KERNCONF=MYBSD
MALLOC_PRODUCTION=yes
```

*vmstat*

```
procs      memory      page                    disks     faults         cpu
 r b w     avm    fre   flt  re  pi  po    fr  sr ad0 cd0   in   sy   cs us sy id
 2 0 0    727M  3030M  2489   0   0   0  3131   0   0   0 1747 3783 4441  1  2 98
```
*iostat*

```
tty            ada0              cd0            pass0             cpu
 tin  tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
   1   316  8.72 106  0.91   0.00   0  0.00   0.00   0  0.00   1  0  1  1 98
```
*gstat*

```
dT: 1.001s  w: 1.000s
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
    2    210    155    735   11.5     55    381   32.6  100.1| ada0
    2    210    155    735   11.5     55    381   32.6  100.2| ada0s3
    0      0      0      0    0.0      0      0    0.0    0.0| ada0s3a
    2    201    146    667   10.7     55    381   32.6  100.2| ada0s3b
    0      9      9     68   25.0      0      0    0.0   22.5| ada0s3d
```

*pciconf -lvbe*

```
hostb0@pci0:0:0:0:      class=0x060000 card=0x27021558 chip=0x01548086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '3rd Gen Core processor DRAM Controller'
    class      = bridge
    subclass   = HOST-PCI
    PCI errors = Received Master-Abort
pcib1@pci0:0:1:0:       class=0x060400 card=0x27021558 chip=0x01518086 rev=0x09 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:1:1:       class=0x060400 card=0x27021558 chip=0x01558086 rev=0x09 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
vgapci1@pci0:0:2:0:     class=0x030000 card=0x27021558 chip=0x01668086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '3rd Gen Core processor Graphics Controller'
    class      = display
    subclass   = VGA
    bar   [10] = type Memory, range 64, base 0xf7400000, size 4194304, enabled
    bar   [18] = type Prefetchable Memory, range 64, base 0xd0000000, size 268435456, enabled
    bar   [20] = type I/O Port, range 32, base 0xf000, size 64, enabled
xhci0@pci0:0:20:0:      class=0x0c0330 card=0x27021558 chip=0x1e318086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family USB xHCI Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 64, base 0xf7a00000, size 65536, enabled
none0@pci0:0:22:0:      class=0x078000 card=0x27021558 chip=0x1e3a8086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family MEI Controller'
    class      = simple comms
    bar   [10] = type Memory, range 64, base 0xf7a1a000, size 16, enabled
ehci0@pci0:0:26:0:      class=0x0c0320 card=0x27021558 chip=0x1e2d8086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family USB Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 32, base 0xf7a18000, size 1024, enabled
hdac0@pci0:0:27:0:      class=0x040300 card=0x27021558 chip=0x1e208086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA
    bar   [10] = type Memory, range 64, base 0xf7a10000, size 16384, enabled
pcib3@pci0:0:28:0:      class=0x060400 card=0x27021558 chip=0x1e108086 rev=0xc4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family PCI Express Root Port 1'
    class      = bridge
    subclass   = PCI-PCI
pcib4@pci0:0:28:2:      class=0x060400 card=0x27021558 chip=0x1e148086 rev=0xc4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family PCI Express Root Port 3'
    class      = bridge
    subclass   = PCI-PCI
pcib5@pci0:0:28:3:      class=0x060400 card=0x27021558 chip=0x1e168086 rev=0xc4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family PCI Express Root Port 4'
    class      = bridge
    subclass   = PCI-PCI
ehci1@pci0:0:29:0:      class=0x0c0320 card=0x27021558 chip=0x1e268086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family USB Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 32, base 0xf7a17000, size 1024, enabled
isab0@pci0:0:31:0:      class=0x060100 card=0x27021558 chip=0x1e598086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'HM76 Express Chipset LPC Controller'
    class      = bridge
    subclass   = PCI-ISA
ahci0@pci0:0:31:2:      class=0x010601 card=0x27021558 chip=0x1e038086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '7 Series Chipset Family 6-port SATA Controller [AHCI mode]'
    class      = mass storage
    subclass   = SATA
    bar   [10] = type I/O Port, range 32, base 0xf0b0, size  8, enabled
    bar   [14] = type I/O Port, range 32, base 0xf0a0, size  4, enabled
    bar   [18] = type I/O Port, range 32, base 0xf090, size  8, enabled
    bar   [1c] = type I/O Port, range 32, base 0xf080, size  4, enabled
    bar   [20] = type I/O Port, range 32, base 0xf060, size 32, enabled
    bar   [24] = type Memory, range 32, base 0xf7a16000, size 2048, enabled
none1@pci0:0:31:3:      class=0x0c0500 card=0x27021558 chip=0x1e228086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '7 Series/C210 Series Chipset Family SMBus Controller'
    class      = serial bus
    subclass   = SMBus
    bar   [10] = type Memory, range 64, base 0xf7a15000, size 256, enabled
    bar   [20] = type I/O Port, range 32, base 0xf040, size 32, enabled
vgapci0@pci0:1:0:0:     class=0x030000 card=0x27021558 chip=0x0de910de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GF108 [GeForce GT 630M]'
    class      = display
    subclass   = VGA
    bar   [10] = type Memory, range 32, base 0xf6000000, size 16777216, enabled
    bar   [14] = type Prefetchable Memory, range 64, base 0xe0000000, size 268435456, enabled
    bar   [1c] = type Prefetchable Memory, range 64, base 0xf0000000, size 33554432, enabled
    bar   [24] = type I/O Port, range 32, base 0xe000, size 128, enabled
none2@pci0:4:0:0:       class=0x028000 card=0x072610ec chip=0x872310ec rev=0x00 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    class      = network
    bar   [10] = type I/O Port, range 32, base 0xd000, size 256, enabled
    bar   [18] = type Memory, range 64, base 0xf7900000, size 16384, enabled
none3@pci0:5:0:0:       class=0xff0000 card=0x27021558 chip=0x528910ec rev=0x01 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    bar   [10] = type Memory, range 32, base 0xf7800000, size 65536, enabled
  PCI-e errors = Correctable Error Detected
                 Unsupported Request Detected
     Non-fatal = Unsupported Request
     Corrected = Receiver Error
                 Advisory Non-Fatal Error
re0@pci0:5:0:2: class=0x020000 card=0x27021558 chip=0x816810ec rev=0x0a hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168B PCI Express Gigabit Ethernet controller'
    class      = network
    subclass   = ethernet
    bar   [10] = type I/O Port, range 32, base 0xc000, size 256, enabled
    bar   [18] = type Prefetchable Memory, range 64, base 0xf2104000, size 4096, enabled
    bar   [20] = type Prefetchable Memory, range 64, base 0xf2100000, size 16384, enabled
```


----------



## G_Nerc (Nov 17, 2012)

I'm find solution and problem:
I'm disable

```
device ses
```
in kernel config and rebuild it.
I think it relates to *Intel Management Engine Interface*, and there is line for that device from dmesg:
*With [device ses] in kernel config*

```
ses0 at ahciem0 bus 0 scbus3 target 0 lun 0
ses0: <AHCI SGPIO Enclosure 1.00 0001> SEMB S-E-S 2.00 device
ses0: SEMB SES Device
```

Maybe that helps to someone else!


----------



## mav@ (Nov 18, 2012)

Sorry, but I have some doubts about correctness of your guess. I can't imagine relations between SES driver and disk performance. What is quite realistic is that write of many small files by portsnap show heads seek bottleneck of the HDD.


----------



## G_Nerc (Nov 18, 2012)

mav@ said:
			
		

> Sorry, but I have some doubts about correctness of your guess. I can't imagine relations between SES driver and disk performance. What is quite realistic is that write of many small files by portsnap show heads seek bottleneck of the HDD.


But I had system performance problems not only with portsnap, it appears when I delete /usr/obj, when I'm do csup, and when I disable *device ses* in kernel config, all disk problems ends.
I don't know possible that or not, but about a week I have problems, when active disk I/O freeze my system to 10-20 sec, and after that procedure that does not appears. 
If it needed, I can do some tests which you say, for isolating that problem.


----------



## tingo (Nov 21, 2012)

Try `# vmstat -i` both with device ses enabled, and without. post results here.


----------

