On Monday September 30 2002 09:26 am, Technoslick wrote:
> Tom,
>
> Your comments bring up a question...
>
> In Windows, enabling DMA for CD-ROMs (and it variants) is considered
> a 'no-no' and will cause problems most every time. In many cases,
> Windows will automatically deactivate it if you set it on. How is it
> different in the Linux O/S, and what advantages are received by using
> Direct Memory Access in Linux over just using an IRQ to gain the
> attention of the CPU?
DMA has to do with faster disk IO. I don't know what you mean by
"just using an IRQ to gain the attention of the CPU?" On my mobo, as
with most all of 'em, the ide1 (second ide) is on IRQ 15. Enabling or
disabling DMA doesn't change this. IO improvement such as DMA is very
important since all drives, ide or scsi run on the 33 mhz PCI bus. Also
PIO modes (no DMA) go thru the cpu, DMA bypasses the cpu and does data
tranfers directly to memory.
The various types of DMA, eg, for my CD drive, (hdparm -i)
UDMA modes: udma0 udma1 *udma2, employ some gimmicks to improve goin
thru the 33 mhz PCI bus. Much the same as AGP compared to PCI for
video. Therorectically AGP doubles it from 33 to 66 mhz, actually it
provides less than 10% boost. It's more important for disk IO tho.
While udma2 might get 12mb/sec, udma5 will get around 40mb/sec (hdparm
-t). 'Course that's for harddrives. Enabling DMA for Cd drives won't be
near as much, but it's still better than without it .... if your
hardware is capable.
From 'info hdparm'
"Using DMA nearly always gives the best performance, with fast I/O
throughput and low CPU usage. But there are at least a few
configurations of chipsets and drives for which DMA does not make
much of a difference, or may even slow things down (on really messed up
hardware!). Your mileage may vary."
I dual boot W98 (rarely ;), it sets all my drives including my CD
drives to DMA. I can't remember any Windoze version or combo of
hardware I've used in the past that didn't enable DMA. I do remember
some Winsux burning software that disabled DMA, but that's a software
deficiency.
As to "How is it different in the Linux O/S". Memory access,
management and VM in Linux is much different than in Windoze. It's also
a moving target, with newer Linux kernels striving to constantly
improve it. Google "linux memory management", or search the kernel
mailing list. This might be a good place to start http://linux-mm.org/
--
Tom Brinkman Corpus Christi, Texas
> Sorry for the technical question, but I can't help but ask now that
> you have mentioned this. :-)
>
> T
>
> Tom Brinkman wrote:
> > On Sunday September 29 2002 08:59 pm, L.V.Gandhi wrote:
> >>Should hdparm be run for a cdrom device say /dev/hdd after it is
> >>mounted? I have HP 9100c cd writer.
> >>Enabling dma for it is worthwhile or not?
> >
> > Yes, if it doesn't cause problems. Somewhere during the 9.0
> > beta process, dma ceased to be automatically enabled for both my
> > cdrom and cd-rw. I added these lines to the end of
> > /etc/rc.d/rc.local and now all is well, no dma problems.
> >
> > hdparm -d1 /dev/hdc
> > hdparm -d1 /dev/hdd
> >
> > (Then run rc.local to make the changes happen, eg, './rc.local' On
> > subsequent boots, dma will be enabled automatically)
> >
> > So if hdparm doesn't show dma enabled, you may need to do the
> > same rc.local edit. For example, (hdc is my cdrom)
> > tom$ su
> > Password:
> > tom# hdparm -v /dev/hdc
> >
> > /dev/hdc:
> > HDIO_GET_MULTCOUNT failed: Invalid argument
> > IO_support = 1 (32-bit)
> > unmaskirq = 1 (on)
> > using_dma = 1 (on)
> > keepsettings = 0 (off)
> > readonly = 1 (on)
> > readahead = 8 (on)
> > HDIO_GETGEO failed: Invalid argument
> >
> > The failed mesgs are normal for a CD drive, they apply to
> > harddrives.
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com