From owner-freebsd-current@FreeBSD.ORG Wed Jun 25 23:20:51 2003 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 AD7E237B401 for ; Wed, 25 Jun 2003 23:20:51 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CA9D43FAF for ; Wed, 25 Jun 2003 23:20:50 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h5Q6KliP095184; Wed, 25 Jun 2003 23:20:47 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h5Q6KlpO095183; Wed, 25 Jun 2003 23:20:47 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 25 Jun 2003 23:20:47 -0700 From: David Schultz To: Jay Kuri Message-ID: <20030626062047.GA94891@HAL9000.homeunix.com> Mail-Followup-To: Jay Kuri , freebsd-current@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-current@FreeBSD.ORG Subject: Re: questions about VM_KMEM_SIZE_SCALE 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: Thu, 26 Jun 2003 06:20:52 -0000 On Tue, Jun 24, 2003, Jay Kuri wrote: > > Hi there, > > Can anyone shed some light on the implications of adjusting > VM_KMEM_SIZE_SCALE? In particular I'm wondering if I increase this to, > say, 2, what happens? I must admit I don't know how KVA is different from > KVM or total RAM... so the note in kern_malloc ("on an x86 with 256M KVA, > try to keep VM_KMEM_SIZE_MAX at 80M or below") doesn't shed enough light > on the matter. What are the implications of VM_KMEM_SIZE getting large? > > Does changing this affect memory available to user programs if it's unused > by the kernel? No, KVA_PAGES affects the memory available to user programs. (You have a 4 GB address space on i386 to split between user programs and the kernel.) Within the kernel's share of this address space, memory is split into submaps, such as the mb_map (for the network), buffer_map for the filesystem buffer cache, and the kmem_map for just about everything else. These submaps are size-limited to prevent any one of them from getting out of hand. The vm_kmem_map is sized automatically based on the amount of memory you have. Specifically, kmem_map_size = min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX) The default value for VM_KMEM_SIZE_SCALE is 3, and the default VM_KMEM_SIZE_MAX is 200MB.