Re: Ideas for memory management hackers (2)

Alan Cox (
Tue, 18 Nov 1997 18:42:13 +0000 (GMT)

> How 'bout a means for device drivers (modules) to lock a stretch of
> process pages into memory, get physical addresses, and be able to set up
> i.e. DMA directly into those pages.

See the 2.1.6x CVS has a contributed piece of code by Robert Kaiser to do
exactly this. It only works for situations where the device can DMA to all
of RAM as the user pages could be anywhere.

> I understand that it is a bad idea in general, but I am usually faced with
> devices transferring large images (i.e. 300DPI 11"x17" Gray images) and
> I find myself getting a bunch of pages, marking them reserved, and using
> mmap to share them with the process.

Same with all the video capture cards. I'm trying to get userdma working
right with the bttv right now.

> (I have a sample module that shows how to do this, if anybody is interested.)

yes please. Perhaps you might also want to contribute it to the Linux kernel
internals book for the Linux Doc project , or put it on sunsite as a
skeleton mmap driver