Subject: Re: physically contiguous memory
To: Lennart Augustsson <>
From: Emmanuel Dreyfus <>
List: tech-kern
Date: 03/26/2001 08:28:49
> > How do I allocate physically contiguous memory? I don't find anything
> > about this in malloc(9)...
> Why do you need it?  If it's for DMA you should probably use bus_dma(9).

The MPC project goal is to build a PC based paralell machine. It uses
custom PCI board that are able to preform a memory "put": the processor
on node A tells the board it wants a memory area to be transfered to
node B. The PCI boards do the remaining of the work, doing DMA-read on
node A, and and DMA-write on node B. Processors do not copy any byte.

Drivers are currently kerel residents (Linux and FreeBSD), and they
think about moving most of the stuff to userland, in order to avoid
performances issues related to system calls overheads. Because most of
the stuff would be userland based, it means it would be more portable. I
wonder how much effort would be needed to add NetBSD support.
The most important OS dependent thing will remain the contiguous memory
allocation. At startup, a kernel driver holds a large chunk of
physically contiguous memory. Then this driver is made avaiable to
userland through a device node, and userland processes can allocate
physically contiguous memory doint ioctl() on the device node.

The only OS dependent thing remaining should be this driver. I consider
using uvm_pglistalloc(). Do you think bus_dma() is more revelent?

Emmanuel Dreyfus. En tant que serveur, Windows NT fait en moins bien=20
ce que UNIX fait depuis des ann=E9es avec une interface utilisateur=20
que seul un utilisateur d'UNIX est capable d'admirer.