Re: DMA page allocation

Douglas Gilbert (dgilbert@interlog.com)
Fri, 18 Jun 1999 20:47:58 -0400


Andrea Arcangeli wrote:

> [snip]
>
> Again your way is fine but it would be nice to be able to get DMA pages
> without having to reserve some fixed amount of ram. And think if somebody
> needs more than 2mbyte of DMA ram (unlikely in the common case, but...).

Look at this from alt-sysRq M:

....
Free pages: 1540kB [385 (128 256 384)]
90*4kB 65*8kB 8*16kB 1*32kB 0*64kB 2*128kB 1*256kB 1*512kB
1*1024kB 5*2048kB = 13328kB
Free DMA pages: 948kB [237]
1*4kB 2*8kB 2*16kB 2*32kB 1*64kB 0*128kB 1*256kB 1*512kB
0*1024kB 0*2048kB = 948kB
....

Over 1 MB gone below the 16 MB level (ie the "Free DMA pages"
entry) and this system is hardly doing anything. Why?

# cat /proc/scsi/scsi

Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: DCHS04U Rev: 2727
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: IBM Model: DCHS04U Rev: 2727
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 06 Lun: 00
Vendor: YAMAHA Model: CRW4416S Rev: 1.0f
Type: CD-ROM ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 04 Lun: 00
Vendor: TOSHIBA Model: CD-ROM XM-3701TA Rev: 3415
Type: CD-ROM ANSI SCSI revision: 02

The SCSI sub-system (mid level to be precise) has gobbled
it up. And the more adapters, devices and high level
drivers I load, the more it will want. Then there is
sound, floppy drivers and probably more besides.

2 MB may not be enough. Perhaps the DMA buffers size could a
parameter to the linux kernel and/or a /proc/sys/kernel
entry as well. It could be scaled up if memory >= 128 MB
and scaled back if memory <= 24 MB (just guessing ...).

Doug Gilbert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/