From owner-freebsd-current@FreeBSD.ORG Fri Mar 5 04:23:46 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 E5EFD16A4CE for ; Fri, 5 Mar 2004 04:23:45 -0800 (PST) Received: from oahu.WURLDLINK.NET (oahu.wurldlink.net [66.193.144.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48C9D43D5E for ; Fri, 5 Mar 2004 04:23:45 -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 i25CN1qQ030552; Fri, 5 Mar 2004 02:23:06 -1000 (HST) Received: from localhost (vince@localhost)i25CN193030549; Fri, 5 Mar 2004 02:23:01 -1000 (HST) Date: Fri, 5 Mar 2004 02:23:01 -1000 (HST) From: Vincent Poy To: Jon Noack In-Reply-To: <40482616.1000309@alumni.rice.edu> Message-ID: <20040305022226.T8264-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: Fri, 05 Mar 2004 12:23:46 -0000 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: > >>> On Thu, 4 Mar 2004, Andrew Gallatin wrote: > >>> > >>> 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. > > The method I used to find this information: > $ cd /usr/src/sys; grep -r VM_KMEM_SIZE_SCALE * > > src/sys//include/vmparam.h (this is for 'i386'): > ********************************************************************** > /* virtual sizes (bytes) for various kernel submaps */ > #ifndef VM_KMEM_SIZE > #define VM_KMEM_SIZE (12 * 1024 * 1024) > #endif > > /* > * 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. > */ > #ifndef VM_KMEM_SIZE_SCALE > #define VM_KMEM_SIZE_SCALE (3) > #endif > > /* > * Ceiling on amount of kmem_map kva space. > */ > #ifndef VM_KMEM_SIZE_MAX > #define VM_KMEM_SIZE_MAX (200 * 1024 * 1024) > #endif > ********************************************************************** > > src/sys/kern/kern_malloc.c: > ********************************************************************** > /* > * Try to auto-tune the kernel memory size, so that it is > * more applicable for a wider range of machine sizes. > * On an X86, a VM_KMEM_SIZE_SCALE value of 4 is good, while > * a VM_KMEM_SIZE of 12MB is a fair compromise. The > * VM_KMEM_SIZE_MAX is dependent on the maximum KVA space > * available, and on an X86 with a total KVA space of 256MB, > * try to keep VM_KMEM_SIZE_MAX at 80MB or below. > * > * Note that the kmem_map is also used by the zone allocator, > * so make sure that there is enough space. > */ > vm_kmem_size = VM_KMEM_SIZE; > mem_size = cnt.v_page_count; > > #if defined(VM_KMEM_SIZE_SCALE) > if ((mem_size / VM_KMEM_SIZE_SCALE) > (vm_kmem_size / PAGE_SIZE)) > vm_kmem_size = (mem_size / VM_KMEM_SIZE_SCALE) * PAGE_SIZE; > #endif > > #if defined(VM_KMEM_SIZE_MAX) > if (vm_kmem_size >= VM_KMEM_SIZE_MAX) > vm_kmem_size = VM_KMEM_SIZE_MAX; > #endif > ********************************************************************** I actually read that part already but is 2 basically 1/2 and 3 actually just 1/3? 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