linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Ben Skeggs <bskeggs@redhat.com>, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: drm/nouveau/core/memory: kmemleak 684 new suspected memory leaks
Date: Fri, 17 May 2019 15:13:40 +0900	[thread overview]
Message-ID: <20190517061340.GA709@jagdpanzerIV> (raw)

Hello,

5.1.0-next-20190517

I'm looking at quite a lot of kmemleak reports coming from
drm/nouveau/core/memory, all of which are:

    unreferenced object 0xffff8deec27c4ac0 (size 16):
      comm "Web Content", pid 5309, jiffies 4309675011 (age 68.076s)
      hex dump (first 16 bytes):
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace:
        [<0000000081f2894f>] nvkm_memory_tags_get+0x8e/0x130
        [<000000007cd7c0bc>] gf100_vmm_valid+0x196/0x2f0
        [<0000000070cc6d67>] nvkm_vmm_map+0xa8/0x360
        [<00000000ab678644>] nvkm_vram_map+0x48/0x50
        [<00000000d8176378>] nvkm_uvmm_mthd+0x658/0x770
        [<00000000463fca5a>] nvkm_ioctl+0xdf/0x177
        [<000000000afc4996>] nvif_object_mthd+0xd4/0x100
        [<000000002f7a7385>] nvif_vmm_map+0xeb/0x100
        [<00000000ef2537ed>] nouveau_mem_map+0x79/0xd0
        [<0000000014ddc0cf>] nouveau_vma_new+0x19d/0x1c0
        [<00000000f99888a1>] nouveau_gem_object_open+0xd4/0x140
        [<000000009cd25861>] drm_gem_handle_create_tail+0xe3/0x160
        [<00000000191784d9>] nouveau_gem_ioctl_new+0x6e/0xd0
        [<00000000159678df>] drm_ioctl_kernel+0x8c/0xd0
        [<00000000fbaa6154>] drm_ioctl+0x1c4/0x360
        [<000000006833fe15>] nouveau_drm_ioctl+0x63/0xb0

Wondering if those are real leaks or just false positives.

For now I marked `tags' as kmemleak_not_leak(); but most
likely it's utterly wrong.

Any thoughts?

---
 drivers/gpu/drm/nouveau/nvkm/core/memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/core/memory.c b/drivers/gpu/drm/nouveau/nvkm/core/memory.c
index e85a08ecd9da..cd46f54c5c32 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/memory.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/memory.c
@@ -25,6 +25,7 @@
 #include <core/mm.h>
 #include <subdev/fb.h>
 #include <subdev/instmem.h>
+#include <linux/kmemleak.h>
 
 void
 nvkm_memory_tags_put(struct nvkm_memory *memory, struct nvkm_device *device,
@@ -92,6 +93,7 @@ nvkm_memory_tags_get(struct nvkm_memory *memory, struct nvkm_device *device,
 
 	refcount_set(&tags->refcount, 1);
 	mutex_unlock(&fb->subdev.mutex);
+	kmemleak_not_leak(tags);
 	*ptags = tags;
 	return 0;
 }
-- 
2.21.0


             reply	other threads:[~2019-05-17  6:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17  6:13 Sergey Senozhatsky [this message]
2019-05-17  6:31 ` drm/nouveau/core/memory: kmemleak 684 new suspected memory leaks Sergey Senozhatsky
2019-05-17  6:45   ` Sergey Senozhatsky
2019-05-17  7:27 ` Sergey Senozhatsky
2019-05-17  7:35   ` Sergey Senozhatsky

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=20190517061340.GA709@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=sergey.senozhatsky@gmail.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;
as well as URLs for NNTP newsgroup(s).