Re: [RFC PATCH 0/5] iommupt: Introduce IO page table shrinker

From: Pranjal Shrivastava

Date: Mon Nov 30 2026 - 10:35:45 EST


On Mon, Nov 09, 2026 at 10:52:50AM -0400, Jason Gunthorpe wrote:
> On Mon, Nov 09, 2026 at 12:34:54PM +0000, Mostafa Saleh wrote:
>
> > I believe there is a value in supporting other users beyond IOMMUFD/VFIO
> > (eg. DMA domains) or even outside of iommupt, I haven't investigated this,
> > but it's worth looking into either integrating the "iommupt clean(gap)"
> > idea in the IOVA allocator or more generally rely on refcounting +
> > shrinker (or other method).
>
> The main point is to avoid the refcounting because that is going to be a
> perf negative for everyone..
>

IIUC, we are also wanting to avoid refcounting for observability, right?

> I think most people should be able to do a clean call, and if it is
> routed as a generic domain function that would be fine too
>

Right.. in that case I suppose we'd move forward with IOMMUFD ioctls
that take a lock (maybe iova_rwsem?) for both, clean up and
observability? And a similar approach can be taken for in-kernel users?

My question was why shall we walk each time (with a lock) just for
observability? Can't we follow the refcounted approach just for
observability as in the RFC series [1] and just avoid refcounting for
PTEs? Since that's iommu->domain level refcounting it should not be in
any perf-sensitive path too?

An offline discussion with Joerg revealed that there's interest to have
observability even if we have the required shrinking / clean up logic in
place. I was wondering if that could mean keeping the observability
series [1], almost similar apart from dropping the vfio-type1 support?
WDYT?

Thanks,
Praan

[1] https://lore.kernel.org/all/20261001224531.765278-1-praan@xxxxxxxxxx/