Skip to contentSkip to conversation

2.6.39.3 nouveau_gart_manager_new() leaks memory

DISCUSSION Frank van Maarseveen 1 participant 2 messages Jul 28, 2011 – Aug 4, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

/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 <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>...
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.

Signature · 1 line
Frank
#1 lore raw

Re: 2.6.39.3 nouveau_gart_manager_new() leaks memory (FIX)

Quoted 6 lines · Frank van Maarseveen

/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 <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>...
kmalloc-192       735694 735723    264   31    2 : tunables    0    0    0 : slabdata  23733  23733      0
Quoted 7 lines

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:

drivers/gpu/drm/nouveau/nouveau_mem.c +1 -0
diff -Nurp a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -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;
 }
 
Signature · 1 line
Frank