From owner-freebsd-current@FreeBSD.ORG Thu Mar 4 23:00:50 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 2091C16A4CE for ; Thu, 4 Mar 2004 23:00:50 -0800 (PST) Received: from cmsrelay03.mx.net (cmsrelay03.mx.net [165.212.11.112]) by mx1.FreeBSD.org (Postfix) with SMTP id BCE6943D1F for ; Thu, 4 Mar 2004 23:00:49 -0800 (PST) (envelope-from noackjr@alumni.rice.edu) Received: from uadvg130.cms.usa.net (165.212.11.130) by cmsoutbound.mx.net with SMTP; 5 Mar 2004 07:00:49 -0000 Received: from optimator.noacks.org [65.69.2.172] by uadvg130.cms.usa.net (ASMTP/noackjr@usa.net) via mtad (C8.MAIN.3.13N) with ESMTP id 145iceHav0106M30; Fri, 05 Mar 2004 07:00:47 GMT X-USANET-Auth: 65.69.2.172 AUTH noackjr@usa.net optimator.noacks.org Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id 517C86114; Fri, 5 Mar 2004 01:00:46 -0600 (CST) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 27376-07; Fri, 5 Mar 2004 01:00:45 -0600 (CST) Received: from alumni.rice.edu (compgeek [192.168.1.10]) by optimator.noacks.org (Postfix) with ESMTP id 318996101; Fri, 5 Mar 2004 01:00:45 -0600 (CST) Message-ID: <40482616.1000309@alumni.rice.edu> Date: Fri, 05 Mar 2004 01:02:46 -0600 From: Jon Noack User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vincent Poy References: <20040304120548.U8264-100000@oahu.WURLDLINK.NET> In-Reply-To: <20040304120548.U8264-100000@oahu.WURLDLINK.NET> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at noacks.org cc: current@freebsd.org Subject: Re: -CURRENT kernel panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: noackjr@alumni.rice.edu 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 07:00:50 -0000 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 ********************************************************************** Jon Noack