From 222627765a4699b9d56c8f6b7f2952905663a8c0 Mon Sep 17 00:00:00 2001 From: Mukul Joshi Date: Wed, 2 Sep 2026 15:13:07 -0400 Subject: [PATCH] drm/amdgpu: Fix NPA BO memory accounting stats during import invalidation Use amdgpu_vm_bo_move() for updating the NPA BO memory accounting stats when the NPA BO is moved out from NPA domain into an empty placement. Without this, when the app finishes, it spits out a warning: "VM memory stats for proc .. task .. is non-zero when fini" This was only affecting the memory accounting stats, we were not leaking any memory here. Signed-off-by: Mukul Joshi Acked-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c index f6ad64be4349..8fed28dc7502 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c @@ -3056,12 +3056,7 @@ static void amdgpu_ualink_invalidate_import_mappings(struct amdgpu_bo *bo) } } - /* FIXME: This should be after the "if", but needs a fix to make sure - * DMABuf imports are initialized in the right VM list. - */ - amdgpu_vm_bo_invalidate(bo, false); - if (!bo->tbo.resource || bo->tbo.resource->mem_type == TTM_PL_SYSTEM) - goto fini; + amdgpu_vm_bo_move(bo, NULL, false); r = ttm_bo_validate(&bo->tbo, &placement, &ctx); if (r) {