Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-13 Thread Danilo Krummrich
On 11/13/23 08:22, Christian König wrote: Am 10.11.23 um 17:57 schrieb Danilo Krummrich: On 11/10/23 09:50, Christian König wrote: [SNIP] Another issue Christian brought up is that something intended to be embeddable (a base class) shouldn't really have its own refcount. I think that's a

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-12 Thread Christian König
Am 10.11.23 um 17:57 schrieb Danilo Krummrich: On 11/10/23 09:50, Christian König wrote: [SNIP] Another issue Christian brought up is that something intended to be embeddable (a base class) shouldn't really have its own refcount. I think that's a valid point. If you at some point need to

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-10 Thread Danilo Krummrich
On 11/10/23 09:50, Christian König wrote: Am 09.11.23 um 19:34 schrieb Danilo Krummrich: On 11/9/23 17:03, Christian König wrote: Am 09.11.23 um 16:50 schrieb Thomas Hellström: [SNIP] Did we get any resolution on this? FWIW, my take on this is that it would be possible to get GPUVM to

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-10 Thread Danilo Krummrich
On 11/10/23 11:52, Thomas Hellström wrote: On 11/10/23 11:42, Christian König wrote: Am 10.11.23 um 10:39 schrieb Thomas Hellström: [SNIP] I was thinking more of the general design of a base-class that needs to be refcounted. Say a driver vm that inherits from gpu-vm, gem_object and yet

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-10 Thread Danilo Krummrich
On 11/10/23 10:39, Thomas Hellström wrote: On 11/10/23 09:50, Christian König wrote: Am 09.11.23 um 19:34 schrieb Danilo Krummrich: On 11/9/23 17:03, Christian König wrote: Am 09.11.23 um 16:50 schrieb Thomas Hellström: [SNIP] Did we get any resolution on this? FWIW, my take on this is

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-10 Thread Thomas Hellström
On 11/10/23 11:42, Christian König wrote: Am 10.11.23 um 10:39 schrieb Thomas Hellström: [SNIP] I was thinking more of the general design of a base-class that needs to be refcounted. Say a driver vm that inherits from gpu-vm, gem_object and yet another base-class that supplies its own

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-10 Thread Christian König
Am 10.11.23 um 10:39 schrieb Thomas Hellström: [SNIP] I was thinking more of the general design of a base-class that needs to be refcounted. Say a driver vm that inherits from gpu-vm, gem_object and yet another base-class that supplies its own refcount. What's the best-practice way to do

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-10 Thread Thomas Hellström
On 11/10/23 09:50, Christian König wrote: Am 09.11.23 um 19:34 schrieb Danilo Krummrich: On 11/9/23 17:03, Christian König wrote: Am 09.11.23 um 16:50 schrieb Thomas Hellström: [SNIP] Did we get any resolution on this? FWIW, my take on this is that it would be possible to get GPUVM to

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-10 Thread Christian König
Am 09.11.23 um 19:34 schrieb Danilo Krummrich: On 11/9/23 17:03, Christian König wrote: Am 09.11.23 um 16:50 schrieb Thomas Hellström: [SNIP] Did we get any resolution on this? FWIW, my take on this is that it would be possible to get GPUVM to work both with and without internal

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-09 Thread Danilo Krummrich
On 11/9/23 17:03, Christian König wrote: Am 09.11.23 um 16:50 schrieb Thomas Hellström: [SNIP] Did we get any resolution on this? FWIW, my take on this is that it would be possible to get GPUVM to work both with and without internal refcounting; If with, the driver needs a vm close to

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-09 Thread Christian König
Am 09.11.23 um 16:50 schrieb Thomas Hellström: [SNIP] Did we get any resolution on this? FWIW, my take on this is that it would be possible to get GPUVM to work both with and without internal refcounting; If with, the driver needs a vm close to resolve cyclic references, if without that's

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-09 Thread Thomas Hellström
Danilo, Christian On 11/6/23 17:42, Danilo Krummrich wrote: On Mon, Nov 06, 2023 at 04:10:50PM +0100, Christian König wrote: Am 06.11.23 um 15:11 schrieb Danilo Krummrich: On Mon, Nov 06, 2023 at 02:05:13PM +0100, Christian König wrote: Am 06.11.23 um 13:16 schrieb Danilo Krummrich: [SNIP]

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-06 Thread Danilo Krummrich
On Mon, Nov 06, 2023 at 04:10:50PM +0100, Christian König wrote: > Am 06.11.23 um 15:11 schrieb Danilo Krummrich: > > On Mon, Nov 06, 2023 at 02:05:13PM +0100, Christian König wrote: > > > Am 06.11.23 um 13:16 schrieb Danilo Krummrich: > > > > [SNIP] > > > > This reference count just prevents that

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-06 Thread Christian König
Am 06.11.23 um 15:11 schrieb Danilo Krummrich: On Mon, Nov 06, 2023 at 02:05:13PM +0100, Christian König wrote: Am 06.11.23 um 13:16 schrieb Danilo Krummrich: [SNIP] This reference count just prevents that the VM is freed as long as other ressources are attached to it that carry a VM pointer,

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-06 Thread Danilo Krummrich
On Mon, Nov 06, 2023 at 02:05:13PM +0100, Christian König wrote: > Am 06.11.23 um 13:16 schrieb Danilo Krummrich: > > [SNIP] > > This reference count just prevents that the VM is freed as long as other > > ressources are attached to it that carry a VM pointer, such as mappings and > > VM_BOs. The

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-06 Thread Christian König
Am 06.11.23 um 13:16 schrieb Danilo Krummrich: [SNIP] This reference count just prevents that the VM is freed as long as other ressources are attached to it that carry a VM pointer, such as mappings and VM_BOs. The motivation for that are VM_BOs. For mappings it's indeed a bit paranoid, but it

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-06 Thread Danilo Krummrich
On Mon, Nov 06, 2023 at 10:14:29AM +0100, Christian König wrote: > Am 03.11.23 um 16:34 schrieb Danilo Krummrich: > [SNIP] > > > > > > Especially we most likely don't want the VM to live longer than the > > > application which originally used it. If you make the GPUVM an > > > independent object

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-06 Thread Christian König
Am 03.11.23 um 16:34 schrieb Danilo Krummrich: [SNIP] Especially we most likely don't want the VM to live longer than the application which originally used it. If you make the GPUVM an independent object you actually open up driver abuse for the lifetime of this. Right, we don't want that.

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-03 Thread Danilo Krummrich
On 11/3/23 15:04, Christian König wrote: Am 03.11.23 um 14:14 schrieb Danilo Krummrich: On Fri, Nov 03, 2023 at 08:18:35AM +0100, Christian König wrote: Am 02.11.23 um 00:31 schrieb Danilo Krummrich: Implement reference counting for struct drm_gpuvm. From the design point of view what is

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-03 Thread Christian König
Am 03.11.23 um 14:14 schrieb Danilo Krummrich: On Fri, Nov 03, 2023 at 08:18:35AM +0100, Christian König wrote: Am 02.11.23 um 00:31 schrieb Danilo Krummrich: Implement reference counting for struct drm_gpuvm. From the design point of view what is that good for? It was discussed in this

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-03 Thread Danilo Krummrich
On Fri, Nov 03, 2023 at 08:18:35AM +0100, Christian König wrote: > Am 02.11.23 um 00:31 schrieb Danilo Krummrich: > > Implement reference counting for struct drm_gpuvm. > > From the design point of view what is that good for? It was discussed in this thread [1]. Essentially, the idea is to make

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-03 Thread Christian König
Am 02.11.23 um 00:31 schrieb Danilo Krummrich: Implement reference counting for struct drm_gpuvm. From the design point of view what is that good for? Background is that the most common use case I see is that this object is embedded into something else and a reference count is then not

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-02 Thread Danilo Krummrich
Hi Thomas, thanks for your timely response on that! On 11/2/23 18:09, Thomas Hellström wrote: On Thu, 2023-11-02 at 00:31 +0100, Danilo Krummrich wrote: Implement reference counting for struct drm_gpuvm. Signed-off-by: Danilo Krummrich ---  drivers/gpu/drm/drm_gpuvm.c    | 44

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-02 Thread Thomas Hellström
On Thu, 2023-11-02 at 18:32 +0100, Danilo Krummrich wrote: > Hi Thomas, > > thanks for your timely response on that! > > On 11/2/23 18:09, Thomas Hellström wrote: > > On Thu, 2023-11-02 at 00:31 +0100, Danilo Krummrich wrote: > > > Implement reference counting for struct drm_gpuvm. > > > > > >

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-02 Thread Thomas Hellström
On Thu, 2023-11-02 at 00:31 +0100, Danilo Krummrich wrote: > Implement reference counting for struct drm_gpuvm. > > Signed-off-by: Danilo Krummrich > --- >  drivers/gpu/drm/drm_gpuvm.c    | 44 +++- > -- >  drivers/gpu/drm/nouveau/nouveau_uvmm.c | 20 +--- >  

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-02 Thread Thomas Hellström
On Thu, 2023-11-02 at 00:31 +0100, Danilo Krummrich wrote: > Implement reference counting for struct drm_gpuvm. > > Signed-off-by: Danilo Krummrich Will port the Xe series over to check that it works properly and get back with review on this one. > --- >  drivers/gpu/drm/drm_gpuvm.c   

Re: [Nouveau] [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures

2023-11-02 Thread kernel test robot
Hi Danilo, kernel test robot noticed the following build warnings: [auto build test WARNING on 3c6c7ca4508b6cb1a033ac954c50a1b2c97af883] url: https://github.com/intel-lab-lkp/linux/commits/Danilo-Krummrich/drm-gpuvm-convert-WARN-to-drm_WARN-variants/20231102-073332 base: