From owner-freebsd-net Wed Sep 13 21:37:25 2000 Delivered-To: freebsd-net@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id E5B9A37B423 for ; Wed, 13 Sep 2000 21:37:21 -0700 (PDT) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e8E4bJG04047; Wed, 13 Sep 2000 21:37:19 -0700 (PDT) Date: Wed, 13 Sep 2000 21:37:18 -0700 From: Alfred Perlstein To: Garrett Wollman Cc: Bosko Milekic , freebsd-net@FreeBSD.ORG Subject: Re: Clusters larger than PAGE_SIZE and contigmalloc() Message-ID: <20000913213718.H12231@fw.wintelcom.net> References: <200009140222.WAA04696@khavrinen.lcs.mit.edu> <200009140331.XAA05166@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <200009140331.XAA05166@khavrinen.lcs.mit.edu>; from wollman@khavrinen.lcs.mit.edu on Wed, Sep 13, 2000 at 11:31:46PM -0400 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * Garrett Wollman [000913 20:32] wrote: > < said: > > >Assuming we're dealing with a general purpose allocator, such as the > >kernel's malloc(), then I can see how this _may_ be profitable. However, > >if we're just allocating same-sized objects (or some small limited number > >of various sized objects), then wouldn't this just fragment the space? > >(i.e. 1536 < PAGE_SIZE and also not a power of 2). > > 1536 is exactly 1.5 kbytes, so three pages fit eight of them as I > mentioned before. You don't want to use a general-purpose allocator > for locality and efficiency reasons. Of course, the trick is that > they have to be physically contiguous if you want to pack them that > way. (However, finding three physically-contiguous pages is > potentially much easier than finding 16 physically-contiguous pages.) > > Putting the headers in the same block of memory is probably more > practical today. I'm sorry if this has already been mentioned or perhaps if I'm just repeating your last statement, but wouldn't it be an interesting hack to let's say allocate a PAGE_SIZE chunk, split it into as many clusters as possible and then divvy up the remainder into mbuf headers? Of course this doesn't fix it when a cluster total size if > PAGE_SIZE. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message