LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Enabling DMA on FC2 (https://www.linuxquestions.org/questions/fedora-35/enabling-dma-on-fc2-268466/)

coolzero 12-20-2004 12:45 PM

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

sigsegv 12-20-2004 01:00 PM

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'

coolzero 12-20-2004 01:13 PM

$ 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?

gandalf2041 12-20-2004 02:09 PM

Yep. "hdparm -Tt" should give you your new timing. Did you take one prior to the change for comparision?

coolzero 12-20-2004 04:36 PM

Great.

I deactived DMA first just to make the benchmark...
Code:

$ sudo /sbin/hdparm -d 0 /dev/hda
 
/dev/hda:
 setting using_dma to 0 (off)
 using_dma    =  0 (off)
[czo@fedorento czo]$ sudo /sbin/hdparm -t /dev/hda
 
/dev/hda:
 Timing buffered disk reads:  20 MB in  3.28 seconds =  6.10 MB/sec

Now with it activated
Code:

$ sudo /sbin/hdparm -d 1 /dev/hda
 
/dev/hda:
 setting using_dma to 1 (on)
 using_dma    =  1 (on)
[czo@fedorento czo]$ sudo /sbin/hdparm -t /dev/hda
 
/dev/hda:
 Timing buffered disk reads:  160 MB in  3.02 seconds =  52.95 MB/sec

geeeeeeeeeeee... What a difference!!

When I reboot the DMA will be automatically activated?

Tanks

sigsegv 12-20-2004 05:13 PM

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).

coolzero 12-21-2004 01:35 AM

Tanks

Belghouth 12-21-2004 07:30 AM

I want to activate DMA before starting services, when can I put my command?

sigsegv 12-21-2004 08:04 AM

Quote:

Originally posted by Belghouth
I want to activate DMA before starting services, when can I put my command?
Go back to the top of this thread and read all the way to the bottom. I already answered that.

Belghouth 12-21-2004 08:11 AM

Quote:

I already answered that
I monitered this thread from its begining, but I don' find an answer
/etc/rc.local starts ofter initializing services, and me I want to start DMA BEFORE starting services.
what about /etc/rc.sysinit ?

sigsegv 12-21-2004 10:23 AM

Quote:

Originally posted by Belghouth
I monitered this thread from its begining, but I don' find an answer
/etc/rc.local starts ofter initializing services, and me I want to start DMA BEFORE starting services.
what about /etc/rc.sysinit ?

My bad. My brain read your post faster than my eyes did.

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
ln -s /etc/init.d/setDma /etc/rc3.d/S00setDma
ln -s /etc/init.d/setDma /etc/rc5.d/S00setDma

HTH

jspaar 12-21-2004 01:44 PM

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.