enabling DMA on hard drives

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Jan 19 17:22:08 UTC 2005


On Wed, Jan 19, 2005 at 11:30:31AM +0200, Peter L. Peres wrote:
> The kernel always uses the default mode of the drive, and won't 'tune' 
> anything it is not asked to. dma is enabled by scripts in init.d etc. If 
> you do hdparm -I you will get a lot of info on the drive. One particular 
> piece of info is the timing. That is 'Cycle time'. If it says 120ns (a 
> common value), then the maximum speed with 16bit data path is 2 bytes * 
> 1/120nsec ~= 16.6MBps. Now compare this to the output of hdparm -t. If 
> the two numbers only show 5-10% difference then the setup is probably 
> optimal and cannot be improved by (u)dma settings. Of course I would be 
> glad to be wrong on this. My current (slow, 4 year old) hdd in this 
> machine shows a computed maximum of 16.6 MBps and a hdparm -t of 
> 16.18MBps. i.e. I cannot do anything significant to speed it up. It is 
> the default boot setup from Debian, no tuning was performed. Udma etc is 
> enabled automatically by init scripts (/etc/init.d/hdparm). I would very 
> much like to see an off the shelf ide drive that is inexpensive and does 
> 33 MBps or more as shown by hdparm -t (that would still only tax the 
> drive-interface-cable-kernel subsystem to 50% assuming it's using UDMA-1 
> or -2), and that's on a semi-obsolete system!

The debian kernels do default to autotune and turn on dma when possible.
Without DMA it is normal to get about 2 or 3MB/s instead.

Here are the hdparm -tT outputs from a 2.8GHz P4HT with a 120GB WD SATA
drive:

rceng01:~# hdparm -tT /dev/sdb

/dev/sda:
 Timing cached reads:   3584 MB in  2.00 seconds = 1792.27 MB/sec
 Timing buffered disk reads:  152 MB in  3.00 seconds =  50.62 MB/sec

On an Athlon XP 2800+ with the same drive model:

debdev1:~# hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   1536 MB in  2.00 seconds = 766.58 MB/sec
 Timing buffered disk reads:  146 MB in  3.00 seconds =  48.63 MB/sec

Both are 1GB dual channel memory.

> (ps: a small check: ~500MHz P3 system on intel board and cheap WD hdd 
> disk shows over 240MBps -T and 16.1/16.7 -t (=>96% of possible disk 
> transfer speed)). So you can see where the bottleneck is. The drive uses 
> udma2 (it can go to udma 4 acc -I info). My conclusion: spend money on a 
> good drive after researching real world data (as opposed to urban myths 
> and marketing 'data') and leave the kernel and scripts to do their 
> thing, they are already very good at it.

When asked to the kernel tends to do a good job, but you can build
kernels that don't default to turning on DMA.

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list