Re: [PATCH 1/2] iommu/io-pgtable-arm: Implement .iotlb_sync_map callback

Jason Gunthorpe
2025-11-04T13:37:29Z

On Tue, Nov 04, 2025 at 01:28:35PM +0000, Will Deacon wrote:
> If that's not workable (due to Daniel's performance worries), another
> option is to bring back the ->map_sg() hook (removed by d88e61faad52
> ("iommu: Remove the ->map_sg indirection")) and implement an optimised
> version of that, preferably sharing as much code as possible with the
> existing map path.

I've been broadly thinking of doing this. The benchmarks I've run
suggest there are decent gains in avoiding the re-walks, so we can
speed up the map_sg operation by working directly on the scatterlist
without rewalking every next sgent. That cleanly solves the CMO issue
as well.

I think the page table rework will land this cycle, that would be the
right time to attempt it as we should not be trying to make the
duplicated page table code any more complicated.

Jason