slub: Add statistics for this_cmpxchg_double failures
authorChristoph Lameter <cl@linux.com>
Tue, 22 Mar 2011 18:35:00 +0000 (13:35 -0500)
committerPekka Enberg <penberg@kernel.org>
Tue, 22 Mar 2011 18:48:04 +0000 (20:48 +0200)
Add some statistics for debugging.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
include/linux/slub_def.h
mm/slub.c

index 90fbb6d87e11d3408db6cd3d3b6a1eedbcd68fe7..45ca123e800219777001f75113324f6cfd60486f 100644 (file)
@@ -32,6 +32,7 @@ enum stat_item {
        DEACTIVATE_TO_TAIL,     /* Cpu slab was moved to the tail of partials */
        DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
        ORDER_FALLBACK,         /* Number of times fallback was necessary */
+       CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */
        NR_SLUB_STAT_ITEMS };
 
 struct kmem_cache_cpu {
index e126cfbd3df29d719994a9fe658b440618d570fb..93de30db95f5943037b1a37a9fae1e2578f06287 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -217,7 +217,7 @@ static inline void sysfs_slab_remove(struct kmem_cache *s)
 
 #endif
 
-static inline void stat(struct kmem_cache *s, enum stat_item si)
+static inline void stat(const struct kmem_cache *s, enum stat_item si)
 {
 #ifdef CONFIG_SLUB_STATS
        __this_cpu_inc(s->cpu_slab->stat[si]);
@@ -1597,6 +1597,7 @@ static inline void note_cmpxchg_failure(const char *n,
                printk("for unknown reason: actual=%lx was=%lx target=%lx\n",
                        actual_tid, tid, next_tid(tid));
 #endif
+       stat(s, CMPXCHG_DOUBLE_CPU_FAIL);
 }
 
 #endif