From owner-freebsd-net@FreeBSD.ORG Wed Aug 27 09:41:24 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 120A816A4BF for ; Wed, 27 Aug 2003 09:41:24 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id E800343F3F for ; Wed, 27 Aug 2003 09:41:22 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 69733 invoked from network); 27 Aug 2003 16:41:21 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 27 Aug 2003 16:41:21 -0000 X-pair-Authenticated: 209.68.2.70 Date: Wed, 27 Aug 2003 11:40:17 -0500 (CDT) From: Mike Silbersack To: "Giovanni P. Tirloni" In-Reply-To: <20030827030314.GJ40033@pixies.tirloni.org> Message-ID: <20030827113639.A4269@odysseus.silby.com> References: <20030827030314.GJ40033@pixies.tirloni.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: mbuf usage for an idle machine X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Aug 2003 16:41:24 -0000 On Wed, 27 Aug 2003, Giovanni P. Tirloni wrote: > Hi, > > I've been reading about mbufs and how they're used for > holding network packets and socket buffers and the > output of 'netstat -m' for a idle machine I've here > made me curious about how FreeBSD handles it in -CURRENT. > > Why is it using so many mbufs when it's idle? My > small kwnowledge doesn't permit me to answer this > question yet ;) The mbufs in question are (mostly) being used as receive buffers by the network drivers. With modern DMA based cards, you pre-allocate the buffers, then hand them over to the card's control. Once they're filled with packet data, the NIC informs the OS, which replaces them with new buffers. A lot of our drivers have 128 (or some power of 2) receive buffers, hence your mbuf usage. Mike "Silby" Silbersack