Subject: Re: physically contiguous memory
To: Emmanuel Dreyfus <>
From: Lennart Augustsson <>
List: tech-kern
Date: 03/26/2001 10:26:21
Emmanuel Dreyfus wrote:

> > > 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.
> ....

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

Looking at your description above it sounds like you want the PCI board
to be able to do DMA on the memory, so being contiguous is not the
only requirement you have. For instance, you also need to find the
"physical address" of the memory, and it has to be in an area that is
DMAable.  So bus_dma(9) looks like the right thing to me.
 uvm_pglistalloc() looks like it's on the totally wrong abstraction level.
It's messing with memory at a far too low level.

    -- Lennart