From owner-freebsd-hackers Thu Jun 29 9: 3:39 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from field.videotron.net (field.videotron.net [205.151.222.108]) by hub.freebsd.org (Postfix) with ESMTP id D327937BDF4 for ; Thu, 29 Jun 2000 09:03:36 -0700 (PDT) (envelope-from bmilekic@dsuper.net) Received: from modemcable009.62-201-24.mtl.mc.videotron.net ([24.201.62.9]) by field.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0FWX000EMB32F7@field.videotron.net> for freebsd-hackers@FreeBSD.ORG; Thu, 29 Jun 2000 11:59:26 -0400 (EDT) Date: Thu, 29 Jun 2000 12:01:26 -0400 (EDT) From: Bosko Milekic Subject: Re: mbuf re-write(s), v 0.1 In-reply-to: <200006291321.GAA25048@implode.root.com> X-Sender: bmilekic@jehovah.technokratis.com To: David Greenman Cc: freebsd-hackers@FreeBSD.ORG Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 29 Jun 2000, David Greenman wrote: > We used to do this in FreeBSD, but found that it was a bad idea for > performance reasons. Freeing and reallocating memory from the high-level > VM system is quite expensive and the trend in NICs these days is towards > needing the code to be even faster, not slower. Further, if the 'peak' is > reached often, then you're probably not really gaining much by freeing > the memory back to the common pool. > > -DG What was previously done at some point was use the kernel malloc() to allocate mbufs. As you know, this is a general purpose allocator that has to first determine what algorithm to use and then store the object correctly according to its size. This allocator is faster than that one. This allocator knows that it only has to deal with mbufs and knows that all of these mbufs are of the same size. I am not proposing to return to malloc(), I am proposing the new allocator. Also, the "peak" in this case is not reached often, obviously. It is designed with just that idea in mind. But, if the administrator feels that it is, I have provided the following mechanism: { jehovah:/home/bmilekic }>> sysctl -A | grep min_on_avail kern.ipc.min_on_avail: 0 With this sysctl, the administrator can set a "minimum required" count for mbufs. In other words, it is possible to easily tell the system to keep as many mbufs as you'd like cached on the free lists. > David Greenman > Co-founder, The FreeBSD Project - http://www.freebsd.org > Manufacturer of high-performance Internet servers - http://www.terasolutions.com > Pave the road of life with opportunities. -Bosko -- Bosko Milekic * Voice/Mobile: 514.865.7738 * Pager: 514.921.0237 bmilekic@technokratis.com * http://www.technokratis.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message