Commit 09ad4bbc3a5c93316d7f4ffc0c310d9cbb28c2f0

Authored by Christoph Lameter
Committed by Linus Torvalds
1 parent c340010e4b

[PATCH] slab: add additional debugging to detect slabs from the wrong node

This patch adds some stack dumps if the slab logic is processing slab
blocks from the wrong node.  This is necessary in order to detect
situations as encountered by Petr.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

... ... @@ -2419,6 +2419,7 @@
2419 2419 next = slab_bufctl(slabp)[slabp->free];
2420 2420 #if DEBUG
2421 2421 slab_bufctl(slabp)[slabp->free] = BUFCTL_FREE;
  2422 + WARN_ON(numa_node_id() != slabp->nodeid);
2422 2423 #endif
2423 2424 slabp->free = next;
2424 2425 }
2425 2426  
... ... @@ -2633,8 +2634,10 @@
2633 2634 check_spinlock_acquired_node(cachep, node);
2634 2635 check_slabp(cachep, slabp);
2635 2636  
2636   -
2637 2637 #if DEBUG
  2638 + /* Verify that the slab belongs to the intended node */
  2639 + WARN_ON(slabp->nodeid != node);
  2640 +
2638 2641 if (slab_bufctl(slabp)[objnr] != BUFCTL_FREE) {
2639 2642 printk(KERN_ERR "slab: double free detected in cache "
2640 2643 "'%s', objp %p\n", cachep->name, objp);