Enabling DMA with hdparm...

Enabling DMA with hdparm...

Post by Paul D. Smit » Thu, 02 Nov 2000 06:04:08



I have a brand new (couple of months) Dell OptiPlex GX200 workstation
now on my desk at work, running Debian 2.2 + some unstable stuff.  I'm
running a Linux 2.2.17 kernel.

My hardware is a single Intel 733MHz PIII with 256M.  It has a 133MHz
FSB, an integrated Riva TNT2, and integrated 3c59x 10/100 NIC, and an
integrated sound card (I know, all this integrated stuff irks me too,
but it's a corporate standard configuration).

The HD is a Seagate ST330630A: 30G with an Ultra ATA/66 interface.  The
sustained transfer rate is supposed to be >30 MB/sec.

It works well, but now I want to tweak my disk speed using hdparm.  My
initial setup, of course, had nothing enabled and I got about 3 MB/sec
when testing buffered disk reads with hdparm--boo!

I changed the default settings to -u1 -c3 -m16, and now I get ~7 MB/sec,
which is much better but appears to be _far_ less than this system should
be able to do.

I tried to use "-d1 -X34", but that locked up my system when I ran hparm
-tT.  I then tried "-d1 -X66", but when I re-ran hparm -tT I got these
messages:

  hda: timeout waiting for DMA
  hda: irq timeout: status=0xd0 { Busy }
  hda: DMA disabled
  ide0: unexpected interrupt, status=0x80, count=1
  ide0: reset: success

then when I looked again, DMA had been disabled and my times were
identical to what they were before:

  # hdparm /dev/hda

  /dev/hda:
   multcount    = 16 (on)
   I/O support  =  3 (32-bit w/sync)
   unmaskirq    =  1 (on)
   using_dma    =  0 (off)
   keepsettings =  0 (off)
   nowerr       =  0 (off)
   readonly     =  0 (off)
   readahead    =  8 (on)
   geometry     = 3649/255/63, sectors = 58633344, start = 0

I double-checked my kernel, and I have DMA enabled:

  # grep DMA /usr/src/linux/.config
  CONFIG_BLK_DEV_IDEDMA=y
  CONFIG_IDEDMA_AUTO=y

Also, dmesg shows this:

    ...
  PCI: PCI BIOS revision 2.10 entry at 0xfc0ce
  PCI: Using configuration type 1
  PCI: Probing PCI hardware
    ...
  Real Time Clock Driver v1.09
  PCI_IDE: unknown IDE controller on PCI bus 00 device f9, VID=8086, DID=2411
  PCI_IDE: not 100% native mode: will probe irqs later
      ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA, hdb:pio
      ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:DMA, hdd:pio
  hda: ST330630A, ATA DISK drive
  hdc: CRD-8482B, ATAPI CDROM drive
  ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
  ide1 at 0x170-0x177,0x376 on irq 15
  hda: ST330630A, 28629MB w/2048kB Cache, CHS=3649/255/63
    ...

which _appears_ to imply that DMA is enabled -- ?

I looked at the BIOS settings on this system and either I can't find the
right ones, or I'm not looking at the right screen (there appears to be
only one screen, that scrolls), but there's none of the more advanced
"Enable DMA", etc. kind of thing I'm used to with my Abit BIOS at home.

Anyone have any ideas/thoughts/pointers/help?

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

 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.

 
 
 

Enabling DMA with hdparm...

Post by anonymou » Fri, 03 Nov 2000 02:10:58


Check the kernel configuration out.  Must have dma support built in to
kernel.  I'm not sure about debian but you may need to apply udma patch to
kernel as well.  You recompile and boot to the new kernel.  Re-read the
hdparm man help file for correct commands. Hope that helps a little.
A few links:
  http://www.linux.org/docs/ldp/howto/mini/Ultra-DMA-8.html
http://www.linux.org/docs/ldp/howto/mini/Ultra-DMA.html

 
 
 

Enabling DMA with hdparm...

Post by Paul D. Smit » Fri, 03 Nov 2000 06:34:11


%% Regarding Re: Enabling DMA with hdparm...;

  a> Check the kernel configuration out.  Must have dma support built in to
  a> kernel.

Yep, did that already; from my last message:

Quote:> I double-checked my kernel, and I have DMA enabled:

>  # grep DMA /usr/src/linux/.config
>  CONFIG_BLK_DEV_IDEDMA=y
>  CONFIG_IDEDMA_AUTO=y

  a>   I'm not sure about debian but you may need to apply udma patch to
  a> kernel as well.  You recompile and boot to the new kernel.

I'm using my own kernel, compiled from vanilla Linux kernel 2.2.17
sources, with just the NFSv3 client and server patches applied.

I'll check out the udma patch; it looks like it's not being maintained
for 2.2 anymore after some 2.2.18pre release... does that mean it's
going to be folded into 2.2.x, or that I'll be SOL after that until 2.4
comes out?

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

 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.

 
 
 

Enabling DMA with hdparm...

Post by Paul D. Smit » Fri, 03 Nov 2000 08:05:27


Whew!

I installed the ide patch for my 2.2.17 kernel, then re-enabled the -X66
-d1 hdparm options... and YIKES!

  # hdparm -Tt /dev/hda

  /dev/hda:
   Timing buffer-cache reads:   128 MB in  0.80 seconds =160.00 MB/sec
   Timing buffered disk reads:  64 MB in  2.31 seconds = 27.71 MB/sec

!!!

That's compared to a measly 3 MB/sec before I started messing with
hdparm, and a best of about 7 MB/sec without the IDE patch!

Holy smokin' drives, Batman!

Thanks for the help, all.

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

 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.

 
 
 

Enabling DMA with hdparm...

Post by anonymou » Sat, 04 Nov 2000 04:42:01


Your welcome Paul.  I found the solution the same way you did(through
research). I also had the same dismal performance before applying the patch.
 
 
 

1. using hdparm to enable dma

Hi all,

I was compiling kernel 2.4.6 and I found some options related to
using bus mastered dma for hard drives.

It recommended using hdparm to configure this.

My question is ... what is the best way to ensure that using_dma
gets set every boot?  Should I add it to boot scripts?  Or is
there a way to make this permanent?

thanks!

--
Adam Schuetze, Mechanical Engineering Technologist
Mechanical Engineering Student, University of Victoria                
Cellular: 250 882 3938  Email: adam at adam-schuetze dot org
Visit my website at www dot adam-schuetze dot org
Busily working this summer in ELW B239, University of Victoria

2. Windows to X Window System connectivity, Linux, and FSF

3. (u)dma and hdparm question

4. i KNOW how-to setup a nic - BUT I CAN'T GET IT TO WORK!!!

5. hdparm dma problem: SeekComplete Error + BadCRC

6. Want install a terminal server

7. (u)dma/hdparm question

8. Welcome to comp.unix.questions [Frequent posting]

9. CD-Burners - DMA, hdparm and tweaking... AHH!!!

10. DMA troubles - hdparm?

11. Debian: hdparm DMA probs

12. hdparm and DMA

13. hdparm does not kill dma