Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 2000 12:01:26 -0400 (EDT)
From:      Bosko Milekic <bmilekic@dsuper.net>
To:        David Greenman <dg@root.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: mbuf re-write(s), v 0.1
Message-ID:  <Pine.BSF.4.21.0006291154100.3622-100000@jehovah.technokratis.com>
In-Reply-To: <200006291321.GAA25048@implode.root.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0006291154100.3622-100000>