From owner-freebsd-hackers Sat Apr 13 20:58:41 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA20046 for hackers-outgoing; Sat, 13 Apr 1996 20:58:41 -0700 (PDT) Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id UAA20041 for ; Sat, 13 Apr 1996 20:58:38 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by Root.COM (8.7.5/8.6.5) with SMTP id UAA02986; Sat, 13 Apr 1996 20:58:35 -0700 (PDT) Message-Id: <199604140358.UAA02986@Root.COM> X-Authentication-Warning: implode.Root.COM: Host localhost [127.0.0.1] didn't use HELO protocol To: Brian Tao cc: FREEBSD-HACKERS-L Subject: Re: pmap_zero_page and kmem_malloc panics In-reply-to: Your message of "Sat, 13 Apr 1996 21:07:34 EDT." From: David Greenman Reply-To: davidg@Root.COM Date: Sat, 13 Apr 1996 20:58:35 -0700 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > For some reason, our Web/FTP server has been crashing/hanging a >lot lately. I was able to take down the reason for two recent ones: > >panic: kmem_malloc: kmem_map too small >panic: pmap_zero_page: CMAP busy > > The mysterious process deadlock hang also hit a couple of times >(can switch virtual consoles, can ping, but nothing else), with no >helpful errors logged. > > I'm going to upgrade to the latest snapshot too see if this >problem goes away. The kernel has maxusers=128, SysV IPC options >turned on, NMBCLUSTERS=8192, OPEN_MAX=1024, CHILD_MAX=512 and >MAXMEM=131072. It isn't running out of mbufs (although it did hit >7202 out of 8192 once) and I doubt it is getting anywhere close to >hitting swap. 'top' usually shows about 50MB free when there isn't a >mirror process running. Hi, Brian. The problem here appears to be that your machine is running out of kernel VM for its malloc area. There was a bug in 2.1R and previous releases that caused the space for the malloc VM to be incorrectly sized. The bug was fixed in these commits to kern_malloc.c and related files: ---------------------------- revision 1.19 date: 1996/01/29 11:12:37; author: davidg; state: Exp; lines: +7 -3 Implement what I mentioned in rev 1.18: limit per-bucket allocations to 60% of physical memory or 60% of malloc area size, whichever is smaller. ---------------------------- revision 1.18 date: 1996/01/29 09:58:34; author: davidg; state: Exp; lines: +9 -7 Fixed two bugs in the calculation of the malloc area (kmem_map) size: 1) The calculation didn't account for NMBCLUSTERS, so if a large number of clusters was specified, it would leave little or no space for kernel malloc. 2) It was bogusly restricted to v_page_count. This doesn't take into account the sparseness of the malloc area and would have caused problems on machines with small amounts of memory. It should probably instead be changed to set the malloc limit to be constrained by the amount of memory, but I didn't do this. ---------------------------- ... ---------------------------- revision 1.12.4.1 date: 1996/01/29 11:20:25; author: davidg; state: Exp; lines: +13 -7 Retrofitted changes from revs 1.18 and 1.19: fix bugs with malloc area size calculations. ---------------------------- I strongly encourage you to upgrade the affected machines to -stable. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project