From owner-freebsd-current@FreeBSD.ORG Sat Mar 6 21:18:11 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A2D9F16A4CE for ; Sat, 6 Mar 2004 21:18:11 -0800 (PST) Received: from oahu.WURLDLINK.NET (oahu.wurldlink.net [66.193.144.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6258343D1D for ; Sat, 6 Mar 2004 21:18:11 -0800 (PST) (envelope-from vince@oahu.WURLDLINK.NET) Received: from oahu.WURLDLINK.NET (vince@localhost.WURLDLINK.NET [127.0.0.1]) by oahu.WURLDLINK.NET (8.12.9/8.12.9) with ESMTP id i275HGqQ075636; Sat, 6 Mar 2004 19:17:31 -1000 (HST) Received: from localhost (vince@localhost)i275HG0k075633; Sat, 6 Mar 2004 19:17:16 -1000 (HST) Date: Sat, 6 Mar 2004 19:17:15 -1000 (HST) From: Vincent Poy To: Jon Noack In-Reply-To: <4048FB2B.1020001@alumni.rice.edu> Message-ID: <20040306191221.W8264-100000@oahu.WURLDLINK.NET> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: -CURRENT kernel panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2004 05:18:11 -0000 On Fri, 5 Mar 2004, Jon Noack wrote: > On 3/5/2004 6:23 AM, Vincent Poy wrote: > > On Fri, 5 Mar 2004, Jon Noack wrote: > >> On 3/4/2004 4:13 PM, Vincent Poy wrote: > >>> On Thu, 4 Mar 2004, Andrew Gallatin wrote: > >>>> Vincent Poy writes: > >>>>> Interesting. I'm still wondering what the VM_KMEM_SIZE_SCALE > >>>>> number represents. > >>>> > >>>> It tries to autoscale the kmem size, so that you don't need to hard > >>>> code it. Hardcoding it could be bad if you change the amount of ram > >>>> in the box. > >>> > >>> That part I understand but what exactly does the number 2 and 3 > >>> mean? > >> > >> VM_KMEM_SIZE_SCALE: > >> How many physical pages per KVA page allocated. > >> > >> > > > > I actually read that part already but is 2 basically 1/2 and 3 > > actually just 1/3? > > That's the way I read it -- check out this comment again (from > src/sys/i386/include/vmparam.h -- hopefully the formatting will be ok): > > /* > > * How many physical pages per KVA page allocated. > > * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), > VM_KMEM_SIZE_MAX) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > * is the total KVA space allocated for kmem_map. > > */ > > VM_KMEM_SIZE_SCALE is used to autoscale the value in this range: > VM_KMEM_SIZE <= vm_kmem_size <= VM_KMEM_SIZE_MAX > > This ensures we have a reasonable minimum (VM_KMEM_SIZE) and maximum > (VM_KMEM_SIZE_MAX) while making a fair effort at efficiently utilizing > available memory (Physical memory/VM_KMEM_SIZE_SCALE). Thanks. So it's easier to understand now. I'm getting the following panic only when I run the following script after like a few hours of uptime but works fine if I do it within 30 minutes of uptime... /sbin/mount /dev/ad2s1a /mnt/root /sbin/mount /dev/ad2s1d /mnt/usr killall -9 sendmail cd /mnt/root /bin/chflags -R noschg . /bin/rm -rf .* /bin/rm -rf * /sbin/dump -L -f- /|restore -rf- cd /mnt/usr /bin/chflags -R noschg . /bin/rm -rf .* /bin/rm -rf * /sbin/dump -L -f- /usr|restore -rf- /usr/sbin/sendmail -L sm-mta -bd -q1m /usr/sbin/sendmail -L sm-queue -q1m /usr/sbin/sendmail -L sm-msp-queue -Ac -q1m /usr/sbin/sendmail -L sm-mta-submit -bd -q1m -ODaemonPortOptions=Addr=localhost panic: kmem_malloc (4096): kmem_map too small: 377487360 total allocated at line 341 in file /usr/src/sys/vm/vm_kern.c cpuid=0; Debugger("panic") Stopped at Debugger+0x46: xchgl %ebx, in_Debugger.0 It seems to do it on the dump of /usr and restoring to /mnt/usr. I have tried the following but they panic the kernel as soon as the memory size is displayed. added to kernel config: options VM_KMEM_SIZE_MAX=(768*1048576) options VM_KMEM_SIZE_SCALE=2 Tried it on a kernel without the above but added in /boot/loader.conf vm.kmem_size=429391872 and they both crashed at the same spot as well... CPU: Mobile Intel(R) Pentium(R) 4 - M CPU 2.60GHz (2592.36-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf29 Stepping = 9 Features=0xbfebf9ff real memory = 2147360768 (2047 MB) avail memory = 2095669248 (1998 MB) Any ideas how to fix this? Cheers, Vince - vince@WURLDLINK.NET - Vice President ________ __ ____ Unix Networking Operations - FreeBSD-Real Unix for Free / / / / | / |[__ ] WurldLink Corporation / / / / | / | __] ] San Francisco - Honolulu - Hong Kong / / / / / |/ / | __] ] HongKong Stars/Gravis UltraSound Mailing Lists Admin /_/_/_/_/|___/|_|[____] Almighty1@IRC - oahu.DAL.NET Hawaii's DALnet IRC Network Server Admin