questions about VM_KMEM_SIZE_SCALE
David Schultz
das at FreeBSD.ORG
Wed Jun 25 23:20:52 PDT 2003
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.
More information about the freebsd-current
mailing list