> This is already a point where you have fallen off the hot path and you
> should really look into your application code or virtio gpu code to
> optimize it to stay on the hot path (try_qad_pin succeeds).
> 
> You should not be importing a new DMA-BUF per frame, but should instead
> keep recycling existing ones. If you keep using new buffers, you will be
> finding more and more hot spots in the code as a fresh BO (DMA-BUF or
> not) each frame is going to take a hit on the performance no matter
> what. It's not how you're supposed to write applications.

On the per-frame churn: agreed, and that side has since been fixed separately 
in virtio-gpu's driver. That reduces how often this path is hit.

> How do the numbers look like after the patch applied? It's the
> relative improvement of i915_gem_object_get_pages_dmabuf()
> that is of interest between baseline and this patch applied.

Before/after on i915_gem_object_get_pages_dmabuf(), same ARL-S/multi-VM setup 
as the earlier trace:

Baseline:
  i915_gem_object_get_pages_dmabuf   36.65%
      wbinvd_on_all_cpus               35.95%

Patched:
  i915_gem_object_get_pages_dmabuf    5.38%
      drm_clflush_virt_range            5.37% (5.35% self)
This patch optimizes that import path.

Krishna

Reply via email to