[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190820134028.10829-30-sashal@kernel.org>
Date: Tue, 20 Aug 2019 09:40:14 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Tomer Tayar <ttayar@...ana.ai>,
Oded Gabbay <oded.gabbay@...il.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH AUTOSEL 5.2 30/44] habanalabs: fix DRAM usage accounting on context tear down
From: Tomer Tayar <ttayar@...ana.ai>
[ Upstream commit c8113756ba27298d6e95403c087dc5881b419a99 ]
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: Tomer Tayar <ttayar@...ana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@...il.com>
Signed-off-by: Oded Gabbay <oded.gabbay@...il.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/misc/habanalabs/memory.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/misc/habanalabs/memory.c b/drivers/misc/habanalabs/memory.c
index 693877e37fd87..924a438ba9736 100644
--- a/drivers/misc/habanalabs/memory.c
+++ b/drivers/misc/habanalabs/memory.c
@@ -1629,6 +1629,8 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx)
dev_dbg(hdev->dev,
"page list 0x%p of asid %d is still alive\n",
phys_pg_list, ctx->asid);
+ atomic64_sub(phys_pg_list->total_size,
+ &hdev->dram_used_mem);
free_phys_pg_pack(hdev, phys_pg_list);
idr_remove(&vm->phys_pg_pack_handles, i);
}
--
2.20.1
Powered by blists - more mailing lists