Date: Wed, 13 Sep 2000 21:37:18 -0700 From: Alfred Perlstein <bright@wintelcom.net> To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Cc: Bosko Milekic <bmilekic@dsuper.net>, freebsd-net@FreeBSD.ORG Subject: Re: Clusters larger than PAGE_SIZE and contigmalloc() Message-ID: <20000913213718.H12231@fw.wintelcom.net> 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 References: <200009140222.WAA04696@khavrinen.lcs.mit.edu> <Pine.BSF.4.21.0009132234580.397-100000@jehovah.technokratis.com> <200009140331.XAA05166@khavrinen.lcs.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
* Garrett Wollman <wollman@khavrinen.lcs.mit.edu> [000913 20:32] wrote: > <<On Wed, 13 Sep 2000 23:03:02 -0400 (EDT), Bosko Milekic <bmilekic@dsuper.net> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000913213718.H12231>