Re: Linux SLAB allocator issue

From: Christoph Lameter
Date: Wed Jun 07 2006 - 13:41:07 EST


On Wed, 7 Jun 2006, Xin Zhao wrote:

> Then, I used kmem_cache_alloc() to allocate 128 objects. So it should
> occupy 12 full slabs and 1 partial slab. Right?

There may be additional objects in the various caches. If this is a UP
system then some will certainly be in the per cpu cache.

You can push these back into the free lists by draining the array cache.

If you allocate objects on a slab that is fresh (no objects in it) then
only full slabs will be used. The remaining objects will end up on the per
cpu lists where they can be consumed without more work on the full/partial
arrays.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/