# How to enable DMA on hda

## mabe

Hey all,

I just found out I'm not using DMA on hda. I have it compiled into kernel but it's apparantly off. I've looked around some and it seems I need something similar to:

```
/sbin/hdparm -c1 -d1 -k1 /dev/hda
```

Is this correct, and also, where do I put it so that I get DMA enabled at all times?

Thanks!

----------

## mabe

OMG!

Looking 10 posts down was the answer, so much for doing a search for "enable dma hdparm", guess I'll have to look manually from now on   :Wink: 

Sorry 'bout that!

----------

## sessionID

I have hdparm -d1 /dev/hda in /etc/conf.d/local.start.

----------

## mabe

Yes, I put hdparm -qc 1 -qd 1 -qk 1 /dev/hda in my /etc/conf.d/local.start and that solved part of the problem. Still, doing a hdparm -tT /dev/hda gives me:

```

/dev/hda:

 Timing buffer-cache reads:   128 MB in  0.73 seconds =175.34 MB/sec

 Timing buffered disk reads:  64 MB in  1.82 seconds = 35.16 MB/sec

```

Most people seem to get up to 300 MB/sec on buffer-cache reads. Something else for me to check?

----------

## sessionID

http://www-106.ibm.com/developerworks/library/i-tuning/?dwzone=ibm, but there (on IBM developerWorks) should be another one about hdparm I saw months ago... can't find it now, sry.

----------

## mabe

 *sessionID wrote:*   

> http://www-106.ibm.com/developerworks/library/i-tuning/?dwzone=ibm, but there (on IBM developerWorks) should be another one about hdparm I saw months ago... can't find it now, sry.

 

Thanks, I'll check it out.

----------

## scape

well, similar problems here.

all drives perform poorly, the strange thing is this:

```

root@atair root # hdparm -d /dev/hdb

/dev/hdb:

 using_dma    =  0 (off)

root@atair root # hdparm -d1 /dev/hdb

/dev/hdb:

 setting using_dma to 1 (on)

 using_dma    =  1 (on)

root@atair root # hdparm -d /dev/hdb

/dev/hdb:

 using_dma    =  0 (off)

```

i don't think it's something with this drive, as all drives behave this way.

nontheless, some info about /dev/hdb:

```
/dev/hdb:

ATA device, with non-removable media

        Model Number:       Maxtor 96147H6                          

        Serial Number:      V604A0EC            

        Firmware Revision:  ZAH814Y0

Standards:

        Used: ATA/ATAPI-6 T13 1410D revision 0 

        Supported: 6 5 4 3 

Configuration:

        Logical         max     current

        cylinders       16383   16383

        heads           16      16

        sectors/track   63      63

        --

        CHS current addressable sectors:   16514064

        LBA    user addressable sectors:  120064896

        device size with M = 1024*1024:       58625 MBytes

        device size with M = 1000*1000:       61473 MBytes (61 GB)

Capabilities:

        LBA, IORDY(can be disabled)

        bytes avail on r/w long: 57     Queue depth: 1

        Standby timer values: spec'd by Standard, no device specific minimum

        R/W multiple sector transfer: Max = 16  Current = 0

        Advanced power management level: unknown setting (0x0000)

        Recommended acoustic management value: 192, current value: 192

        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 

             Cycle time: min=120ns recommended=120ns

        PIO: pio0 pio1 pio2 pio3 pio4 

             Cycle time: no flow control=120ns  IORDY flow control=120ns

Commands/features:

        Enabled Supported:

           *    NOP cmd

           *    READ BUFFER cmd

           *    WRITE BUFFER cmd

           *    Host Protected Area feature set

           *    Look-ahead

           *    Write cache

           *    Power Management feature set

           *    SMART feature set

           *    Automatic Acoustic Management feature set 

                SET MAX security extension

                Advanced Power Management feature set

           *    DOWNLOAD MICROCODE cmd

HW reset results:

        CBLID- above Vih

        Device num = 1 determined by the jumper

Checksum: correct

```

Suggestions?

----------

## aardvark

 *mabe wrote:*   

> Yes, I put hdparm -qc 1 -qd 1 -qk 1 /dev/hda in my /etc/conf.d/local.start and that solved part of the problem. Still, doing a hdparm -tT /dev/hda gives me:
> 
> ```
> 
> /dev/hda:
> ...

 

The first number depend on your motherboard and memory speed.

I guess you have sdr ram and a via kt133 or equivalent. Then this is quite a normal value. If you have ata 133 on a ddr memory mobo, than you might expext higher values.

(Actually, the ATA 133 part may not even be relevant.)Last edited by aardvark on Tue Jan 28, 2003 4:12 pm; edited 1 time in total

----------

## mabe

 *Quote:*   

> 
> 
> I guess you have sdr ram and a via kt133 or equivalent. Then this is quite a normal value.

 

You are right on the spot   :Smile: 

Thanks for clearing that out.

----------

## darkproximity

you realize you can edit /etc/conf.d/hdparm and put your hdparm flags in, then rc-update add hdparm default  :Wink: 

----------

## kamikaz3

via KT266A/Maxtor diamondmax Plus 9:

 *Quote:*   

> /dev/hda:
> 
>  Timing buffer-cache reads:   128 MB in  0.38 seconds =336.84 MB/sec
> 
>  Timing buffered disk reads:  64 MB in  1.69 seconds = 37.87 MB/sec
> ...

 

Sis Something with sdr / Seagate BCudda 4:

 *Quote:*   

> /dev/hda:
> 
>  Timing buffer-cache reads:   128 MB in  0.90 seconds =142.22 MB/sec
> 
>  Timing buffered disk reads:  64 MB in  1.70 seconds = 37.65 MB/sec
> ...

 

----------

## Forge

Intel i875P, 2.8C, ICH5 controller

/dev/hdb:

Timing buffer-cache reads:  128 MB in  0.15 seconds =853.33 MB/sec

Timing buffered disk reads: 64 MB in 1.46 seconds = 43.84 MB/sec

... It's all about the IDE efficiency, for buffered disk, and all about system bandwidth/IDE-system efficiency, for buffer-cache. One number shows how well your disk and the controller are getting along, the other shows how your controller and the system are getting along.

----------

