Re: [RFC PATCH v3 00/25] PISA: Pre-mapped IOVA Superpage Allocator for DMA and CoCo

From: Niklas Schnelle

Date: Thu Nov 26 2026 - 15:47:40 EST


On Mon, 2026-11-23 at 09:50 -0800, Naman Gulati wrote:
> On Mon, Nov 23, 2026 at 2:10 AM Niklas Schnelle <schnelle@xxxxxxxxxxxxx> wrote:
> >
> > On Fri, 2026-11-20 at 15:19 +0100, Luigi Rizzo wrote:
> > > On Fri, Nov 20, 2026 at 2:50 PM Jason Gunthorpe <jgg@xxxxxxxx> wrote:
> > > >
> > > > On Fri, Nov 20, 2026 at 01:06:30AM +0000, Luigi Rizzo wrote:
> > > > > This is v3 of the RFC previously posted as DMA_PMD [0], now renamed PISA
> > > > > ("Pre-mapped IOVA Superpage Allocator"). The text below follows
> > > > > Documentation/core-api/pisa.rst (patch 25/25), which has the details.
> > > >
> > > > I thought the conclusion was to just do this stuff in netdev pagepool,
> > > > now you come with an enormous AI series spread across the entire
> > > > kernel?
> >
--- snip ---
> > Now, I wonder if we can't start with something simple. What if the page
> > pool could start by allocating in batches of PMD sized and aligned
> > folios of contiguous pages that can share a single large IOMMU
> > translation. The page pool can then still hand out pages from that
> > batch without having to do sub-page allocation but would already use
> > much fewer IOTLB entries and the locality might even help non IOMMU
> > workloads. So, I'd even hope this could be enabled by default and this
> > is actually something I don't like about this series, I really don't
> > like having a tunable when we know that larger IOMMU mappings are
> > strictly better when you have an IOMMU that supports them.
> >
> > I think that approach would also align with Jason's idea to keep things
> > within the network stack and to work with the tools we have until their
> > limits become very clear.
>
> Hi Niklas,
>
> I have been working on this idea exactly - extending the network
> page-pool with a memory provider that allocates large pages, splitting
> them into N smaller pages that all share a single IOMMU entry. I
> breifly shared my approach in the v1 PMD series [1]. I'm readying a
> short RFC to share shortly, would appreciate your feedback.
>
>
> [1] https://lore.kernel.org/netdev/CAMP57yWvHO0pWCR3-9q1gtwVe8WV4Y6i69trmw+BJRVYf3JB1g@xxxxxxxxxxxxxx/
>

Hi Naman,

This does look more contained, but I'd say you should still go simpler
and fewer steps per series. Some thoughts:

- Drop the CoCo aspect for now. The shadowing / virtio-iommu and IOTLB
performance aspects stand on their own in my opinion and the focus
makes it easier to review too. As Jason said it's then really just
normal memory that was pre-mapped for DMA.
- I'm not a network stack expert but I think using the page pool for TX
warrants its own series. Maybe just start with RX, this is also where
we see the biggest performance issues and it would hopefully make the
patches at least a bit more manageable.
- This is still a LOT of churn, my gut says much of the benefit should
be possible with much less churn. It's really too much to follow but a
cursory look makes me feel like there is duplication between rx and tx,
which is weird since for the pre-mapping they should be quite similar.
There also seems to be very little integration with the existing page
pool, rather it seems to set up a parallel mechanism for the pre-mapped
buffers. Really in a first step I think we "just" want to use a more
efficient DMA mapping and contiguous memory chunks for the page pool
and also keep the page pool API unchanged as much as possible.

These are only guesses from looking at the GitHub branch a bit, I did
not dive super deep.

Thanks,
Niklas
>