Message ID | 20200903161446.29615-5-eperezma@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | memory: Skip assertion in memory_region_unregister_iommu_notifier | expand |
On Thu, Sep 03, 2020 at 06:14:45PM +0200, Eugenio Pérez wrote: > Although they didn't reach the notifier because of the filtering in > memory_region_notify_iommu_one, the vt-d was still splitting huge > memory invalidations in chunks. Skipping it. > > This improves performance in case of netperf with vhost-net: > * TCP_STREAM: From 1923.6Mbit/s to 2175.13Mbit/s (13%) > * TCP_RR: From 8464.73 trans/s to 8932.703333 trans/s (5.5%) > * UDP_RR: From 8562.08 trans/s to 9005.62/s (5.1%) > * UDP_STREAM: No change observed (insignificant 0.1% improvement) > > Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index ab6833d5a0..fbbda0c87e 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1478,6 +1478,10 @@ static int vtd_sync_shadow_page_table(VTDAddressSpace *vtd_as) VTDContextEntry ce; IOMMUNotifier *n; + if (!(vtd_as->iommu.iommu_notify_flags & IOMMU_NOTIFIER_IOTLB_EVENTS)) { + return 0; + } + ret = vtd_dev_to_context_entry(vtd_as->iommu_state, pci_bus_num(vtd_as->bus), vtd_as->devfn, &ce);
Although they didn't reach the notifier because of the filtering in memory_region_notify_iommu_one, the vt-d was still splitting huge memory invalidations in chunks. Skipping it. This improves performance in case of netperf with vhost-net: * TCP_STREAM: From 1923.6Mbit/s to 2175.13Mbit/s (13%) * TCP_RR: From 8464.73 trans/s to 8932.703333 trans/s (5.5%) * UDP_RR: From 8562.08 trans/s to 9005.62/s (5.1%) * UDP_STREAM: No change observed (insignificant 0.1% improvement) Signed-off-by: Eugenio Pérez <eperezma@redhat.com> --- hw/i386/intel_iommu.c | 4 ++++ 1 file changed, 4 insertions(+)