[RFCv2][PATCH] flexible array implementation

H. Peter Anvin hpa at zytor.com
Wed Jul 22 19:45:11 PDT 2009

On 07/21/2009 03:00 PM, Dave Hansen wrote:
> Here's an alternative.  I think it's what Andrew was
> suggesting  here:
> 	http://lkml.org/lkml/2009/7/2/518 
> I call it a flexible array.  It does all of its work in
> PAGE_SIZE bits, so never does an order>0 allocation.
> The base level has PAGE_SIZE-2*sizeof(int) bytes of
> storage for pointers to the second level.  So, with a
> 32-bit arch, you get about 4MB (4183112 bytes) of total
> storage when the objects pack nicely into a page.  It
> is half that on 64-bit because the pointers are twice
> the size.

I'm wondering if there is any use case which would require scaling below
the PAGE_SIZE level... in which case it would be nice for it to
gracefully decay to a single kmalloc allocation + some metadata.


H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

More information about the Containers mailing list