Re: [PATCH] drm/amdgpu: track bo memory stats at runtime

2024-06-20 Thread Christian König
Am 20.06.24 um 16:30 schrieb Li, Yunxiang (Teddy): [Public] + dma_resv_lock(bo->tbo.base.resv, NULL); Why do you grab the BO lock to update the stats? That doesn't seem to make any sense. + update_stats = !(bo->flags & AMDGPU_GEM_WAS_EXPORTED); + if (update_stats) + amdgpu_bo

RE: [PATCH] drm/amdgpu: track bo memory stats at runtime

2024-06-20 Thread Li, Yunxiang (Teddy)
[Public] > > + dma_resv_lock(bo->tbo.base.resv, NULL); > > Why do you grab the BO lock to update the stats? That doesn't seem to make > any sense. > > > + update_stats = !(bo->flags & AMDGPU_GEM_WAS_EXPORTED); > > + if (update_stats) > > + amdgpu_bo_add_memory(bo, &stats); > > +

Re: [PATCH] drm/amdgpu: track bo memory stats at runtime

2024-06-20 Thread Christian König
Am 20.06.24 um 02:30 schrieb Yunxiang Li: Before, every time fdinfo is queried we try to lock all the BOs in the VM and calculate memory usage from scratch. This works okay if the fdinfo is rarely read and the VMs don't have a ton of BOs. If either of these conditions is not true, we get a massiv