Re: 2.0.30 floppy problem

Mark Hemment (markhe@nextd.demon.co.uk)
Tue, 15 Apr 1997 00:49:46 +0100 (BST)


Hi,

On Mon, 14 Apr 1997, Alain Knaff wrote:
> This problem is well known, but unfortunately there is no clean fix
> for it yet :-( The source of the problem is that only memory below
> 16M is suitable for DMA.

Correct (for an ISA bus, which we have to assume).

> The way how memory allocation works is that
> the memory manager first searches for suitable memory which is already
> free, and if none is found, it tries to free some more by swapping or
> tossing away buffers. Unfortunately, the last part of the algorithm
> (freeing more memory) doesn't have any knowledge of the _kind_ of
> memory requested.

Almost correct.

When trying to free memory for DMA, it does take into account the type of
memory (that is the purpose of the 'dma' flag to try_to_free_page()).

Two problems occur:
1) There might be enough memory in the free-page pool, but not
of the correct type. __get_free_page() doesn't take this into
account (the fix for this is trivial).
2) The floppy driver requests 16 contigious pages, which
is high for __get_free_page() to return. If that fails, it
drops back to 8 contiguous pages (which is still high).

A simple fix for 1) and 2) is to make __get_free_page() try much harder.
This does have side effects (a lot of useful data is flush), but (for the
floppy case) being able use the device is more important than any loses.

Making 2) intelligent is complex (clone()d tasks, and SMP complicate
matters further). The design is being thought about at the moment, but do
not hold your breath waiting for an implementation.....

> One workaround for this problem is to boot with floppy=nodma.

Very useful to know.

Regards,

markhe

------------------------------------------------------------------
Mark Hemment, Unix/C Software Engineer (Contractor)
markhe@nextd.demon.co.uk http://www.nextd.demon.co.uk/
"Success has many fathers, failure is a B**TARD!" - anon
------------------------------------------------------------------