lkml.org 
[lkml]   [2018]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v2 1/2] vfio/type1: Adopt fast IOTLB flush interface when unmap IOVAs
From
Date
Hi Alex,

On 1/9/18 4:07 AM, Alex Williamson wrote:
>>> @@ -661,6 +705,8 @@ static long vfio_unmap_unpin(struct vfio_iommu *iommu, struct vfio_dma *dma,
>>> if (!IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu))
>>> return 0;
>>>
>>> + INIT_LIST_HEAD(&unmapped_regions);
>>> +
>>> /*
>>> * We use the IOMMU to track the physical addresses, otherwise we'd
>>> * need a much more complicated tracking system. Unfortunately that
>>> @@ -698,24 +744,36 @@ static long vfio_unmap_unpin(struct vfio_iommu *iommu, struct vfio_dma *dma,
>>> break;
>>> }
>>>
>>> - unmapped = iommu_unmap(domain->domain, iova, len);
>>> - if (WARN_ON(!unmapped))
>>> + entry = kzalloc(sizeof(*entry), GFP_KERNEL);
>>> + if (!entry)
>>> break;
>
> Turns out this nagged at me a bit too, this function only gets called
> once to dump the vfio_dma, so bailing out here leaves pages pinned and
> IOMMU mappings in place, for a performance optimization that we could
> just skip. We could sync&unpin anything collected up to this point and
> continue this step with a synchronous unmap/unpin. Thanks,

Ah, that's an over look in my part also. Thanks for catching this. I'll implement
the fallback mechanism per your suggestion in v3.

Thanks,
Suravee

\
 
 \ /
  Last update: 2018-01-18 00:21    [W:0.074 / U:2.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site