slub: fixed uninitialized counter in struct kmem_cache_node
authorSalman Qazi <sqazi@google.com>
Thu, 11 Sep 2008 19:25:41 +0000 (12:25 -0700)
committerPekka Enberg <penberg@cs.helsinki.fi>
Mon, 15 Sep 2008 06:49:05 +0000 (09:49 +0300)
Initialized total objects atomic for the node in init_kmem_cache_node.  The
uninitialized value was ruining the stats in /proc/slabinfo.

Acked-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Salman Qazi <sqazi@google.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slub.c

index fb486d5540f8bb0a7110245f2368fe2ace28338d..0c83e6afe7b223757f1608268436c59648c3633d 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1932,6 +1932,7 @@ init_kmem_cache_node(struct kmem_cache_node *n, struct kmem_cache *s)
        INIT_LIST_HEAD(&n->partial);
 #ifdef CONFIG_SLUB_DEBUG
        atomic_long_set(&n->nr_slabs, 0);
+       atomic_long_set(&n->total_objects, 0);
        INIT_LIST_HEAD(&n->full);
 #endif
 }