diff options
author | Christoph Lameter <clameter@engr.sgi.com> | 2005-10-29 21:15:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 00:40:36 -0400 |
commit | 09ad4bbc3a5c93316d7f4ffc0c310d9cbb28c2f0 (patch) | |
tree | b98d5390ceef3dcb8d1fe83b1ef7ffe0106d4c94 /mm/slab.c | |
parent | c340010e4bf824d969a89fa192ecc7a526c0cd24 (diff) |
[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>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2419,6 +2419,7 @@ retry: | |||
2419 | next = slab_bufctl(slabp)[slabp->free]; | 2419 | next = slab_bufctl(slabp)[slabp->free]; |
2420 | #if DEBUG | 2420 | #if DEBUG |
2421 | slab_bufctl(slabp)[slabp->free] = BUFCTL_FREE; | 2421 | slab_bufctl(slabp)[slabp->free] = BUFCTL_FREE; |
2422 | WARN_ON(numa_node_id() != slabp->nodeid); | ||
2422 | #endif | 2423 | #endif |
2423 | slabp->free = next; | 2424 | slabp->free = next; |
2424 | } | 2425 | } |
@@ -2633,8 +2634,10 @@ static void free_block(kmem_cache_t *cachep, void **objpp, int nr_objects, int n | |||
2633 | check_spinlock_acquired_node(cachep, node); | 2634 | check_spinlock_acquired_node(cachep, node); |
2634 | check_slabp(cachep, slabp); | 2635 | check_slabp(cachep, slabp); |
2635 | 2636 | ||
2636 | |||
2637 | #if DEBUG | 2637 | #if DEBUG |
2638 | /* Verify that the slab belongs to the intended node */ | ||
2639 | WARN_ON(slabp->nodeid != node); | ||
2640 | |||
2638 | if (slab_bufctl(slabp)[objnr] != BUFCTL_FREE) { | 2641 | if (slab_bufctl(slabp)[objnr] != BUFCTL_FREE) { |
2639 | printk(KERN_ERR "slab: double free detected in cache " | 2642 | printk(KERN_ERR "slab: double free detected in cache " |
2640 | "'%s', objp %p\n", cachep->name, objp); | 2643 | "'%s', objp %p\n", cachep->name, objp); |