From patchwork Fri May 17 06:13:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10947475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EEC441398 for ; Fri, 17 May 2019 07:55:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0DD1201CB for ; Fri, 17 May 2019 07:55:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4AF22237D; Fri, 17 May 2019 07:55:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=2.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8D1A3201CB for ; Fri, 17 May 2019 07:55:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D0498990D; Fri, 17 May 2019 07:55:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 62F768982F; Fri, 17 May 2019 06:13:45 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id t1so1362127pgc.2; Thu, 16 May 2019 23:13:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=kUjckoiL4hcazmpiRVYWRXZ1+byR8V6/hc2uWj9Ysig=; b=bs5/NKxu/mbYSvqgqprnJTh/23/Gix2oZpk4M7t4XE75pyvz6gbDhASt3A+VrRSOcT lYI6kZpsLpo/33ddPNTE9kzwAAKiUSHw8wuZTcmkeIh376Zjh3vGJbFcjtRVhkIqngF3 sx4DFt8igkV5fnRpBRjXJyx4CCXUbAgDOY4JyeDAJ0gzSxYrJDfVNsVd2Y+eqI52PIo1 eBi3DcvWQIJq2+Z6KKn0k8RPvSvH8tqheXMkz0QmLSAqMV3qhBdeKhD8/neqR0sT2c4t c/LfexaRXmsh4/jTUY6NskSQ7Wm/PstDpZeMvhEHWeVm+0AFOdPPqaqv59yprORsT5XX 47qw== X-Gm-Message-State: APjAAAXlkVi1TPF/Bu/qS8WD3/JP+PXsq+q0iYysIHrJlr0q2c3zlNET 79UBY4a0HW2hb4sdrFGKJvg= X-Google-Smtp-Source: APXvYqxnnFmrplpftkM7cxoI/lh030At8OG7CfCN9dr3kjxbHY3VuCVSsn2e2V4tGmNN0DpfBDcmSA== X-Received: by 2002:a62:640e:: with SMTP id y14mr39509744pfb.109.1558073624914; Thu, 16 May 2019 23:13:44 -0700 (PDT) Received: from localhost ([175.223.38.122]) by smtp.gmail.com with ESMTPSA id s24sm9246940pfe.57.2019.05.16.23.13.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 May 2019 23:13:44 -0700 (PDT) Date: Fri, 17 May 2019 15:13:40 +0900 From: Sergey Senozhatsky To: Ben Skeggs , David Airlie , Daniel Vetter Subject: drm/nouveau/core/memory: kmemleak 684 new suspected memory leaks Message-ID: <20190517061340.GA709@jagdpanzerIV> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) X-Mailman-Approved-At: Fri, 17 May 2019 07:54:52 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=kUjckoiL4hcazmpiRVYWRXZ1+byR8V6/hc2uWj9Ysig=; b=t/Ag4ohx5G5C8vnn5fyJXM4y0k89Op7ZWxUgsxV1Xd145aByUYxDEcZte/PTwB+pun ggfpKQTMWuvkQT+SdpuaDMqVOrX7JHIqa2JN+4SF21hFgFsa0yEsNpbj6g3lb9AevSVv jxOfHa1kwBVZv+IHcrbdJ3QtKzAKVUVgHqtoZdIWXlvfFuMoS4rEICsLqzX57xvmDTcG L5V+7EEKbEfXpxT+yzZMFHOcS4dbYlwuoxgH185T92qnWXRBdPDs/XWxXXBXXYpTfWSV iaBPKXUlVcSqPdsAl8E/dgUMRpZRV1oEqdlhY/IWloYEBRJ7z3aScnzW5ALwCiWpHRyK b3ag== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Sergey Senozhatsky , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sergey Senozhatsky Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 #include #include +#include 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; }