iommu/pages: Move from struct page to struct ioptdesc and folio
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Apr 2025 16:54:01 +0000 (13:54 -0300)
committerJoerg Roedel <jroedel@suse.de>
Thu, 17 Apr 2025 14:22:44 +0000 (16:22 +0200)
commit212fcf36c6a6ee948790f9b860e89f87c68deb35
treeeee3e00a455b761d8366befe0f391c4107983584
parent27bc9f717f8dd0b987e9e5a59dbbc74f501f67a6
iommu/pages: Move from struct page to struct ioptdesc and folio

This brings the iommu page table allocator into the modern world of having
its own private page descriptor and not re-using fields from struct page
for its own purpose. It follows the basic pattern of struct ptdesc which
did this transformation for the CPU page table allocator.

Currently iommu-pages is pretty basic so this isn't a huge benefit,
however I see a coming need for features that CPU allocator has, like sub
PAGE_SIZE allocations, and RCU freeing. This provides the base
infrastructure to implement those cleanly.

Remove numa_node_id() calls from the inlines and instead use NUMA_NO_NODE
which will get switched to numa_mem_id(), which seems to be the right ID
to use for memory allocations.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/13-v4-c8663abbb606+3f7-iommu_pages_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu-pages.c
drivers/iommu/iommu-pages.h