aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-09-17 16:49:28 +0000
committerMark Johnston <markj@FreeBSD.org>2020-09-17 16:49:28 +0000
commit97458520cc15b26edbf5d5cd5ed54c3253dfa21c (patch)
tree48bf4d437e722a404a84d5b96f1e2f7063a9e4c6
parent77ceadee6d88cf4ce968b42503acfb12c668ffa5 (diff)
downloadsrc-97458520cc15b26edbf5d5cd5ed54c3253dfa21c.tar.gz
src-97458520cc15b26edbf5d5cd5ed54c3253dfa21c.zip
Increase the default vm.max_user_wired value.
Since r347532 (merged to stable/12) we only count user-wired pages towards the system limit. However, we now also treat pages wired by hypervisors (bhyve and virtualbox) as user-wired, so starting VMs with large amounts of RAM tends to fail due to the low limit. The purpose of the limit is to provide a seatbelt, not to impose some policy on the use of wired memory. Thus, increase the default limit to allow reasonable VM configurations to work without tuning. Reviewed by: kib Discussed with: dougm MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26424
Notes
Notes: svn path=/head/; revision=365841
-rw-r--r--sys/vm/vm_pageout.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 359c0a241c30..233617c809d4 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -2295,7 +2295,7 @@ vm_pageout_init_domain(int domain)
static void
vm_pageout_init(void)
{
- u_int freecount;
+ u_long freecount;
int i;
/*
@@ -2328,8 +2328,13 @@ vm_pageout_init(void)
if (vm_pageout_update_period == 0)
vm_pageout_update_period = 600;
+ /*
+ * Set the maximum number of user-wired virtual pages. Historically the
+ * main source of such pages was mlock(2) and mlockall(2). Hypervisors
+ * may also request user-wired memory.
+ */
if (vm_page_max_user_wired == 0)
- vm_page_max_user_wired = freecount / 3;
+ vm_page_max_user_wired = 4 * freecount / 5;
}
/*