Commit c8113756 authored by Tomer Tayar's avatar Tomer Tayar Committed by Oded Gabbay

habanalabs: fix DRAM usage accounting on context tear down

The patch fix the DRAM usage accounting by adding a missing update of
the DRAM memory consumption, when a context is being torn down without an
organized release of the allocated memory.
Signed-off-by: default avatarTomer Tayar <ttayar@habana.ai>
Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 508c5849
...@@ -1629,6 +1629,8 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx) ...@@ -1629,6 +1629,8 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx)
dev_dbg(hdev->dev, dev_dbg(hdev->dev,
"page list 0x%p of asid %d is still alive\n", "page list 0x%p of asid %d is still alive\n",
phys_pg_list, ctx->asid); phys_pg_list, ctx->asid);
atomic64_sub(phys_pg_list->total_size,
&hdev->dram_used_mem);
free_phys_pg_pack(hdev, phys_pg_list); free_phys_pg_pack(hdev, phys_pg_list);
idr_remove(&vm->phys_pg_pack_handles, i); idr_remove(&vm->phys_pg_pack_handles, i);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment