* [PATCH] drm/i915/buddy: tidy up i915_buddy_fini
@ 2019-08-16 10:03 Matthew Auld
2019-08-16 10:09 ` Chris Wilson
2019-08-16 13:01 ` ✗ Fi.CI.BAT: failure for drm/i915/buddy: tidy up i915_buddy_fini (rev2) Patchwork
0 siblings, 2 replies; 3+ messages in thread
From: Matthew Auld @ 2019-08-16 10:03 UTC (permalink / raw)
To: intel-gfx
If we are leaking nodes don't hide it. Also stop trying to be
"defensive" and instead embrace Kasan et al.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_buddy.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c
index b679ab6fd889..5995247fdf76 100644
--- a/drivers/gpu/drm/i915/i915_buddy.c
+++ b/drivers/gpu/drm/i915/i915_buddy.c
@@ -171,15 +171,10 @@ int i915_buddy_init(struct i915_buddy_mm *mm, u64 size, u64 chunk_size)
void i915_buddy_fini(struct i915_buddy_mm *mm)
{
- int err = 0;
int i;
for (i = 0; i < mm->n_roots; ++i) {
- if (!i915_buddy_block_is_free(mm->roots[i])) {
- err = -EBUSY;
- continue;
- }
-
+ GEM_WARN_ON(!i915_buddy_block_is_free(mm->roots[i]));
i915_block_free(mm->roots[i]);
}
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/buddy: tidy up i915_buddy_fini
2019-08-16 10:03 [PATCH] drm/i915/buddy: tidy up i915_buddy_fini Matthew Auld
@ 2019-08-16 10:09 ` Chris Wilson
2019-08-16 13:01 ` ✗ Fi.CI.BAT: failure for drm/i915/buddy: tidy up i915_buddy_fini (rev2) Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2019-08-16 10:09 UTC (permalink / raw)
To: Matthew Auld, intel-gfx
Quoting Matthew Auld (2019-08-16 11:03:26)
> If we are leaking nodes don't hide it. Also stop trying to be
> "defensive" and instead embrace Kasan et al.
If you want to go even further, record the stacks of each allocator.
As we are using kmalloc of each node and operate like a cache, we can do
something like kmemleak_update_trace() on i915_buddy_alloc().
diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c
index b679ab6fd889..3b30e05ffe53 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"
@@ -309,6 +310,7 @@ i915_buddy_alloc(struct i915_buddy_mm *mm, unsigned int order)
}
mark_allocated(block);
+ kmemleak_update_trace(block);
return block;
should do the trick
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_buddy.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c
> index b679ab6fd889..5995247fdf76 100644
> --- a/drivers/gpu/drm/i915/i915_buddy.c
> +++ b/drivers/gpu/drm/i915/i915_buddy.c
> @@ -171,15 +171,10 @@ int i915_buddy_init(struct i915_buddy_mm *mm, u64 size, u64 chunk_size)
>
> void i915_buddy_fini(struct i915_buddy_mm *mm)
> {
> - int err = 0;
> int i;
>
> for (i = 0; i < mm->n_roots; ++i) {
> - if (!i915_buddy_block_is_free(mm->roots[i])) {
> - err = -EBUSY;
> - continue;
> - }
> -
> + GEM_WARN_ON(!i915_buddy_block_is_free(mm->roots[i]));
> i915_block_free(mm->roots[i]);
> }
>
> --
> 2.20.1
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* ✗ Fi.CI.BAT: failure for drm/i915/buddy: tidy up i915_buddy_fini (rev2)
2019-08-16 10:03 [PATCH] drm/i915/buddy: tidy up i915_buddy_fini Matthew Auld
2019-08-16 10:09 ` Chris Wilson
@ 2019-08-16 13:01 ` Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2019-08-16 13:01 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/buddy: tidy up i915_buddy_fini (rev2)
URL : https://patchwork.freedesktop.org/series/65299/
State : failure
== Summary ==
Applying: drm/i915/buddy: tidy up i915_buddy_fini
error: corrupt patch at line 20
error: could not build fake ancestor
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 drm/i915/buddy: tidy up i915_buddy_fini
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-16 13:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-16 10:03 [PATCH] drm/i915/buddy: tidy up i915_buddy_fini Matthew Auld
2019-08-16 10:09 ` Chris Wilson
2019-08-16 13:01 ` ✗ Fi.CI.BAT: failure for drm/i915/buddy: tidy up i915_buddy_fini (rev2) Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.