# horrible sata performance (unsolved)

## usingloser

Hdparm performance test on /dev/sda gives me 2 meg/sec on disk reads, ugg.  I am using the current gentoo-sources, using genkernel with no modification to the auto selected scsi/ide driver selection.  I have an nforce3 motherboard that uses a Silicon Image raid controller/sata controler.  The driver for it appears to be loaded correctly.  I am using a 200 gig Maxtor SATA drive.

some proof of my despair

```

/dev/sda:

 Timing cached reads:   3688 MB in  2.00 seconds = 1842.44 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

 Timing buffered disk reads:   16 MB in  3.61 seconds =   2.63 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

```

lspci

```

0000:00:00.0 Host bridge: nVidia Corporation nForce3 250Gb Host Bridge (rev a1)

0000:00:01.0 ISA bridge: nVidia Corporation nForce3 250Gb LPC Bridge (rev a2)

0000:00:01.1 SMBus: nVidia Corporation nForce 250Gb PCI System Management (rev a1)

0000:00:02.0 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

0000:00:02.1 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

0000:00:02.2 USB Controller: nVidia Corporation nForce3 EHCI USB 2.0 Controller (rev a2)

0000:00:05.0 Bridge: nVidia Corporation CK8S Ethernet Controller (rev a2)

0000:00:06.0 Multimedia audio controller: nVidia Corporation nForce3 250Gb AC'97 Audio Controller (rev a1)

0000:00:08.0 IDE interface: nVidia Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)

0000:00:0a.0 IDE interface: nVidia Corporation CK8S Serial ATA Controller (v2.5) (rev a2)

0000:00:0b.0 PCI bridge: nVidia Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)

0000:00:0e.0 PCI bridge: nVidia Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)

0000:00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

0000:00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

0000:00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro]

0000:01:00.1 Display controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro] (Secondary)

0000:02:0b.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13)

0000:02:0d.0 RAID bus controller: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller (rev 01)

0000:02:0e.0 FireWire (IEEE 1394): Texas Instruments TSB82AA2 IEEE-1394b Link Layer Controller (rev 01)

```

 :Confused:   :Confused: 

----------

## fangorn

Have you tried copying a big file (cd-image or video) and stopping the time? I don't know if hdparm can handle sata drives correctly. Last I know it was designed for paralell ata drives

----------

## usingloser

I will give it a try, been when I was searching the forums for an answer, most people seem to get ~50meg/sec from hdparm tests on their working sata drives.  Also, I can tell its slow, my laptop with a 5 gig harddrive is rivaling my load times on my desktop.

----------

## usingloser

Okay, I copied a 1.4 gig file on the drive, and it maintained from 25 meg/s to 14 meg/s so I guess its working  :Confused: 

Certainly doesn't seem as fast as it should be though.  Still open for any other suggestions.

----------

## brot

```
/dev/sda:

 Timing cached reads:   1720 MB in  2.00 seconds = 858.84 MB/sec

 Timing buffered disk reads:  164 MB in  3.00 seconds =  54.58 MB/sec

```

I have a Silicon Image SATA controller onboard, too (but only with nforce2  :Sad:  )

 *usingloser wrote:*   

> HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device 

 

i think that lspci doesnt really say that the driver for the hardware exists, but that it exists generally.  It may be helpfull if you post your .config...

(my lspci shows my tv-card, but i have no driver installed for it, so i should be right...)

greetz

brot

----------

## usingloser

I posted my lspci just for an easy list of my hardware.  The driver is compiled as a module, and is loaded by the genkernel boot up scripts.  I also tried it compiled into the kernel, and it didnt help.

----------

## usingloser

update

After further testing, I realized this is very much not solved.  Mainly because some harddrive related bottlnecks are bringing my system to its knees.  I played around with my hardware, and looked through my bios settings in futility.  Also tested my disk speed using the 2005.1 livecd (all of this is amd64 arch if it matters) and my hdparm -tT results are always 1-2 meg/sec, while my friend, and its seems everyone on the forums, get 40-50 meg/sec.  Any further suggestions would be helpful.  Also is it possible for a drive to "break", but not make any odd sounds, and still function perfectly, just be very slow?  I saw someone on the forum mention he experienced slow sata, and bought a new drive (different brand) and speeds returned to normal on the new drive.

----------

## fangorn

Don't know if this has any effect on SATA drives at all, but did you set the option to use DMA for Atapi drives automatically in the kernel config?

----------

## brot

I recently reinstalled gentoo my pc and when configuring the kernel i had to select the sata driver twice. Once in the ATA drive settings and once in the Scsi low-level drivers. check if you have installed it twice...

----------

## usingloser

```

sata_sil version 0.9

ACPI: PCI Interrupt Link [APC2] enabled at IRQ 17

ACPI: PCI Interrupt 0000:02:0d.0[A] -> Link [APC2] -> GSI 17 (level, low) -> IRQ 17

ata1: SATA max UDMA/100 cmd 0xFFFFC2000006A080 ctl 0xFFFFC2000006A08A bmdma 0xFFFFC2000006A000 irq 17

ata2: SATA max UDMA/100 cmd 0xFFFFC2000006A0C0 ctl 0xFFFFC2000006A0CA bmdma 0xFFFFC2000006A008 irq 17

hub 2-4:1.0: USB hub found

hub 2-4:1.0: 4 ports detected

ata1: dev 0 cfg 49:2f00 82:7c6b 83:7f09 84:4063 85:7c68 86:3e01 87:4063 88:207f

ata1: dev 0 ATA, max UDMA/133, 398297088 sectors: lba48

ata1: dev 0 configured for UDMA/100

scsi0 : sata_sil

usb 3-4: new full speed USB device using ohci_hcd and address 2

ata2: no device found (phy stat 00000000)

scsi1 : sata_sil

  Vendor: ATA       Model: Maxtor 6L200M0    Rev: BANC

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 398297088 512-byte hdwr sectors (203928 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 398297088 512-byte hdwr sectors (203928 MB)

SCSI device sda: drive cache: write back

 /dev/scsi/host0/bus0/target0/lun0: p1 p2 p3 < p5 p6 p7 > p4

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

usb 2-4.3: new low speed USB device using ohci_hcd and address 3

sata_nv version 0.8

ACPI: PCI Interrupt Link [APSJ] enabled at IRQ 22

ACPI: PCI Interrupt 0000:00:0a.0[A] -> Link [APSJ] -> GSI 22 (level, high) -> IRQ 22

PCI: Setting latency timer of device 0000:00:0a.0 to 64

ata3: SATA max UDMA/133 cmd 0x9F0 ctl 0xBF2 bmdma 0xD800 irq 22

ata4: SATA max UDMA/133 cmd 0x970 ctl 0xB72 bmdma 0xD808 irq 22

input: USB HID v1.11 Mouse [Microsoft Microsoft IntelliMouse\uffff Explorer] on usb-0000:00:02.0-4.3

ata3: no device found (phy stat 00000000)

scsi2 : sata_nv

ata4: no device found (phy stat 00000000)

scsi3 : sata_nv

```

The drive is detected with the proper sata driver.

----------

## Garth

Just so I can add to the results pile:

```

SATURN / # hdparm -Tt /dev/sda

/dev/sda:

 Timing buffer-cache reads:   4036 MB in  2.00 seconds = 2018.00 MB/sec

 Timing buffered disk reads:  192 MB in  3.00 seconds =  64.00 MB/sec

```

I'm thinking that's a pretty good number

Seagate Barracuda 7200.8 ST3400832AS 400GB 7200 RPM 8M Cache Serial ATA150 Hard Drive

Tyan Thunder K8SD (S2882UG3NR-D) Mobo (2x Dual-Core 64bit Opterons (270's)

Sorry I don't have any suggestion on how to fix you problem.

----------

## bolind

 *usingloser wrote:*   

> update
> 
> After further testing, I realized this is very much not solved.  Mainly because some harddrive related bottlnecks are bringing my system to its knees.  I played around with my hardware, and looked through my bios settings in futility.  Also tested my disk speed using the 2005.1 livecd (all of this is amd64 arch if it matters) and my hdparm -tT results are always 1-2 meg/sec, while my friend, and its seems everyone on the forums, get 40-50 meg/sec.  Any further suggestions would be helpful.  Also is it possible for a drive to "break", but not make any odd sounds, and still function perfectly, just be very slow?  I saw someone on the forum mention he experienced slow sata, and bought a new drive (different brand) and speeds returned to normal on the new drive.

 

I have been experiencing similar problems lately, hdparm would return around 1000 mb/s for cached reads, and around 2 to 7 mb/s for buffered reads. I realized that I had not compiled in support for the controller (VIA something) in my kernel. Doing this, the buffered reads increased to about 54 mb/s   :Very Happy: 

Give it a shot, it might help.

----------

## To

What sata chip you have? I have shity results with silimage too...

Tó

----------

## RobertDavid

My results are 

```

/dev/sda:

 Timing cached reads:   1080 MB in  2.01 seconds = 538.47 MB/sec

 Timing buffered disk reads:  164 MB in  3.02 seconds =  54.28 MB/sec

```

I have 2x new 80GB Hitachi SATA2 disks  (but old ASUS 7V600 MB, with only sata 1, VIA sata),,, How could be your cached reeds so big accoarding to my??? 

I have tested it by bonnie and there are results I dont know if its good enough for that disk I have,,,

topic

----------

