Re: [patch 9/9] slab - Implement single mempool backing for slaballocator

From: Pekka J Enberg
Date: Fri Jan 27 2006 - 02:20:25 EST


On Thu, 26 Jan 2006, Matthew Dobson wrote:
> As you mention, there is no guarantee as to how long the critical page will
> be in use for. One idea to tackle that problem would be to use the new
> mempool_t pointer in struct slab to provide exclusivity of critical slab
> pages, ie: if a non-critical slab request comes in and the only free page
> in the slab is a 'critical' page (it came from a mempool) then attempt to
> grow the slab or fail the non-critical request. Both of these concepts
> were (more or less) implemented in my other attempt at solving the critical
> pool problem, so moving them to fit into this approach should not be difficult.

Increasing struct slab size doesn't sound too appealing. I don't think the
slab allocator should know about mempools. Your critical allocations and
regular slab allocations have very different needs. For regular
allocations, we want to avoid page allocation which is why the object
caches hold on to slab pages whereas for mempool, I think you almost
always want to give back unused memory to the pool.

I think a better way to go is to improve the mempool implementation to
allow non-fixed size allocations and then combine that with the slab
allocator to get what you need.

Pekka
-
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/