De: Boris Brezillon <[email protected]>
Para: "Daniel Stone"<[email protected]>
Cc: "Igor Torrente"<[email protected]>, <[email protected]>, 
<[email protected]>, <[email protected]>, 
<[email protected]>, <[email protected]>, <[email protected]>, 
<[email protected]>, <[email protected]>
Fecha: mar, 10 nov. 2026 05:10:06 -0300
Asunto: Re: [PATCH] drm/panthor: Allow exporting BOs with an exclusive VM

 > On Mon, 9 Nov 2026 17:38:57 +0000
 > Daniel Stone <[email protected]> wrote:
 > 
 > > Hi Igor,
 > > 
 > > On Mon, 9 Nov 2026 at 10:57, Igor Torrente <[email protected]> 
 > > wrote:
 > > > Panthor currently does not allow exporting BOs with an exclusive VM.
 > > > However, VDRM (native context) drivers export BOs for import by the guest
 > > > VM, which does not attempt to bind them to any GPU VM.
 > > >
 > > > Allow these BOs to be exported and rely on
 > > > panthor_vm_prepare_map_op_ctx() to reject attempts to bind them to a
 > > > different GPU VM.  
 > > 
 > > I'm having a little trouble parsing this.
 > > 
 > > Is the problem that:
 > > - the guest requests allocation of a BO with exclusive_vm_root_gem = 
 > > guest_vm
 > > - the host passes that allocation through
 > > - the host exports a dmabuf from the allocation (which fails)
 > > - the host imports a dmabuf from the allocation (?)
 > > - the guest requests the BO be attached to guest_vm
 > > 
 > > i.e. is the problem that some host implementations (virglrenderer)
 > > handle BO allocation exclusively via an export/import interface?
 > > 
 > > If that is the problem, it seems like it would be cleaner to have the
 > > host implementation strip the exclusive VM ID from the request, until
 > > they can be fixed to not require the export/import dance.
 > 
 > Dropping the exclusive_vm assignment is indeed an option. The big issue
 > comes from the overhead incurred by BO access tracking when the BO is
 > shared:
 > 
 > - bo_wait() has to do a HANDLE_TO_FD + EXPORT_SYNC dance
 > - attach_sync_point() has to do an EXPORT_SYNC_FILE + HANDLE_TO_FD +
 >   IMPORT_SYNC_FILE dance
 > - the locking of shared BOs in the GROUP_SUBMIT path is more costly
 >   (one lock per shared BO instead of one lock for all private BOs)
 > 
 > I don't have numbers, but I suspect lowering all private BOs to
 > shared ones will have a noticeable impact on perfs.
 > 

Continuing from the previous response:

Changing Vpipe won’t work. We still need to import the exclusive-VM blob
to the Vpipe client, and the only way I’m aware of is by exporting the BO.

This leaves us with two possibilities: continue with this patch or strip
the exclusive-VM.

I ran benchmarks, and to my surprise, the results were very similar.

### Virtio_gpu

| Exclusive-vm | Masked | Masked[1]       | Non-masked |
|--------------|--------|-----------------|------------|
| vkmark       | 1689   | 1702            | 1760       |
| glmark       | 874    | black screen[2] | 909        |
| paraview     | 13.04  | 13.29           | 13.44      |

[1] Setting `exclusive_vm_id` as 0, but initializing `pan_kmod_bo_init`
    with the `exclusive_vm_id`
[2] `GROUP_SUBMIT failed: 22` (probably fixable)

### Vpipe

| Exclusive-vm | Masked | Masked[1] | Non-masked |
|--------------|--------|-----------|------------|
| vkmark       | 999    | 1003      | 1033       |
| glmark       | 768    | 867       | 869        |
| paraview     | 13.87  | 14        | 13.73      |

If these results are correct and representative, stripping `exclusive_vm`
seems like a viable option.

Reply via email to