--- mm/slub.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2008-02-06 20:46:51.645588832 -0800 +++ linux-2.6/mm/slub.c 2008-02-06 20:46:58.109724361 -0800 @@ -1187,6 +1187,7 @@ static void add_partial(struct kmem_cach else list_add(&page->lru, &n->partial); spin_unlock(&n->list_lock); + printk("add partial(%s %p %d)\n", page->slab->name, page, tail); } static void remove_partial(struct kmem_cache *s, @@ -1198,6 +1199,7 @@ static void remove_partial(struct kmem_c list_del(&page->lru); n->nr_partial--; spin_unlock(&n->list_lock); + printk("remove partial(%s %p)\n", s->name, page); } /* @@ -1208,6 +1210,7 @@ static void remove_partial(struct kmem_c static inline int lock_and_freeze_slab(struct kmem_cache_node *n, struct page *page) { if (slab_trylock(page)) { + printk("lock_and_freeze_slab(%s %p)\n", page->slab->name, page); list_del(&page->lru); n->nr_partial--; SetSlabFrozen(page); @@ -1300,6 +1303,7 @@ static struct page *get_partial(struct k struct page *page; int searchnode = (node == -1) ? numa_node_id() : node; + printk("get_partial %s\n", s->name); page = get_partial_node(get_node(s, searchnode)); if (page || (flags & __GFP_THISNODE)) return page; @@ -1321,8 +1325,10 @@ static void unfreeze_slab(struct kmem_ca ClearSlabFrozen(page); if (page->freemap != s->empty_freemap) { - if (page->freemap) + if (page->freemap) { + printk("unfreeze slab adding to partial\n"); add_partial(n, page, tail); + } else if (SlabDebug(page) && (s->flags & SLAB_STORE_USER)) add_full(n, page); slab_unlock(page); @@ -1585,8 +1591,10 @@ checks_ok: * was not on the partial list before * then add it. */ - if (unlikely(!prior)) + if (!prior) { + printk("slab_Free adding to partial\n"); add_partial(get_node(s, page_to_nid(page)), page, 1); + } out_unlock: slab_unlock(page); @@ -2612,6 +2620,7 @@ int kmem_cache_shrink(struct kmem_cache if (!slabs_by_inuse) return -ENOMEM; + printk("kmem_cache_shrink(%s)\n", s->name); flush_all(s); for_each_node_state(node, N_NORMAL_MEMORY) { n = get_node(s, node); @@ -2639,6 +2648,7 @@ int kmem_cache_shrink(struct kmem_cache * may have freed the last object and be * waiting to release the slab. */ + printk("dumping partial(%s %p)\n", s->name, page); list_del(&page->lru); n->nr_partial--; slab_unlock(page);