From owner-freebsd-stable@FreeBSD.ORG Fri May 26 11:15:13 2006 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 1E5C216A423 for ; Fri, 26 May 2006 11:15:13 +0000 (UTC) (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 0B1DC43D4C for ; Fri, 26 May 2006 11:15:11 +0000 (GMT) (envelope-from freebsd-listen@fabiankeil.de) Received: (qmail 14122 invoked from network); 26 May 2006 11:15:09 -0000 Received: from unknown (HELO localhost) ([pbs]775067@[217.50.135.176]) (envelope-sender ) by smtprelay01.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 26 May 2006 11:15:09 -0000 Date: Fri, 26 May 2006 13:15:02 +0200 From: Fabian Keil To: Iasen Kostov Message-ID: <20060526131502.2a2f984d@localhost> In-Reply-To: <1148639184.78660.32.camel@DraGoN.OTEL.net> References: <20060525205414.GC30137@xor.obsecurity.org> <1148639184.78660.32.camel@DraGoN.OTEL.net> X-Mailer: Sylpheed-Claws 2.1.1 (GTK+ 2.8.17; i386-portbld-freebsd6.1) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2006-08-19.asc User-Agent: 321 test Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_jY6Le5k+toIzlxHvx5bAX/y"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: freebsd-stable@freebsd.org Subject: Re: kmem leak in tmpmfs? 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: Fri, 26 May 2006 11:15:13 -0000 --Sig_jY6Le5k+toIzlxHvx5bAX/y Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Iasen Kostov wrote: > On Thu, 2006-05-25 at 16:54 -0400, Kris Kennaway wrote: > > On Thu, May 25, 2006 at 06:01:30PM +0200, Arno J. Klaassen wrote: > > > I get a very easy to reproduce panic on 6.1-STABLE : > > >=20 > > > /etc/periodic/weekly/310.locate panics with > > >=20 > > > panic: kmem_malloc(4096): kmem_map too small: 335544320 total > > > allocated > >=20 > > It looks like you are using a malloc-backed md and you do not have > > enough RAM to handle the size. Perhaps tmpmfs does not use swap > > backing, as it is supposed to? > First of all if there is not enough kmem (not just plain ram > I think) kernel should not allow disk creation in first place, second > - I think (although there could be some ... reason for that) it's > stupid way to say "I don't have more kmem" by panicing :). Better way > will be just to fail disk operation of that FS with "Disk is full" or > something like that. At home I tried to raise kmem like that: > "vm.kmem_size_max=3D"1073741824" (I got 2G of RAM) > (setting vm.kmem_size directly panices kernel at boot if I remember > correctly). >=20 > but for my surprise kernel panices at exact same allocated md disk > space with the same panic as the original poster's. Is it possible > that I should rise KVA_PAGES too ? And I don't think its documented > anywhere (of course I've tried googling and it's always possible that > I've missed something :). All this was on FreeBSD 6.0. man mdconfig mentions the problem: malloc Storage for this type of memory disk is allocated with malloc(9). This limits the size to the malloc bucket limit in the kernel. If the -o reserve option is not set, creating and filling a large malloc-backed memory disk is a very easy way to panic a system. Use a swap backed disk and the problem will disappear. Fabian --=20 http://www.fabiankeil.de/ --Sig_jY6Le5k+toIzlxHvx5bAX/y Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEduM7jV8GA4rMKUQRAqG2AKDBdtkz0Vjq2o/6U6vip51GMhE2XwCfdg0z 9clYMbd0gbW9TTPza0X7psk= =AYvJ -----END PGP SIGNATURE----- --Sig_jY6Le5k+toIzlxHvx5bAX/y--