RE: [PATCH v4 08/17] iommufd: Algorithms for PFN storage

Tian, Kevin
2022-11-15T03:07:55Z

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Tuesday, November 15, 2022 2:03 AM
> - mutex_lock(&area->pages->mutex);
> - rc = iopt_pages_add_access(area->pages, index, last_index,
> - out_pages, flags);
> - if (rc) {
> - mutex_unlock(&area->pages->mutex);
> + rc = iopt_pages_add_access(area, index, last_index,
> out_pages,
> + flags);
> + if (rc)

iopt_area_add_access(), which I suppose you have already fixed when
compiling this change. but just in case... 😊

> @@ -1819,40 +1838,49 @@ iopt_pages_get_exact_access(struct iopt_pages
> *pages, unsigned long index,
> *
> * This should be undone through a matching call to
> iopt_pages_remove_access()

iopt_area_remove_access()

> @@ -1865,11 +1893,11 @@ int iopt_pages_add_access(struct iopt_pages
> *pages, unsigned long start_index,
> * Undo iopt_pages_add_access() and unpin the pages if necessary. The

iopt_area_add_access()

with above,

Reviewed-by: Kevin Tian <kevin.tian@intel.com>