Index: linux-2.6.17/mm/slab.c =================================================================== --- linux-2.6.17.orig/mm/slab.c 2006-06-19 19:26:28.003033097 -0700 +++ linux-2.6.17/mm/slab.c 2006-06-19 19:27:22.297530668 -0700 @@ -3829,12 +3829,12 @@ static int try_reclaim_one(kmem_cache_t } - if (max_refcnt > 0) + if (max_refcnt > 0 && slabp->inuse > 1) /* Cannot free the block */ return 0; - /* * The slab only contains objects with refcnt 1 (=unused) + * or is a slab with a single object with a high refcount * this means that we can free the slab object completely * if we free all the objects. */ @@ -3842,7 +3842,7 @@ static int try_reclaim_one(kmem_cache_t atomic_t *objp = index_to_obj(cachep, slabp, i); int refcnt = atomic_read(objp); - if (!refcnt) + if (refcnt >= 0) cachep->dtor(objp, cachep, SLAB_DTOR_FREE); } return 1;