But if we need a DMA buffer that is physically contiguous can't we
just move non-DMA pages around and adjust the page tables such that
logical addresses stay the same?
> > or (b) when you can't find
> > 8 contiguous pages, pick the first free page and swap
> > the data in the next 7 adjacent pages with other free
> > pages in memory. Method (b) could construct any number of
> > contiguous free pages atomically with the only penalty
> > being some chunky memcpy's ...
>
> Plus you have the overhead of changing references, plus you have
> cache penalty overheads if you move a hot page. But if you manage
> the page pool well you can make good decisions and use reclaim
> if necessary quite effectively. As long as you don't let dirty
> pages build up even large atomic requests should be satisfiable.
It should be possible to change page tables and let all other references
stay the same. And if performance is lower it is still better than
"fd0: can't alloc DMA buffers" (note that moving pages is only
necessary if the allocation would fail otherwise).
-- Jan