kernel memory
Petri Helenius
pete at he.iki.fi
Sun Jul 24 08:16:25 GMT 2005
Peter Wemm wrote:
>
>AARGH. I've just found a bug/feature in the memory allocator.
>
>There are two code paths, one for small (<PAGE_SIZE) allocations, which
>uses the direct map allocations instead of kvm allocations, and the
>other large chunk allocator that simply allocates pages at a time from
>kvm. :-(
>
>I suspect this is because malloc's semantics depend on objects being
>contiguous. The direct map method would allocate physically
>discontiguous pages.
>
>So, if you allocated your lookup cache in <4K chunks, you could have as
>much as you like. :-/
>
>
Is there an overhead I should be aware of if I say allocate 10 million
400 byte entries? (other than I obviously suffer the overhead of keeping
an array of pointers)
Pete
More information about the freebsd-amd64
mailing list