Re: -CURRENT kernel panic

From: Vincent Poy <vince_at_oahu.WURLDLINK.NET>
Date: Fri, 5 Mar 2004 02:23:01 -1000 (HST)
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/<arch>/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_at_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_at_IRC - oahu.DAL.NET Hawaii's DALnet IRC Network Server Admin
Received on Fri Mar 05 2004 - 03:23:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:46 UTC