v1
2026-10-03
IOMMU 页表惰性回收 · v1
RFC 用 ioptdesc 引用计数与 shrinker 延迟回收 IOMMU 页表中部分 unmap 后变空的目录。
原始补丁链接
子 Patch(5)
1/5
iommu: Add reclaim_list xarray to struct iommu_domain
Introduce struct xarray reclaim_list to struct iommu_domain. This will serve as the O(1) storage where the fast path stores empty directories by their associated IOVA. IOVA is required by the shrinker
2/5
iommupt: Implement refcounting logic for Leaf entries
Implement a lockless state machine using the ioptdesc’s __page_refcount field. During an unmap, the driver executes atomic_sub_return() when clearing a leaf PTE. If the refcount drops to the baseline
3/5
iommupt: Add lockless sever_branch helper
Introduce a new sever_branch pt_iommu_op. This helper performs a top-down walk to locate the target parent slot and safely executes a lockless cmpxchg to 0x0. Because generic_pt abstracts all hardware
4/5
iommupt: Introduce lockless page table shrinker
Under system memory pressure, intermediate IOMMU page table directories that were left stranded by sparse unmaps consume valuable RAM. Introduce an IO Page Table Shrinker to reclaim such memory. The
5/5
iommupt: Return real page count to the shrinker core
Update the count op to return real nr_pages that can be reclaimed. Signed-off-by: Pranjal Shrivastava praan@google.com — drivers/iommu/generic_pt/iommu_pt.h | 1 + drivers/iommu/generic_pt/shrin