Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jul 2005 11:16:22 +0300
From:      Petri Helenius <pete@he.iki.fi>
To:        Peter Wemm <peter@wemm.org>
Cc:        freebsd-amd64@freebsd.org
Subject:   Re: kernel memory
Message-ID:  <42E34E56.8060108@he.iki.fi>
In-Reply-To: <200507231212.24708.peter@wemm.org>
References:  <42DFDCCA.8050207@he.iki.fi> <200507210137.29816.peter@wemm.org> <42DFF043.3090203@he.iki.fi> <200507231212.24708.peter@wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42E34E56.8060108>