Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jun 2003 23:20:47 -0700
From:      David Schultz <das@FreeBSD.ORG>
To:        Jay Kuri <jay@oneway.com>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: questions about VM_KMEM_SIZE_SCALE
Message-ID:  <20030626062047.GA94891@HAL9000.homeunix.com>
In-Reply-To: <Pine.BSF.4.21.0306241406080.12240-100000@redux.oneway.com>
References:  <Pine.BSF.4.21.0306241406080.12240-100000@redux.oneway.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030626062047.GA94891>