From owner-freebsd-amd64@FreeBSD.ORG Fri Nov 19 20:42:12 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C88316A4CE for ; Fri, 19 Nov 2004 20:42:12 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88DFC43D31 for ; Fri, 19 Nov 2004 20:42:11 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id iAJKg6mC016219; Fri, 19 Nov 2004 22:42:06 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 86328-03; Fri, 19 Nov 2004 22:42:05 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id iAJKg5YO016216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Nov 2004 22:42:05 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id iAJKg8fo004408; Fri, 19 Nov 2004 22:42:08 +0200 (EET) (envelope-from ru) Date: Fri, 19 Nov 2004 22:42:08 +0200 From: Ruslan Ermilov To: Chris McDermott Message-ID: <20041119204208.GA92096@ip.net.ua> References: <20041119124946.J29849@area51.capnet.state.tx.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua cc: amd64@freebsd.org Subject: Re: Too many mbufs X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2004 20:42:12 -0000 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 19, 2004 at 03:21:44PM -0500, Chris McDermott wrote: > > Would you people please include at least a `uname -a` > > with these posts, even better state the motherboard > > you're running with. I am NOT seeing this with > > a Tyan s2882, dual 244, with 4GB memory, on 5.3-R #0. >=20 > I'm having the same problem, and it seems to be related to > kern.ipc.mbstat. I don't see kern.ipc.mbstat in the output of sysctl > -a. >=20 You'd need "sysctl -ax" to print it. > If I try and get the value with sysctlbyname() [copied from > netstat/mbuf.c], it returns negative values for mbstat->m_mbufs. This > negative value does fluctuate with network usage though... >=20 > Test code: >=20 > #include > #include > #include > #include > #include >=20 > int main() > { > struct mbstat *mbstat; > size_t mlen; > =09 > mlen =3D sizeof *mbstat; > if( (mbstat =3D calloc(1,mlen)) =3D=3D NULL) > perror("calloc"); > =09 > if (sysctlbyname("kern.ipc.mbstat", mbstat, &mlen, NULL, 0) < 0)=20 > perror("sysctl: retrieving mbstat"); >=20 > printf("mbufs: %d \nclusters: %d\n", mbstat->m_mbufs, mbstat->m_mclusts); > =09 > return 0; > } >=20 Your code is broken. Both m_mbufs and m_mclusts are of the type u_long, so they should be printed with "%lu" specifier. Fix your program and try again. (And you should see the same big number.) > Output: >=20 > mbufs: -2240 > clusters: -2686 >=20 > System: >=20 > TYAN s2885 dual 242 512M ram 5.3-R >=20 > codefactory# uname -a > FreeBSD codefactory 5.3-RELEASE FreeBSD 5.3-RELEASE #7: Tue Nov 9 > 23:28:53 EST 2004 =20 > cmc@codefactory:/usr/src/sys/amd64/compile/CODEFACTORY amd64 >=20 > codefactory# netstat -m > 18446744073709549940 mbufs in use > 18446744073709549630/17152 mbuf clusters in use (current/max) > 0/0/0 sfbufs in use (current/peak/max) > 18014398509477593 KBytes allocated to network > 0 requests for sfbufs denied > 0 requests for sfbufs delayed > 0 requests for I/O initiated by sendfile > 0 calls to protocol drain routines Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --FL5UXtIhxfXey3p5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBnlqfqRfpzJluFF4RAs4NAJwPlK6mTKVZ7GFfACNH4n1U29nh3gCfQicb PEBhZYA/0AGoHfYyFN0wGfk= =SRr2 -----END PGP SIGNATURE----- --FL5UXtIhxfXey3p5--