Subject: Re: pool_get()/pool_put() or malloc()/free()
To: Andrei Petrov <>
From: Jason R Thorpe <>
List: tech-kern
Date: 10/27/2000 09:59:22
On Fri, Oct 27, 2000 at 09:23:02AM -0700, Andrei Petrov wrote:

 > > > The difference is not so significant (sun3 is too slow to see it? :-),
 > > > but I will commit this change anyway.
 > > 
 > > I think we should use generic malloc instead of pool_get _hack_ if the
 > > difference between two is so insignificant.

...I also beg to differ that pools are a "hack".  I suggest that people
read the Sun papers on "slab", which is essentially the same idea as
"pools".  With some additional work, pools could provide the "contructor"
facility that slabs provide, which not only provide a convience for the
programmer, but also showed a significant performance improvement in

Also, the kernel malloc is designed to be a fast power-of-two allocator.
This is NOT particularly condicive towards memory efficiency -- consider
what happens when you have a structure that's 262 bytes long.  Pools fix
the problem of memory wastage in that case.

        -- Jason R. Thorpe <>