Re: [RFC: DMA_PMD 00/22] DMA_PMD: PMD_SIZE-backed IO buffer pools

From: Luigi Rizzo

Date: Wed Oct 14 2026 - 14:15:41 EST


On Wed, Oct 14, 2026 at 7:28 PM Dragos Tatulea <dtatulea@xxxxxxxxxx> wrote:
>
> Hi Luigi,
>
> On 03.10.26 23:22, Luigi Rizzo wrote:
> > Here is a subsystem called DMA_PMD on which I would like feedback on
...
>
> Thanks for the RFC. Here are my notes (some points rephrase what was already
> said):
>
> - On CoCo VMs it seems that the only way to opt in the IOMMU optimization is to
> also opt in the copy avoidance which is not always desirable.
>
> - Having the pool generic opens up more visibility from the untrusted host
> side. Having device based pools at least isolates one device's memory from
> the rest of the system.
>
> - Also, device driver could help with provisioning just the right amount of
> memory that is needed. And per device control also means that probably
> you don't need to map everything RW to the IOMMU.

Yes on all three. I am looking into providing more knobs for different levels
of opt-in and isolation, so users may adjust them according to the
threat models and performance goals.

I am not especially worried about provisioning because the system is
already reasonably adaptive, and leveraging existing caches, the waste
the waste due to allocating 2MB units can be kept relatively small.

As an example, the update I am working on has the following:
- a lean per-cpu cache that can be attached on top of a dma_pmd_pool,
similar to the one used by the buddy allocator. The dma_pmd_pool will hold
the 2MB pages, and the caches can buffer smaller sets, reducing the waste.
Useful on the tx side.
- on the receive side, one dma_pmd_pool per device will feed all
pagepools for that device (typically one per queue).
The pagepool is already a pretty good cache that does not
access the allocator often, so once again the waste due to
partially used pages is minimized.

cheers
luigi