public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Michel Thierry <michel.thierry@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Do not leak objects after capturing error state
Date: Fri, 20 Mar 2015 15:47:00 +0100	[thread overview]
Message-ID: <20150320144700.GQ1349@phenom.ffwll.local> (raw)
In-Reply-To: <1426844463-4315-1-git-send-email-michel.thierry@intel.com>

On Fri, Mar 20, 2015 at 09:41:03AM +0000, Michel Thierry wrote:
> While running kmemleak chasing a different memleak, I saw that the
> capture_error_state function was leaking some objects, for example:
> 
> unreferenced object 0xffff8800a9b72148 (size 8192):
>   comm "kworker/u16:0", pid 1499, jiffies 4295201243 (age 990.096s)
>   hex dump (first 32 bytes):
>     00 00 04 00 00 00 00 00 5d f4 ff ff 00 00 00 00  ........].......
>     00 30 b0 01 00 00 00 00 37 00 00 00 00 00 00 00  .0......7.......
>   backtrace:
>     [<ffffffff811e5ae4>] create_object+0x104/0x2c0
>     [<ffffffff8178f50a>] kmemleak_alloc+0x7a/0xc0
>     [<ffffffff811cde4b>] __kmalloc+0xeb/0x220
>     [<ffffffffa038f1d9>] kcalloc.constprop.12+0x2d/0x2f [i915]
>     [<ffffffffa0316064>] i915_capture_error_state+0x3f4/0x1660 [i915]
>     [<ffffffffa03207df>] i915_handle_error+0x7f/0x660 [i915]
>     [<ffffffffa03210f7>] i915_hangcheck_elapsed+0x2e7/0x470 [i915]
>     [<ffffffff8108d574>] process_one_work+0x144/0x490
>     [<ffffffff8108dfbd>] worker_thread+0x11d/0x530
>     [<ffffffff81094079>] kthread+0xc9/0xe0
>     [<ffffffff817a2398>] ret_from_fork+0x58/0x90
>     [<ffffffffffffffff>] 0xffffffffffffffff
> 
> The following objects are allocated in i915_gem_capture_buffers, but not
> released in i915_error_state_free:
>   - error->active_bo_count
>   - error->pinned_bo
>   - error->pinned_bo_count
>   - error->active_bo[vm_count] (allocated in i915_gem_capture_vm).
> 
> The leaks were introduced by
> commit 95f5301dd880da2dea2c9a9c29750064536d426a
> Author: Ben Widawsky <ben@bwidawsk.net>
> Date:   Wed Jul 31 17:00:15 2013 -0700
> 
>     drm/i915: Update error capture for VMs
> 
> v2: Reuse iterator and add culprit commit details (Chris)
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-20 14:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 17:11 [PATCH] drm/i915: Do not leak objects after capturing error state Michel Thierry
2015-03-19 17:18 ` Chris Wilson
2015-03-19 17:49   ` Michel Thierry
2015-03-19 21:02     ` Chris Wilson
2015-03-20  5:41 ` shuang.he
2015-03-20  9:41 ` [PATCH v2] " Michel Thierry
2015-03-20 14:47   ` Daniel Vetter [this message]
2015-03-20 19:23   ` shuang.he

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150320144700.GQ1349@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michel.thierry@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox