lkml.org 
[lkml]   [2020]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] vfio iommu type1: Improve vfio_iommu_type1_pin_pages performance
From
Date
On 2020/11/11 23:56, Alex Williamson wrote:
> On Tue, 10 Nov 2020 21:42:33 +0800
> "xuxiaoyang (C)" <xuxiaoyang2@huawei.com> wrote:
>
>> vfio_iommu_type1_pin_pages is very inefficient because
>> it is processed page by page when calling vfio_pin_page_external.
>> Added contiguous_vaddr_get_pfn to process continuous pages
>> to reduce the number of loops, thereby improving performance.
>
> vfio_pin_pages() accepts an array of unrelated iova pfns and processes
> each to return the physical pfn. AFAICT this proposal makes an
> unfounded and unverified assumption that the caller is asking for a
> range of contiguous iova pfns. That's not the semantics of the call.
> This is wrong. Thanks,
>
> Alex
>
> .
>
Thank you for your reply. Sorry that the comment is too simple
and not clear enough.
We did not change the external behavior of the function. What we
have to do is to divide the iova pfn array into multiple continuous
ranges and optimize them. For example, when the iova pfn array is
{1,5,6,7,9}, it will be divided into three groups {1}, {5,6,7}, {9}
for processing. When processing {5,6,7}, the number of calls to
pin_user_pages_remote is reduced from 3 times to once. The more
continuous the iova pfn array, the greater the performance improvement.
I see that most of the iova pfn arrays processed by callers are
continuous, such as pfn_array_pin, gvt_pin_guest_page. For them,
performance will be improved.

Regards,
Xu

\
 
 \ /
  Last update: 2020-11-12 12:50    [W:2.606 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site