Put a cap on the auto-tuning of kern.maxvnodes.
Cap value chosen by: scottl
This commit is contained in:
parent
022dd0e2ed
commit
47f728c0bc
@ -257,6 +257,8 @@ int (*softdep_process_worklist_hook)(struct mount *);
|
||||
/*
|
||||
* Initialize the vnode management data structures.
|
||||
*/
|
||||
#define MAX_SAFE_MAXVNODES 100000
|
||||
|
||||
static void
|
||||
vntblinit(void *dummy __unused)
|
||||
{
|
||||
@ -270,6 +272,12 @@ vntblinit(void *dummy __unused)
|
||||
*/
|
||||
desiredvnodes = min(maxproc + cnt.v_page_count / 4, 2 * vm_kmem_size /
|
||||
(5 * (sizeof(struct vm_object) + sizeof(struct vnode))));
|
||||
if (desiredvnodes > MAX_SAFE_MAXVNODES) {
|
||||
if (bootverbose)
|
||||
printf("Reducing kern.maxvnodes %d -> %d\n",
|
||||
desiredvnodes, MAX_SAFE_MAXVNODES);
|
||||
desiredvnodes = MAX_SAFE_MAXVNODES;
|
||||
}
|
||||
minvnodes = desiredvnodes / 4;
|
||||
mtx_init(&mountlist_mtx, "mountlist", NULL, MTX_DEF);
|
||||
mtx_init(&mntid_mtx, "mntid", NULL, MTX_DEF);
|
||||
|
Loading…
x
Reference in New Issue
Block a user