Re: The floppy driver and its DMA allocation problems

David C Niemi (niemi@tux.org)
Wed, 7 Jan 1998 00:44:49 -0500 (EST)


Alan Cox (alan@lxorguk.ukuu.org.uk) Wed, 7 Jan 1998 00:37:45 +0000 (GMT)
[In reply to: Alain Knaff]
> > The patch at the end of the mail switches the floppy driver in DMA
> > less mode on boxes with more than 16 MB of memory.
>
> This seems less than ideal. Firstly it could check the floppy controller
> type before deciding, secondly trying the DMA allocation then flipping to
> nodma if it cant get it gives performance most of the time

Uh, I don't think ths is so hot either, as you almost always end up unable
to do ISA DMA on a 32 MB machine that has been running for more than a few
hours (or serving knfsd for 5 minutes). And there are presumably other
kinds of ISA DMA (sound cards? AHA154xes?) which are in the same boat. It
seems everyone agrees there is quite an annoying problem here. ISA sucks,
but even all-PCI systems will probably have ISA floppies for quite some
time.

I had some patches long ago to manage a static pool of DMA buffers, but it
was not needed back then because people usually had 4-8 MB, and moreover it
was too expensive to reserve this memory off the bat when memory was so
scarce.

I think we really need two modes of operation here, one in which memory is
conserved like it is today (for <=16MB systems) and one in which some
precious DMA-able memory is reserved (perhaps even explicitly and stupidly
in 64KB chunks) at boot time on behalf of every device that might want
some. The most the floppy driver could possibly want is 50 KB (accounting
for every theoretical bit on both sides of a track on an ED floppy). Sound
devices like some 64KB chunks. Ftape likes 32KB chunks. It would not be
all that expensive to require this memory to be statically allocated at
boot time on >16MB systems, and everyone wins. The better possibility
would be much more ISA DMA smarts for the memory scavenging routines.

To put this in perspective, I'm pretty sure I saw SCO statically allocate
600 KB right off the bat for DMA buffers on a machine with only 16 MB.

David
Niemi@tux.org 703-810-5538 Reston, Virginia, USA
"Down that path lies madness. On the other hand, the road to
hell is paved with melting snowballs." -- Larry Wall, 1992