Thread (55 messages) read the whole thread 55 messages, 7 authors, 2025-03-18

Re: [PATCH v3 14/23] iommu/pages: Move from struct page to struct ioptdesc and folio

From: Baolu Lu <baolu.lu@linux.intel.com>
Date: 2025-02-26 14:38:21
Also in: asahi, linux-iommu, linux-patches, linux-riscv, linux-rockchip, linux-samsung-soc, linux-sunxi, linux-tegra

On 2025/2/26 3:39, Jason Gunthorpe wrote:
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.
I understand that this is intended as the start point of having private
descriptors for folios allocated to iommu drivers. But I don't believe
this is currently the case after this patch, as the underlying memory
remains a struct folio. This patch merely uses an iommu-pages specific
structure pointer to reference it.

Could you please elaborate a bit on the future plans that would make it
a true implementation of iommu private page descriptors?
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.

Signed-off-by: Jason Gunthorpe<jgg@nvidia.com>
---
  drivers/iommu/iommu-pages.c | 54 ++++++++++++++++++++++++++-----------
  drivers/iommu/iommu-pages.h | 43 ++++++++++++++++++++++++++---
  2 files changed, 78 insertions(+), 19 deletions(-)
Thanks,
baolu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help