1 --- 2.6/mm/slab.c 2003-10-09 21:23:19.000000000 +0200
2 +++ build-2.6/mm/slab.c 2003-10-16 07:32:06.000000000 +0200
4 *dbg_redzone1(cachep, objp) = RED_ACTIVE;
5 *dbg_redzone2(cachep, objp) = RED_ACTIVE;
11 + slabp = GET_PAGE_SLAB(virt_to_page(objp));
13 + objnr = (objp - slabp->s_mem) / cachep->objsize;
14 + slab_bufctl(slabp)[objnr] = (int)caller;
16 objp += obj_dbghead(cachep);
17 if (cachep->ctor && cachep->flags & SLAB_POISON) {
18 unsigned long ctor_flags = SLAB_CTOR_CONSTRUCTOR;
19 @@ -1952,12 +1961,14 @@
20 objnr = (objp - slabp->s_mem) / cachep->objsize;
21 check_slabp(cachep, slabp);
24 if (slab_bufctl(slabp)[objnr] != BUFCTL_FREE) {
25 printk(KERN_ERR "slab: double free detected in cache '%s', objp %p.\n",
31 slab_bufctl(slabp)[objnr] = slabp->free;
33 STATS_DEC_ACTIVE(cachep);
34 @@ -2694,6 +2705,22 @@
38 +static void do_dump_slabp(kmem_cache_t *cachep)
40 + struct list_head *q;
43 + spin_lock_irq(&cachep->spinlock);
44 + list_for_each(q,&cachep->lists.slabs_full) {
47 + slabp = list_entry(q, struct slab, list);
48 + for (i=0;i<cachep->num;i++)
49 + printk(KERN_DEBUG "obj %p/%d: %p\n", slabp, i, (void*)(slab_bufctl(slabp)[i]));
51 + spin_unlock_irq(&cachep->spinlock);
54 #define MAX_SLABINFO_WRITE 128
56 * slabinfo_write - Tuning for the slab allocator
61 + do_dump_slabp(cachep);
64 res = do_tune_cpucache(cachep, limit, batchcount, shared);