Linux kernel - ISA DMA page allocation

Problem description

The linux kernels have a chronic problem with the ISA DMA page allocation when the system memory is far beyond 16MB. When all memory is used, it is very often that there are no DMA pages available for the lowlevel drivers (like soundcard or ISA SCSI drivers). Unfortunately some PCI card have the address space limited, too. These cards uses also 16MB memory region to be sure, that the memory region is in the right place.

Solution

I tried made a simple patch - ftp://ftp.alsa-project.org/pub/driver/patches/page_alloc_2.2.9_2.diff. This patch creates a new DMA memory page pool. The default size (2MByte) of the DMA pool can be easily changed - the NR_DMA_PAGES define. This is only a temporary solution, but it is fully working.

The page http://www.torque.net/sg contains a SCSI testing report by Douglas Gilbert <dgilbert@interlog.com>.

You may also try an improved patch ftp://ftp.alsa-project.org/pub/driver/patches/page_alloc_2.2.9_3.diff. This patch uses reserve only small amount of DMA pages (512k) and uses this algorithm:
1. when non-DMA page is requested, it tries to allocate a non-DMA page at first
2. when DMA page is requested and it is not available in the standard pool, the DMA pool is used

Future

Andrea Arcangeli <andrea@suse.de> will work on the new improvement of the 2.3 kernel memory routines. His idea is to use some amount (including reserved one by an user) of DMA memory pages only for remappable pages (these pages can be easy moved to an another physical place, if needed). This means, if ISA DMA pages are used for non-DMA pages, the kernel will remap the non-DMA pages from a DMA space to an another space.


Copyright (c) 1999 by Jaroslav Kysela, SuSE Advanced Linux Sound Architecture