[PATCH v2 0/2] iommu: Allow passing custom allocators to pgtable drivers

Jason Gunthorpe jgg at ziepe.ca
Fri Nov 10 07:14:28 PST 2023


On Fri, Nov 10, 2023 at 10:43:50AM +0100, Boris Brezillon wrote:
> Hello,
> 
> This patchset is an attempt at making page table allocation
> customizable. This is useful to some GPU drivers for various reasons:
> 
> - speed-up upcoming page table allocations by managing a pool of free
>   pages
> - batch page table allocation instead of allocating one page at a time
> - pre-reserve pages for page tables needed for map/unmap operations and
>   return the unused page tables to some pool

Why would these topics be unique to GPU drivers as a user?

Shouldn't improving the allocator in the io page table be done
generically?

> A real example of how such custom allocators can be used is available
> here[1]. v2 of the Panthor driver is approaching submission, and I
> figured I'd try to upstream the dependencies separately, which is
> why I submit this series now, even though the user of this new API
> will come afterwards. If you'd prefer to have those patches submitted
> along with the Panthor driver, let me know.

Patches like this should come with users, but I think you should
refocus this effort to improving the io pagetable itself not allowing
a GPU driver to replace its insides. That seems like a cop-out.

Jason



More information about the linux-arm-kernel mailing list