aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Auld <[email protected]>2019-08-16 11:53:57 +0100
committerChris Wilson <[email protected]>2019-08-16 16:28:41 +0100
commit3ba09632ce8bd42d1e4b57a6a423dcab937e211b (patch)
tree382516d0c036e82fe98e294ace4f4ae38162e957
parent665c1c2166d3cc394f0cf2dd2da1e68b645552a7 (diff)
drm/i915/buddy: use kmemleak_update_trace
Since nodes are cached in a free-list, and potentially marked as free without actually being destroyed, thus allowing them to be opportunistically re-allocated, we should apply kmemleak_update_trace every time a node is given a new owner and marked as allocated, to aid in debugging. Suggested-by: Chris Wilson <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Cc: Chris Wilson <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/i915/i915_buddy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c
index 5995247fdf76..fe1871d7c126 100644
--- a/drivers/gpu/drm/i915/i915_buddy.c
+++ b/drivers/gpu/drm/i915/i915_buddy.c
@@ -3,6 +3,7 @@
* Copyright © 2019 Intel Corporation
*/
+#include <linux/kmemleak.h>
#include <linux/slab.h>
#include "i915_buddy.h"
@@ -304,6 +305,7 @@ i915_buddy_alloc(struct i915_buddy_mm *mm, unsigned int order)
}
mark_allocated(block);
+ kmemleak_update_trace(block);
return block;
out_free: