From owner-freebsd-current@FreeBSD.ORG Sat Mar 6 22:47:36 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 96EEE16A4CE for ; Sat, 6 Mar 2004 22:47:36 -0800 (PST) Received: from oahu.WURLDLINK.NET (oahu.wurldlink.net [66.193.144.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 563B843D39 for ; Sat, 6 Mar 2004 22:47:36 -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 i276kfqQ077103; Sat, 6 Mar 2004 20:46:56 -1000 (HST) Received: from localhost (vince@localhost)i276kfqU077100; Sat, 6 Mar 2004 20:46:41 -1000 (HST) Date: Sat, 6 Mar 2004 20:46:41 -1000 (HST) From: Vincent Poy To: Jon Noack In-Reply-To: <20040306191221.W8264-100000@oahu.WURLDLINK.NET> Message-ID: <20040306204553.H8264-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 06:47:36 -0000 On Sat, 6 Mar 2004, Vincent Poy wrote: > 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 AT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > real memory = 2147360768 (2047 MB) > avail memory = 2095669248 (1998 MB) > > Any ideas how to fix this? I managed to get the system not panicing on bootup if I set the VM_KMEM_SIZE_MAX to 384MB. At 512MB and 768MB, it would panic but anyone knows what the default VM_KMEM_SIZE_MAX size is? 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