--- fs/dcache.c | 3 +++ mm/slub.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) Index: slub/mm/slub.c =================================================================== --- slub.orig/mm/slub.c 2007-05-11 19:31:28.000000000 -0700 +++ slub/mm/slub.c 2007-05-11 19:36:53.000000000 -0700 @@ -2355,6 +2355,8 @@ static int __kmem_cache_vacate(struct km DECLARE_BITMAP(map, s->objects); int leftover; + printk(KERN_ERR "__kmem_cache_vacate(%s, %p, %tx) inuse=%d\n", + s->name, page, flags, page->inuse); if (!page->inuse) return 0; @@ -2438,6 +2440,7 @@ out: leftover = page->inuse; unfreeze_slab(s, page); local_irq_restore(flags); + printk(KERN_ERR "leftover=%d\n", leftover); return leftover; } @@ -2564,15 +2567,16 @@ int kmem_cache_shrink(struct kmem_cache slab_unlock(page); discard_slab(s, page); } else { - if (n->nr_partial > MAX_PARTIAL) + if (n->nr_partial > MIN_PARTIAL) list_move(&page->lru, slabs_by_inuse + page->inuse); } } - if (n->nr_partial <= MAX_PARTIAL) + if (n->nr_partial <= MIN_PARTIAL) goto out; + printk(KERN_ERR "rebuilding partial list for %s\n", s->name); /* * Rebuild the partial list with the slabs filled up most * first and the least used slabs at the end. @@ -2583,8 +2587,9 @@ int kmem_cache_shrink(struct kmem_cache if (!s->ops->get || !s->ops->kick) goto out; + printk(KERN_ERR "Defrag pass\n"); /* Take objects with just a few objects off the tail */ - while (n->nr_partial > MAX_PARTIAL) { + while (n->nr_partial > MIN_PARTIAL) { page = container_of(n->partial.prev, struct page, lru); /* Index: slub/fs/dcache.c =================================================================== --- slub.orig/fs/dcache.c 2007-05-11 19:36:27.000000000 -0700 +++ slub/fs/dcache.c 2007-05-11 19:36:53.000000000 -0700 @@ -2154,6 +2154,7 @@ static struct dentry *move_dentry(struct if (!n) return d; + printk(KERN_ERR "move_dentry(%p)\n", d); memcpy(n, d, sizeof(struct dentry)); list_del(&d->d_alias); list_add(&n->d_alias, &n->d_inode->i_dentry); @@ -2195,6 +2196,8 @@ static int kick_dentry(struct kmem_cache int refcount; int rc; + printk(KERN_ERR "kick_dentry_object(%s, %p) count=%d\n", + s->name, private, atomic_read(&dentry->d_count)); spin_lock(&dcache_lock); spin_lock(&dentry->d_lock); refcount = atomic_read(&dentry->d_count);