Re: [PATCH 4/4] vfio/type1: optimize vfio_unpin_pages_remote() for large folio
From: lizhe . 67
Date: Thu Jul 03 2025 - 02:12:58 EST
On Wed, 2 Jul 2025 15:28:44 -0300, jgg@xxxxxxxx wrote:
> On Mon, Jun 30, 2025 at 03:25:18PM +0800, lizhe.67@xxxxxxxxxxxxx wrote:
> > diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> > index a02bc340c112..7cacfb2cefe3 100644
> > --- a/drivers/vfio/vfio_iommu_type1.c
> > +++ b/drivers/vfio/vfio_iommu_type1.c
> > @@ -802,17 +802,29 @@ static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr,
> > return pinned;
> > }
> >
> > +static inline void put_valid_unreserved_pfns(unsigned long start_pfn,
> > + unsigned long npage, int prot)
> > +{
> > + unpin_user_page_range_dirty_lock(pfn_to_page(start_pfn), npage,
> > + prot & IOMMU_WRITE);
> > +}
>
> I don't think you need this wrapper.
>
> This patch and the prior look OK
Thank you very much for your review. The primary purpose of adding
this wrapper is to make the code more comprehensible. Would it be
better to keep this wrapper? Perhaps we could also save on the need
for some comments.
Thanks,
Zhe