# hdparm -tT /dev/hda slow!

## discostu

The buffered disk is reading really slow.

```

$ hdparm -tT /dev/hda

 /dev/hda:

  Timing buffer-cache reads:   128 MB in  0.61 seconds =209.84 MB/sec

  Timing buffered disk reads:  64 MB in 32.09 seconds =  1.99 MB/sec

```

I have had problems with mouse/keyboard/mp3z skipping and time drifting when emerging or ripping cds. Now that I have gentoo-r9 kernel with CONFIG_JIFFIES=100, it seems to run a bit better, but there is still some skipping (but I just switched kernels today so who knows). 

Any ideas?

Here's some other info that might help:

```

$ grep -i dma /usr/src/linux/.config

CONFIG_BLK_DEV_IDEDMA_PCI=y

# CONFIG_BLK_DEV_IDEDMA_FORCED is not set

CONFIG_IDEDMA_PCI_AUTO=y

# CONFIG_IDEDMA_ONLYDISK is not set

CONFIG_BLK_DEV_IDEDMA=y

# CONFIG_IDEDMA_PCI_WIP is not set

# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set

# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set

CONFIG_BLK_DEV_ADMA=y

# CONFIG_HPT34X_AUTODMA is not set

CONFIG_IDEDMA_AUTO=y

# CONFIG_IDEDMA_IVB is not set

# CONFIG_DMA_NONPCI is not set

# CONFIG_SCSI_EATA_DMA is not set

# CONFIG_SOUND_DMAP is not set

$ cat /proc/ide/ide0/hda/settings

name                    value           min             max             mode

----                    -----           ---             ---             ----

...

using_dma               0               0               1               rw

...

$ hdparm -i /dev/hda

/dev/hda:

 Model=QUANTUM FIREBALLP AS60.0, FwRev=A1Y.1500, SerialNo=796116774605

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

 RawCHS=16383/16/63, TrkSize=32256, SectSize=21298, ECCbytes=4

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

 CurCHS=17475/15/63, CurSects=16513875, LBA=yes, LBAsects=117266688

 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=no WriteCache=enabled

 Drive conforms to: ATA/ATAPI-5 T13 1321D revision 1:  1 2 3 4 5

```

----------

## masseya

I'm not an hdparam wizard.  I normally don't tweak it much, but you might find my harddrive performance is sucking to be a good read and possibly helpful.   :Smile: 

----------

## MBCook

And to think I used to complain about the 15 mb/s I get on my laptop! Now you are right, that's slow. VERY slow. It's obviously not the interface, as demonstated by the cache reads (that's VERY fast). I have a few questions, I think I can help you better if you could answer them:

What kind of CPU do you have

What kind of motherboard chipset do you have?

Is there anything else on that IDE channel?

Is the drive configured properly (master/slave jumpers set right?)

It doesn't seem to be using UDMA, have you tried turning that on? It should make a LARGE difference in this case.

That's all I can think of for now. As for changing jiffies to 100, that cuts down on the timeslices in the kernel. It actually slows the system down, but it increases the responsivness, so it seems faster. Odd how things like that can be, huh? If you turn on UDMA, you might see a massive improvment.

I'm not responsible if your computer blows up in flames causing your to get 3rd degree burns over 99% of your body, which when seen cause doctors in the hospital to have a heart attack, preventing them from seeing paitents, allowing a new strain of some jungle bacteria to continue to grow and eventually overtaking the world; blah blah blah...

----------

## discostu

 *Tristam29 wrote:*   

> I'm not an hdparam wizard.  I normally don't tweak it much, but you might find my harddrive performance is sucking to be a good read and possibly helpful.  

 

I tried the first thing they said in that post and sure enough here's what I got

```

$hdparm -c 1 -d 1 /dev/hda

/dev/hda:

 setting 32-bit IO_support flag to 1

 setting using_dma to 1 (on)

 IO_support   =  1 (32-bit)

 using_dma    =  1 (on)

$ hdparm -tT /dev/hda

/dev/hda:

 Timing buffer-cache reads:   128 MB in  0.62 seconds =206.45 MB/sec

 Timing buffered disk reads:  64 MB in  1.97 seconds = 32.49 MB/sec

```

Thanks!   :Very Happy: 

----------

## MBCook

No problem. On my PC, the drives were useing a low DMA by default, so I only got a 5 mb/s speed up. I'm not suprised that that fixed it. It lets the computer transfer the data as one big chunk without the CPUs help as opposed to a bunch of little chunks that tie up the CPU. So what really happened is your CPU utilization droppoed a ton, and the drive is no longer waiting for the CPU to catch up with it, it's the other way around (as it should be  :Smile: 

----------

## discostu

What is DMA anyway? I don't know much about this sort of thing (hardware in general). Most of my computer knowledge consists of web programming and things of that nature.

----------

## praxim

DMA allows data to flow directly from the hard drive into the memory without going through the CPU first.

----------

## pilla

Direct Memory Access, it is like having a dedicated processor to copy things from devices to memory or from memory to devices.

----------

