# hdparm with SATA - sil 3112 - asus a7n8x - maxtor 6 Y080M0

## opensas

Hi

I'm trying to improve my hd's performance, but I'm habing troubles with hdparm

I hope someone with the same hardware could help me.

this is what I get when I play around with hdparm

```

tux ~ # hdparm /dev/sda

/dev/sda:

 IO_support   =  0 (default 16-bit)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 9964/255/63, sectors = 81964302336, start = 0

tux root # hdparm -i /dev/sda7

/dev/sda7:

 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device

```

a few performance test (do you think they're ok????)

```

tux root # hdparm -t /dev/sda7

/dev/sda7:

 Timing buffered disk reads:  102 MB in  3.01 seconds =  33.93 MB/sec

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

tux root # hdparm -t /dev/sda7

/dev/sda7:

 Timing buffered disk reads:  104 MB in  3.00 seconds =  34.66 MB/sec

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

tux root # hdparm -t /dev/sda7

/dev/sda7:

 Timing buffered disk reads:  102 MB in  3.01 seconds =  33.87 MB/sec

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

tux root # hdparm -T /dev/sda7

/dev/sda7:

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

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

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

tux root # hdparm -T /dev/sda7

/dev/sda7:

 Timing cached reads:   1640 MB in  2.00 seconds = 818.49 MB/sec

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

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

tux root # hdparm -T /dev/sda7

/dev/sda7:

 Timing cached reads:   1604 MB in  2.00 seconds = 800.92 MB/sec

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

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

```

when I try to enable DMA

```

tux linux # hdparm -d /dev/sda

/dev/sda:

tux ~ # hdparm -d1 /dev/sda

/dev/sda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Inappropriate ioctl for device

```

when I try to set the Xfer mode

```

tux ~ # hdparm -X udma0 /dev/sda

/dev/sda:

 setting xfermode to 64 (UltraDMA mode0)

 HDIO_DRIVE_CMD(setxfermode) failed: Inappropriate ioctl for device

tux ~ # hdparm -X mdma0 /dev/sda

/dev/sda:

 setting xfermode to 32 (multiword DMA mode0)

 HDIO_DRIVE_CMD(setxfermode) failed: Inappropriate ioctl for device

tux ~ # hdparm -X sdma0 /dev/sda

/dev/sda:

 setting xfermode to 16 (singleword DMA mode0)

 HDIO_DRIVE_CMD(setxfermode) failed: Inappropriate ioctl for device

tux ~ # hdparm -X pio0 /dev/sda

/dev/sda:

 setting xfermode to 8 (PIO flow control mode0)

 HDIO_DRIVE_CMD(setxfermode) failed: Inappropriate ioctl for device

```

These are the relevant lines of my dmesg

```

ACPI: PCI Interrupt Link [APC3] enabled at IRQ 18

ACPI: PCI interrupt 0000:01:0b.0[A] -> GSI 18 (level, high) -> IRQ 18

ata1: SATA max UDMA/100 cmd 0xE0804080 ctl 0xE080408A bmdma 0xE0804000 irq 18

ata2: SATA max UDMA/100 cmd 0xE08040C0 ctl 0xE08040CA bmdma 0xE0804008 irq 18

ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003 88:207f

ata1: dev 0 ATA, max UDMA/133, 160086528 sectors:

ata1: dev 0 configured for UDMA/100

scsi0 : sata_sil

ata2: no device found (phy stat 00000000)

scsi1 : sata_sil

  Vendor: ATA       Model: Maxtor 6Y080M0    Rev: YAR5

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 160086528 512-byte hdwr sectors (81964 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 160086528 512-byte hdwr sectors (81964 MB)

SCSI device sda: drive cache: write back

 /dev/scsi/host0/bus0/target0/lun0: p1 p2 < p5 p6 p7 p8 p9 >

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

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

ACPI: PCI interrupt 0000:00:02.2[C] -> GSI 22 (level, high) -> IRQ 22

ehci_hcd 0000:00:02.2: nVidia Corporation nForce2 USB Controller

...

```

some more info

```

tux root # lspci | grep SATA

0000:01:0b.0 RAID bus controller: Silicon Image, Inc. (formerly CMD Technology Inc) SiI 3112 [SATALink/SATARaid] Serial ATA Controller (rev 01)

lspci -vv

0000:01:0b.0 RAID bus controller: Silicon Image, Inc. (formerly CMD Technology Inc) SiI 3112 [SATALink/SATARaid] Serial ATA Controller (rev 01)

        Subsystem: Silicon Image, Inc. (formerly CMD Technology Inc) SiI 3112 SATARaid Controller

        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

        Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

        Latency: 32, cache line size 08

        Interrupt: pin A routed to IRQ 18

        Region 0: I/O ports at a800

        Region 1: I/O ports at ac00 [size=4]

        Region 2: I/O ports at b000 [size=8]

        Region 3: I/O ports at b400 [size=4]

        Region 4: I/O ports at b800 [size=16]

        Region 5: Memory at d9000000 (32-bit, non-prefetchable) [size=512]

        Capabilities: [60] Power Management version 2

                Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

                Status: D0 PME-Enable- DSel=0 DScale=2 PME-

```

my kernel version

```

tux tmp # uname -a

Linux tux 2.6.11-gentoo-r11 #1 Sat Jun 18 17:18:50 ART 2005 i686 AMD Athlon(tm) XP 2600+ AuthenticAMD GNU/Linux

```

and finally my .config

```

Device Drivers  ---> 

  --- SCSI device support                                            

  [ ]   legacy /proc/scsi/ support                                   

  ---   SCSI support type (disk, tape, CD-ROM)                       

  <*>   SCSI disk support                                            

  < >   SCSI tape support                                            

  < >   SCSI OnStream SC-x0 tape support                             

  < >   SCSI CDROM support                                           

  < >   SCSI generic support                                         

  ---   Some SCSI devices (e.g. CD jukebox) support multiple LUNs    

  [ ]   Probe all LUNs on each SCSI device                           

  [ ]   Verbose SCSI error reporting (kernel size +=12K)             

  [ ]   SCSI logging facility                                        

       SCSI Transport Attributes  --->                              

       SCSI low-level drivers  --->   

    [*] Serial ATA (SATA) support                                           

    < >   AHCI SATA support                                                 

    < >   ServerWorks Frodo / Apple K2 SATA support                         

    < >   Intel PIIX/ICH SATA support                                       

    < >   NVIDIA SATA support                                               

    < >   Promise PATA 2027x support                                        

    < >   Promise PATA 2027x support                                        

    < >   Promise SATA TX2/TX4 support                                      

    < >   Pacific Digital SATA QStor support                                

    < >   Promise SATA SX4 support                                          

    <*>   Silicon Image SATA support 

```

Thanks a lot in advance

saludos

sas

----------

## dellaxim

hmm...hdparm just work with IDE drive, not SATA mate

 :Wink: 

----------

## opensas

Oops!!!

Does it means there's nothing else I can do and that my hd is optimally configured??

Thank you all

Saludos

Sas

----------

## Zyne

 *dellaxim wrote:*   

> hmm...hdparm just work with IDE drive, not SATA mate

 

hmmm works great over here...  :Smile: 

All info can be found in the quote 

 *Quote:*   

> 
> 
> # hdparm -iTt /dev/sda
> 
> /dev/sda:
> ...

 

```

*  sys-apps/hdparm

      Latest version available: 6.1

      Latest version installed: 6.1

      Size of downloaded files: 39 kB

      Homepage:    http://sourceforge.net/projects/hdparm/

      Description: Utility to change hard drive performance parameters

      License:     as-is

```

----------

## arkhan_jg

libata (the maintained and current library for SATA drives) treats sata drives as scsi drives. Unfortunately, it doesn't have full ioctl command support, and it's been removed  from libata-dev. You can't get SMART info from sata drives for the same reason. (I think they're concentrating on ioctrl(2)

According to Jeff Garzik (libata maintainer) we should be using hdparm -I instead of hdparm -i, but I get the same result as you on 2.6.11-ck9. will upgrade to 2.6.12 and see if that's any better.

As far as improving your drive performance, things look reasonable in terms of drive speeds; it depends how much cache you have on the drive and it's speed.

I get (using sil3114 and hdparm 6.1)

 *Quote:*   

> 
> 
> hdparm -tT /dev/sda
> 
> /dev/sda:
> ...

 

That said, I'm sure my sdb drive was faster when i orginally tested it, so I'm off to double check myself, will add back anything I find out.

If you're having performance issues, it's more likely to be lack of RAM or the filesystem. Switching to XFS from Reiser gave me a speed and stability boost. If it's lag in graphical userland, check closely your 3d-accel is working in hardware, it makes a huge difference to perceived speed.

----------

## dellaxim

 *Zyne wrote:*   

>  *dellaxim wrote:*   hmm...hdparm just work with IDE drive, not SATA mate 
> 
> hmmm works great over here... 
> 
> All info can be found in the quote 
> ...

 

It works in term of INFO about the hdd not to tweak it. Anyway...mine is not even work for the info

(WD-120Gb)

```
/dev/sda:

 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device

 Timing cached reads:   3836 MB in  2.00 seconds = 1917.33 MB/sec

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

 Timing buffered disk reads:  138 MB in  3.01 seconds =  45.90 MB/sec

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

```

----------

## opensas

Thanks Zyne

this is what I get at my computer

```

tux / # hdparm -iTt /dev/sda

/dev/sda:

 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device

 Timing cached reads:   1128 MB in  2.00 seconds = 563.24 MB/sec

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

 Timing buffered disk reads:  122 MB in  3.02 seconds =  40.42 MB/sec

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

tux nexuiz # eix hdparm

* sys-apps/hdparm

     Available versions:  5.7-r1 5.9 ~6.1

     Installed:           5.9

     Homepage:            http://sourceforge.net/projects/hdparm/

     Description:         Utility to change hard drive performance parameters

```

I'll give a try to the 6.1 version, and then I'll tell you, but according to arkhan_jg, the problem is the libata library and not the hdparm version. 

I have a question. We can't tweak our SATA drives because they're already running with optimuns settings (nothing to tweak), or is is just libata that is missing that ability???

Then I'll try with arkhan_jg advice and swith from ext3 to XFS

Any other suggestion???

----------

## opensas

Just tried with hdparm 6.1 but, as expected, I still have the same problem

Saludos

Sas

----------

## woZa

There is an app called sdparm (masked ~). This might give you what you are looking for...

----------

## opensas

Thanks for the tip woZa

I'm emerging it right away!!!  :Wink: 

Saludos

Sas

----------

## Gentree

You said you where hoping to increase performance so I take it you where expecting to test / set DMA speeds.

DMA = direct memory access , you are not going acces memory directly down a two wire serial connection SATA devices dont do DMA.

You will have to rely on the SATA interface and drivers libata et al. I think it is fair to assume they will grab what DMA speed they can get .

So you premice is correct, it is probably set up as well as it can be from you point of view.

 :Cool: 

----------

## lbrtuk

 *Gentree wrote:*   

> DMA = direct memory access , you are not going acces memory directly down a two wire serial connection SATA devices dont do DMA.

 

What?

----------

## opensas

Hey gentree, thanks for your precise and accurate reply.

Nevertheless I'll go thru the sdparm man pages, just to see what the heck it's supposed to do

Saludos

Sas

----------

## Gentree

I dont think you need to do anything (although reading man hdparm is certainly a good idea)

It seems from your dmesg that the driver is using DMA and the timings look pretty good. 

Just as a comparison my new Seagate 120G IDE:

```
#hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   1116 MB in  2.00 seconds = 557.81 MB/sec

 Timing buffered disk reads:  166 MB in  3.01 seconds =  55.10 MB/sec

```

The buffered reads are a bit higher because it has an 8M buffer.

As someone else pointed above it seems that the SATA driver does not yet fully interface with iocntl to get all the ID data off the device but in terms of performance I dont think you have a problem.

 :Cool: 

----------

## opensas

Don't missunderstand me, gentree

I'm planing to study SDPARM, not hdparm

In it's homepage it says

Introduction

The sdparm utility outputs and in some cases modifies SCSI device parameters. When the SCSI device is a disk, sdparm's role is similar to its Linux namesake: hdparm which is for ATA disks that usually have device names starting with "hd". More generally sdparm can be used to output and modify parameters on any device that uses a SCSI command set. Apart from SCSI disks, such devices include CD/DVD drives (irrespective of transport), SCSI and ATAPI tape drives and SCSI enclosures.

The information in this page corresponds to sdparm version 0.93 .

Well, I'll tell you later what it's all about (ain't got much spare time nowdays)

Saludos

Sas

----------

## Gentree

Oh cool, I did not realise there was a different project.

You get so many ppl make careless typos and cant be arsed to proof read their posts or correct then afterwareds (or simple cant spell for shit) , I just took it to be an error.

keep us posted on sdparm, I have a couple of SCSI devices, it may be useful.

Thx for the correct.  :Cool: 

----------

## Pete M

Works here

2 x WD Raptors in Raid0

```
# hdparm -tT /dev/md0

/dev/md0:

 Timing cached reads:   3788 MB in  2.00 seconds = 1894.29 MB/sec

 Timing buffered disk reads:  372 MB in  3.01 seconds = 123.73 MB/sec

```

----------

## /carlito

Performance on my disk is very poor.

```
/dev/sda:

 Timing cached reads:   1424 MB in  2.00 seconds = 711.04 MB/sec

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

 Timing buffered disk reads:   44 MB in  3.01 seconds =  14.61 MB/sec

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

```

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

        Subsystem: Silicon Image, Inc. SiI 3112 SATARaid Controller

        Flags: bus master, 66Mhz, medium devsel, latency 32, IRQ 11

        I/O ports at 9800

        I/O ports at 9c00 [size=4]

        I/O ports at a000 [size=8]

        I/O ports at a400 [size=4]

        I/O ports at a800 [size=16]

        Memory at e3001000 (32-bit, non-prefetchable) [size=512]

        Capabilities: [60] Power Management version 2

```

The disk is a 120gig Seagate Baracuda 7200.7.

My kernel version is

```
Linux desktop 2.6.10-gentoo-r6 #4 Thu Jul 14 17:22:12 CEST 2005 i686 AMD Athlon XP-M AuthenticAMD GNU/Linux

```

Dmegsg info

```
ata1: SATA max UDMA/100 cmd 0xF880E080 ctl 0xF880E08A bmdma 0xF880E000 irq 11

ata2: SATA max UDMA/100 cmd 0xF880E0C0 ctl 0xF880E0CA bmdma 0xF880E008 irq 11

ata1: dev 0 cfg 49:2f00 82:346b 83:7d01 84:4003 85:3469 86:3c01 87:4003 88:207f

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

ata1(0): applying Seagate errata fix

ata1: dev 0 configured for UDMA/100

scsi0 : sata_sil

ata2: no device found (phy stat 00000000)

scsi1 : sata_sil

  Vendor: ATA       Model: ST3120026AS       Rev: 3.05

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)

SCSI device sda: drive cache: write back

 sda: sda1 sda2 < sda5 sda6 sda7 sda8 sda9 >

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
```

Relevant kernel.config

```
# ATA/ATAPI/MFM/RLL support

#

CONFIG_IDE=y

CONFIG_BLK_DEV_IDE=y

#

# Please see Documentation/ide.txt for help/info on IDE drives

#

# CONFIG_BLK_DEV_IDE_SATA is not set

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=y

CONFIG_IDEDISK_MULTI_MODE=y

CONFIG_BLK_DEV_IDECD=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

# CONFIG_BLK_DEV_IDESCSI is not set

# CONFIG_IDE_TASK_IOCTL is not set

#

# IDE chipset support/bugfixes

#

CONFIG_IDE_GENERIC=y

# CONFIG_BLK_DEV_CMD640 is not set

# CONFIG_BLK_DEV_IDEPNP is not set

CONFIG_BLK_DEV_IDEPCI=y

CONFIG_IDEPCI_SHARE_IRQ=y

# CONFIG_BLK_DEV_OFFBOARD is not set

CONFIG_BLK_DEV_GENERIC=y

CONFIG_BLK_DEV_IDEDMA_PCI=y

# CONFIG_BLK_DEV_IDEDMA_FORCED is not set

CONFIG_IDEDMA_PCI_AUTO=y

CONFIG_BLK_DEV_SIIMAGE=y

# CONFIG_IDE_ARM is not set

CONFIG_BLK_DEV_IDEDMA=y

# CONFIG_IDEDMA_IVB is not set

CONFIG_IDEDMA_AUTO=y

# CONFIG_BLK_DEV_HD is not set

#

# SCSI device support

#

CONFIG_SCSI=y

CONFIG_SCSI_PROC_FS=y

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

# CONFIG_CHR_DEV_ST is not set

# CONFIG_CHR_DEV_OSST is not set

# CONFIG_BLK_DEV_SR is not set

CONFIG_CHR_DEV_SG=y

#

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs

#

# CONFIG_SCSI_MULTI_LUN is not set

# CONFIG_SCSI_CONSTANTS is not set

# CONFIG_SCSI_LOGGING is not set

#

# SCSI Transport Attributes

#

# CONFIG_SCSI_SPI_ATTRS is not set

# CONFIG_SCSI_FC_ATTRS is not set

#

# SCSI low-level drivers

#

CONFIG_SCSI_SATA=y

CONFIG_SCSI_SATA_SIL=y

CONFIG_SCSI_QLA2XXX=y

```

Some advice on this??

----------

## /carlito

So i've found out that my drive is blacklisted on the sata_sil driver.

I've removed my drive from the blacklist (located in /usr/src/linux/drivers/scsi/sata_sil.c) , recompiled an rebooted with the new driver and performance looks good. 

```
/dev/sda:

 Timing cached reads:   1712 MB in  2.00 seconds = 855.28 MB/sec

 Timing buffered disk reads:  152 MB in  3.01 seconds =  50.56 MB/sec

```

I still have to do some intensive testing though...

----------

