From owner-freebsd-amd64@FreeBSD.ORG Sun Jul 24 08:16:25 2005 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DCFB16A41F for ; Sun, 24 Jul 2005 08:16:25 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from rms06.rommon.net (rms06.rommon.net [212.54.5.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13C9E43D46 for ; Sun, 24 Jul 2005 08:16:24 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [193.64.42.236] (dyn236.helenius.fi [193.64.42.236]) by rms06.rommon.net (Postfix) with ESMTP id 9EDE333C1B; Sun, 24 Jul 2005 11:16:22 +0300 (EEST) Message-ID: <42E34E56.8060108@he.iki.fi> Date: Sun, 24 Jul 2005 11:16:22 +0300 From: Petri Helenius User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Wemm References: <42DFDCCA.8050207@he.iki.fi> <200507210137.29816.peter@wemm.org> <42DFF043.3090203@he.iki.fi> <200507231212.24708.peter@wemm.org> In-Reply-To: <200507231212.24708.peter@wemm.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-amd64@freebsd.org Subject: Re: kernel memory X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2005 08:16:25 -0000 Peter Wemm wrote: > >AARGH. I've just found a bug/feature in the memory allocator. > >There are two code paths, one for small (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