[PATCH 0/2] drm/xe: support VM sharing between apps

Moti Haimovski mhaimovski at habana.ai
Mon Feb 12 11:31:48 UTC 2024


HI,
 Please see Inline

> -----Original Message-----
> From: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Sent: Wednesday, 7 February 2024 12:21
> To: Moti Haimovski <mhaimovski at habana.ai>; intel-
> xe at lists.freedesktop.org
> Cc: De Marchi, Lucas <lucas.demarchi at intel.com>;
> matthew.brost at intel.com
> Subject: Re: [PATCH 0/2] drm/xe: support VM sharing between apps
> 
> [You don't often get email from thomas.hellstrom at linux.intel.com. Learn
> why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hi, Moti
> 
> 
> 
> On Tue, 2024-02-06 at 16:18 +0200, Moti Haimovski wrote:
> > This first patch set introduces support for sharing a VM (or context)
> > between applications that use different resources on the same Xe
> > device.
> >
> > The first patch adds a refcount to the VM in order support managing it
> > by multiple users/apps.
> >
> > The second patch exports the VM as a FD in order to allow other apps
> > to use it.
> >
> > Follow-up series will include the driver code to provide full
> > functionality for this feature.
> >
> > Bharat Jauhari (1):
> >   drm/xe: support to export VM as fd
> >
> > Moti Haimovski (1):
> >   drm/xe: add ref count to xe_file
> >
> >  drivers/gpu/drm/xe/xe_device.c       |  52 ++++++++++--
> >  drivers/gpu/drm/xe/xe_device.h       |   6 ++
> >  drivers/gpu/drm/xe/xe_device_types.h |   3 +
> >  drivers/gpu/drm/xe/xe_vm.c           | 121
> > +++++++++++++++++++++++++++
> >  drivers/gpu/drm/xe/xe_vm.h           |   2 +
> >  drivers/gpu/drm/xe/xe_vm_types.h     |  28 +++++++
> >  include/uapi/drm/xe_drm.h            |  27 ++++++
> >  7 files changed, 232 insertions(+), 7 deletions(-)
> >
> 
> Do we have any user-space drivers or applications available for review that
> exercises this? (We must have for the uAPI changes before pushing to drm-
> xe-next)

Yes we do, it will be uploaded in several weeks after this patch is approved as it 
Depends on it.

> 
> On the refcount to xe_file, I see that as a bit dangerous. If the xe_file is alive
> but the file closed, I figure that opens up for hard- to-track-down problems.
> Is there a way we could look at refcounting at a lower level?
> 
Got your point, if a user exports a VM and the "forgets" to close its exported FD then
All the user resources will just hang there.
I will work on a solution that will only consume the exported VM (until freed by closing its FD).

> /Thomas
> 



More information about the Intel-xe mailing list