|
Most Linux* systems default to a safe transfer mode, usually a PIO mode, which has high CPU overhead coupled with slow transfers.
Ultra DMA modes, such as UDMA2, 4, and 5, are also referred to as ATA/33, ATA/66, and ATA/100, respectively. Sometimes UDMA is referred to as "bus mastering." These are all interchangeable terms.
UDMA has several advantages:
- UDMA is bus mastering, which means that it can take control of the PCI bus
- DMA refers to "direct memory access," meaning that the device can communicate directly with system memory without using the CPU
- UDMA transfers data twice per clock cycle
- UDMA has integrated error correction (CRC)
- UDMA transfers start at 33MB/sec (burst) and go as high as 100MB/sec (burst) with Intel I/O controllers
*Note: refer to your hard drive manufacturer to determine the maximum mode supported by your hard drive. Refer to your motherboard manufacturer for the maximum mode supported by your motherboard. Linux does not verify hard drive capabilities; incorrect settings can result in data corruption. Before proceeding, back up your data and log out all other users on your system
Hardware requirements To enable UDMA transfers, certain hardware requirements have to be met:
- UDMA-aware BIOS
- I/O controller capable of UDMA (see table below)
- 40-pin, 80-conductor cable (for modes > UDMA2)
- Device capable of UDMA transfers
| Intel® I/O Controller |
Transfer Mode |
| MW-2 |
UDMA2 (ATA/33) |
UDMA4 (ATA/66) |
UDMA5 (ATA/100) |
| PIIX3 |
X |
|
|
|
| PIIX4 |
X |
X |
|
|
| ICH0 (82801AB) |
X |
X |
|
|
| ICH (82801AA) |
X |
X |
X |
|
| ICH2 (82801BA) |
X |
X |
X |
X |
| ICH2M (82801BAM) |
X |
X |
X |
X |
| ICH3M (82801CAM) |
X |
X |
X |
X |
| ICH4 (82801DB)1 |
X |
X |
X |
X |
| ICH4M (82801DB) |
X |
X |
X |
X |
| ICH5/ICH5R (82801EB/82801ER) |
X |
X |
X |
X | | Note: 1 ICH4 and later require kernel 2.4.19 or later to enable any DMA mode
Software requirements To enable UDMA transfers in Linux*, use hdparm. Some simple hdparm parameters are presented below. For additional details, refer to the hdparm man page.
To view current settings, simply run: hdparm /dev/hda (or /hdb, /hdc, etc.)
hdparm /dev/hda
/dev/hda:
| multcount |
= |
0 |
(off) |
| I/O support |
= |
0 |
(default 16-bit) |
| unmaskirq |
= |
0 |
(off) |
| using_dma |
= |
0 |
(off) |
| keepsettings |
= |
0 |
(off) |
| nowerr |
= |
0 |
(off) |
| readonly |
= |
0 |
(off) |
| readahead |
= |
8 |
(on) |
| geometry |
= |
1870/255/63, sectors = 30043440, start = 0 |
As you can see, this hard drive is not using DMA. To increase performance, use hdparm with some switches:
hdparm ?c1d1X66 /dev/hda
-c1 enables 32-bit I/O -d1 enables DMA -X66 enables ATA/33
-X switch options
| PIO mode |
Switch |
Burst Rate |
| 0 |
-X08 |
3.3MB/sec |
| 1 |
-X09 |
5.2MB/sec |
| 2 |
-X10 |
8.3MB/sec |
| 3 |
-X11 |
11.1MB/sec |
| 4 |
-X12 |
16.7MB/sec | |
| MW DMA mode |
Switch |
Burst Rate |
| 0 |
-X32 |
4.2MB/sec |
| 1 |
-X33 |
13.3MB/sec |
| 2 |
-X34 |
16.6MB/sec | |
| UDMA mode |
Switch |
Burst Rate |
| 2 (ATA/33) |
-X66 |
33MB/sec |
| 4 (ATA/66) |
-X68 |
66MB/sec |
| 5 (ATA/100) |
-X69 |
100MB/sec | |
Saving settings Method 1:
Red Hat uses /etc/rc.sysinit to call scripts /etc/sysconfig/harddiskhda, /etc/sysconfig/harddiskhdb, etc. to run hdparm upon boot.
File: /etc/sysconfig/harddiskhda:
USE_DMA=1
EIDE_32BIT=1
Note: there is only one file, /etc/sysconfig/harddisks, for all disks after installing the hdparm-RPM. If you need different hdparm parameters for each of your disks, copy /etc/sysconfig/harddisks to /etc/sysconfig/harddiskhda (hdb, hdc...) and modify it. Each disk that has no special parameters will use the defaults.
Method 2:
To enable DMA during boot, add the following line to your lilo.conf file:
append = "ide0=dma"
Method 3:
Alternately, you can try the append command with "autotune" in LILO. Some users have reported a significant decrease in boot time.
append="ide0=autotune ide1=autotune hda=autotune"
Be sure to run LILO after modifying the lilo.conf to write the boot record.
Further Reading
This applies to:
|