Make the maximum number of vnodes a function of both the physical memory
size and the kernel's heap size, specifically, vm_kmem_size. This function allows a maximum of 40% of the vm_kmem_size to be used for vnodes and vm objects. This is a conservative bound based upon recent problem reports. (In other words, a slight increase in this percentage may be safe.) Finally, machines with less than ~3GB of RAM should be unaffected by this change, i.e., the maximum number of vnodes should remain the same. If necessary, machines with 3GB or more of RAM can increase the maximum number of vnodes by increasing vm_kmem_size. Desired by: scottl Tested by: jake Approved by: re (rwatson,scottl)
This commit is contained in:
parent
f0e53e36ca
commit
2e05d89828
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115266
@ -71,6 +71,7 @@
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_map.h>
|
||||
#include <vm/vm_page.h>
|
||||
#include <vm/vm_kern.h>
|
||||
#include <vm/uma.h>
|
||||
|
||||
static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure");
|
||||
@ -458,7 +459,15 @@ static void
|
||||
vntblinit(void *dummy __unused)
|
||||
{
|
||||
|
||||
desiredvnodes = maxproc + cnt.v_page_count / 4;
|
||||
/*
|
||||
* Desiredvnodes is a function of the physical memory size and
|
||||
* the kernel's heap size. Specifically, desiredvnodes scales
|
||||
* in proportion to the physical memory size until two fifths
|
||||
* of the kernel's heap size is consumed by vnodes and vm
|
||||
* objects.
|
||||
*/
|
||||
desiredvnodes = min(maxproc + cnt.v_page_count / 4, 2 * vm_kmem_size /
|
||||
(5 * (sizeof(struct vm_object) + sizeof(struct vnode))));
|
||||
minvnodes = desiredvnodes / 4;
|
||||
mtx_init(&mountlist_mtx, "mountlist", NULL, MTX_DEF);
|
||||
mtx_init(&mntvnode_mtx, "mntvnode", NULL, MTX_DEF);
|
||||
|
Loading…
Reference in New Issue
Block a user