From patchwork Thu Aug 4 10:39:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank van Maarseveen X-Patchwork-Id: 1034612 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p74AdwJO026704 for ; Thu, 4 Aug 2011 10:40:19 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D7729F6D5 for ; Thu, 4 Aug 2011 03:39:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from janus.localdomain (frankvm.xs4all.nl [83.163.148.79]) by gabe.freedesktop.org (Postfix) with ESMTP id 4470F9E9F2 for ; Thu, 4 Aug 2011 03:39:50 -0700 (PDT) Received: by janus.localdomain (Postfix, from userid 363) id A366740E6D; Thu, 4 Aug 2011 12:39:48 +0200 (CEST) Date: Thu, 4 Aug 2011 12:39:48 +0200 From: Frank van Maarseveen To: dri-devel Subject: Re: 2.6.39.3 nouveau_gart_manager_new() leaks memory (FIX) Message-ID: <20110804103948.GA12474@janus> References: <20110728100753.GA16736@janus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110728100753.GA16736@janus> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 04 Aug 2011 10:40:19 +0000 (UTC) On Thu, Jul 28, 2011 at 12:07:53PM +0200, Frank van Maarseveen wrote: > /proc/slabinfo shows an anomaly on a 2.6.39.3 x86_64 system. After > running F14 + kde4 for a while it shows high kmalloc-192 numbers: > > # name ... > kmalloc-192 735694 735723 264 31 2 : tunables 0 0 0 : slabdata 23733 23733 0 > > Digging in /sys/kernel/slab/kmalloc-192/alloc_calls one line stands out: > > 701960 nouveau_gart_manager_new+0x5d/0xf0 age=24/7405655/87972315 pid=1-4920 cpus=0-3 > > There are 709907 allocations total and according to > /sys/kernel/slab/kmalloc-192/free_calls there are 52245 free > calls total. This seems to fix it: diff -Nurp a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c --- a/drivers/gpu/drm/nouveau/nouveau_mem.c 2011-05-19 06:06:34.000000000 +0200 +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c 2011-08-03 10:58:22.919205352 +0200 @@ -848,6 +848,7 @@ nouveau_gart_manager_del(struct ttm_mem_ nouveau_vm_unmap(&node->tmp_vma); nouveau_vm_put(&node->tmp_vma); } + kfree(node); mem->mm_node = NULL; }