Skip to contentSkip to conversation

slub: fixed uninitialized counter in struct kmem_cache_node

PATCH Applied Salman Qazi 2 participants 3 messages Sep 11, 2008

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

Initialized total objects atomic for the node in init_kmem_cache_node. The uninitialized value was ruining the stats in /proc/slabinfo.

---

mm/slub.c +1 -0
@@ -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
 }
Applied
#1 lore raw
Quoted 3 lines · Salman Qazi

Initialized total objects atomic for the node in init_kmem_cache_node. The uninitialized value was ruining the stats in /proc/slabinfo.

Applied, thanks!