projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f099209
)
habanalabs: free host huge va_range if not used
author
Ofir Bitton
<obitton@habana.ai>
Thu, 26 Nov 2020 11:01:11 +0000
(13:01 +0200)
committer
Oded Gabbay
<ogabbay@kernel.org>
Mon, 30 Nov 2020 08:30:16 +0000
(10:30 +0200)
If huge range is not valid, driver uses the host range also for
huge page allocations, but driver never frees its allocation.
This introduces a memory leak every time a user closes its context.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/memory.c
patch
|
blob
|
history
diff --git
a/drivers/misc/habanalabs/common/memory.c
b/drivers/misc/habanalabs/common/memory.c
index 84227819e4d14d5d71064d902f20ae4e0dd876de..bfe223abf142672de217cdb6eaaccaeeaaf82f74 100644
(file)
--- a/
drivers/misc/habanalabs/common/memory.c
+++ b/
drivers/misc/habanalabs/common/memory.c
@@
-1626,6
+1626,7
@@
static int vm_ctx_init_with_ranges(struct hl_ctx *ctx,
goto host_hpage_range_err;
}
} else {
+ kfree(ctx->host_huge_va_range);
ctx->host_huge_va_range = ctx->host_va_range;
}