From owner-freebsd-stable@FreeBSD.ORG Wed Dec 14 16:33:18 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48F3E16A41F for ; Wed, 14 Dec 2005 16:33:18 +0000 (GMT) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.18.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A22043D58 for ; Wed, 14 Dec 2005 16:33:15 +0000 (GMT) (envelope-from freebsd-listen@fabiankeil.de) Received: (qmail 20968 invoked from network); 14 Dec 2005 16:33:13 -0000 Received: from unknown (HELO TP51.local) ([pbs]775067@[217.187.177.99]) (envelope-sender ) by smtprelay01.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 14 Dec 2005 16:33:13 -0000 Date: Wed, 14 Dec 2005 17:32:34 +0100 From: Fabian Keil To: Scott Long Message-ID: <20051214173234.4bb5ffb9@TP51.local> In-Reply-To: <43A03CFC.6070406@samsco.org> References: <20051214132530.3b6daecd@TP51.local> <20051214131855.GH59644@FreeBSD.org> <43A03CFC.6070406@samsco.org> X-Mailer: Sylpheed-Claws 1.9.100 (GTK+ 2.8.6; i386-portbld-freebsd5.4) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2006-08-19.asc Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_DozOW9gfpdiMI6_.CT6ET5G; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: Gleb Smirnoff , freebsd-stable@freebsd.org Subject: Re: FreeBSD 6.0 panic: kmem_malloc(16384): kmem_map too small: 172728320 total allocated [solved] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2005 16:33:18 -0000 --Sig_DozOW9gfpdiMI6_.CT6ET5G Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Scott Long wrote: > Gleb Smirnoff wrote: >=20 > > On Wed, Dec 14, 2005 at 01:25:30PM +0100, Fabian Keil wrote: > > F> I triggered a few reproducible panics on FreeBSD 6.0-STABLE. > > F>=20 > > F> I created a ramdisk with: > > F> =20 > > F> /sbin/mdconfig -a -t malloc -s 256M -u 10 > > F> /sbin/newfs -U /dev/md10 > > F> /sbin/mount /dev/md10 /mnt/ramdisk > > F>=20 > > F> The system has "avail memory =3D 515932160 (492 MB)" > > F> and 1GB swap space. > > F>=20 > > F> While copying to /mnt/ramdisk trough ftp localhost > > F> it got: > >=20 > > This usually exposes some memory leak in kernel. Can you please do > > the following - copy some amount of data to /mnt/ramdisk trough ftp > > localhost, and cancel the operation before it panics. > >=20 > > Then run vmstat -m and vmstat -z, to determine what kind of memory > > allocation is leaking. > >=20 > >=20 >=20 > While it can mean a memory leak in the kernel, I don't think that's > the case here. > On i386, only 320MB can be allocated to kernel malloc memory. Much > of this space > can get consumed with vnodes and other filesystem structures, so > trying to allocate > 256MB to a ramdisk is likely putting you over the max. I'd suggest=20 > instead to use > a swap-back disk. It doesn't necessarily mean that the ramdisk pages=20 > will live in > swap, it just means that they will get managed directly in the > bufcache, eliminating > the 320MB restriction. I guess you're right. I can fill a 256MB swap-backed disk without panic=20 and without swapping. Before ftp localhost: last pid: 652; load averages: 0.02, 0.09, 0.07 up 0+00:07:16 17:12:05 37 processes: 1 running, 36 sleeping CPU states: 0.0% user, 0.0% nice, 0.0% system, 0.4% interrupt, 99.6% idle Mem: 11M Active, 12M Inact, 18M Wired, 11M Buf, 453M Free Swap: 999M Total, 999M Free After ftp localhost: last pid: 666; load averages: 0.20, 0.12, 0.08 up 0+00:09:05 17:13:54 36 processes: 1 running, 35 sleeping CPU states: 0.0% user, 0.0% nice, 0.0% system, 0.4% interrupt, 99.6% idle Mem: 244M Active, 150M Inact, 73M Wired, 27M Cache, 60M Buf, 984= K Free Swap: 999M Total, 999M Free After removal of the swap-backed disk: last pid: 690; load averages: 0.00, 0.01, 0.03 up 0+00:17:53 17:22:42 34 processes: 1 running, 33 sleeping CPU states: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle Mem: 15M Active, 76M Inact, 43M Wired, 13M Cache, 60M Buf, 347M F= ree Swap: 999M Total, 999M Free Thanks for your time Gleb and Scott. Fabian --=20 http://www.fabiankeil.de/ --Sig_DozOW9gfpdiMI6_.CT6ET5G Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDoEk7jV8GA4rMKUQRAiU9AKCxxVRrnuGW1/RBE94c5a6klL5N6QCgutnB GOB5wVzdwaFJC+Z5imlLQ8E= =xqEn -----END PGP SIGNATURE----- --Sig_DozOW9gfpdiMI6_.CT6ET5G--