Intel芯片( 500MHZ + 128SDRAM + 20G)
ubuntu5.04( linux-686 + gnome )
开启硬盘DMA支持
(本方法可能不适用于AMD芯片,内容仅供参考)
以下先来测试一下看看未打开DMA功能与打开DMA的数据传送速度差别!
如果硬盘机支持 ATA33 可以加上 -X66 这个参数,ATA66则是 -X68,
我的硬盘是 ATA33 那么完整参数就是 /sbin/hdparm -d1 -X66 -c3 -m16 /dev/hda
>>>>>>>>>>>>>>>>>未打开DMA功能的测试结果>>>>>>>>>>>>>>>>>>>>>>
代码: 全选
$ sudo hdparm -d0 /dev/hda
setting using_dma to 0 (off)
using_dma = 0 (off)
代码: 全选
$ sudo hdparm -Tt /dev/hda
Timing cached reads: 432 MB in 2.01 seconds = 215.07 MB/sec
Timing buffered disk reads: 14 MB in 3.24 seconds = 4.32 MB/sec
>>>>>>>>>>>>>>>>>>>打开DMA功能的测试结果>>>>>>>>>>>>>>>>>>>>>>
代码: 全选
$ sudo hdparm -d1 -X66 -c3 -m16 /dev/hda
setting 32-bit IO_support flag to 3
setting multcount to 16
setting using_dma to 1 (on)
setting xfermode to 66 (UltraDMA mode2)
multcount = 16 (on)
IO_support = 3 (32-bit w/sync)
using_dma = 1 (on)
代码: 全选
$ sudo hdparm -Tt /dev/hda
Timing cached reads: 436 MB in 2.00 seconds = 217.49 MB/sec
Timing buffered disk reads: 58 MB in 3.09 seconds = 18.77 MB/sec
测试结果表明打开DMA功能数据传送速度确实有提升了不少!
系统安装完毕後,硬盘的 DMA 是没有打开的.
我的方法是:
修改/etc/modules 在ide-cd前增加 piix 与 ide-core两项
贴一下偶的/etc/modules文件内容
代码: 全选
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
#
# 打开DMA功能,加速linux系统!
# 由于偶使用Intel CPU 所以加入以下内容
#
piix
ide-core
###############################################################################
# 以下为原来的部分
ide-cd
ide-disk
ide-generic
lp
mousedev
psmouse
这样每次开机後,硬盘的DMA就会开启!
未修改/etc/modules文件前的系统硬件信息
运行
代码: 全选
$ dmesg
IPv6 over IPv4 tunneling driver
eth1: no IPv6 routers present
hda: DMA disabled
ide0: Speed warnings UDMA 3/4/5 is not functional.
hda: DMA disabled
ide0: Speed warnings UDMA 3/4/5 is not functional.
hda: DMA disabled
ide0: Speed warnings UDMA 3/4/5 is not functional.
hda: DMA disabled
清楚见到没有打开DMA功能
修改/etc/modules文件重启后的系统硬件信息
运行
代码: 全选
$ dmesg
hda: IC25N020ATMR04-0, ATA DISK drive
elevator: using anticipatory as default io scheduler
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: max request size: 1024KiB
hda: 39070080 sectors (20003 MB) w/1740KiB Cache, CHS=16383/255/63, UDMA(33)
hda: cache flushes supported
/dev/ide/host0/bus0/target0/lun0: p1 p2 p3 < p5 p6 p7 p8 >
Probing IDE interface ide1...
Probing IDE interface ide2...
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...
呵呵,已经打开了DMA功能! 可惜偶的只是UDMA(33)