Enabling DMA on FC2
Hi.
I've made a search on the forum and stated that enabling DMA will "make Linux faster". Is there a tutorial on how to activate it? Where can I see if i'm using DMA or not? Tanks |
You use hdparm for this. man hdparm for more info (assuming it's installed). The command is going to be something like: hdparm -c 1 -d 1 -u 1 /dev/hda
replace hda with your disk letter if it's not 'a' |
$ sudo /sbin/hdparm -c 1 -d 1 -u 1 /dev/hda
/dev/hda: setting 32-bit IO_support flag to 1 setting unmaskirq to 1 (on) setting using_dma to 1 (on) IO_support = 1 (32-bit) unmaskirq = 1 (on) using_dma = 1 (on) And now? It's done? |
Yep. "hdparm -Tt" should give you your new timing. Did you take one prior to the change for comparision?
|
Great.
I deactived DMA first just to make the benchmark... Code:
$ sudo /sbin/hdparm -d 0 /dev/hda Code:
$ sudo /sbin/hdparm -d 1 /dev/hda When I reboot the DMA will be automatically activated? Tanks |
Unfortunately, no. You'll need to add the command to the end of /etc/rc.local (there are other places, but rc.local is the simplest).
|
Tanks
|
I want to activate DMA before starting services, when can I put my command?
|
Quote:
|
Quote:
/etc/rc.local starts ofter initializing services, and me I want to start DMA BEFORE starting services. what about /etc/rc.sysinit ? |
Quote:
I don't think I'd put it in rc.sysinit in the off chance that some package might update that file and wipe out your changes. If you really want to do it right, create a script to set the DMA the way you want it, and place it in (for example) /etc/init.d/setDma. Then create symlinks to it in the appropriate runlevel directories so that it gets executed before everything else, like so: Code:
ln -s /etc/init.d/setDma /etc/rc2.d/S00setDma |
It's likely that DMA is already enabled for your hard disk at boot time.
One way to check: - Remove that hdparm from rc.local and reboot. - Run this at a command line: $ sudo hdparm /dev/hda Look in the output for: using_dma = 1 (on) If it says "on", then DMA is already on for that drive automatically. |
All times are GMT -5. The time now is 09:02 AM. |