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

Pekka J Enberg
2006-01-27T07:22:10Z

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