summaryrefslogtreecommitdiff
path: root/sys/kern/subr_param.c
diff options
context:
space:
mode:
authorMike Silbersack <silby@FreeBSD.org>2003-07-08 18:59:21 +0000
committerMike Silbersack <silby@FreeBSD.org>2003-07-08 18:59:21 +0000
commit41f16f8208ae6a8fa29d27eb8ca09698218b7e76 (patch)
tree321d0fd1b511f4a07f8a72713a3bc387dc271032 /sys/kern/subr_param.c
parentc37faf267cadd3e35df46737d4906eae34c4d439 (diff)
Notes
Diffstat (limited to 'sys/kern/subr_param.c')
-rw-r--r--sys/kern/subr_param.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index 2b7a66f74a3c..427a94a9639a 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -137,12 +137,20 @@ init_param2(long physpages)
/* Kernel map size */
int kmempages, kmemtunable;
+ kmempages = VM_KMEM_SIZE / PAGE_SIZE;
+#if defined(VM_KMEM_SIZE_SCALE)
+ if ((physpages / VM_KMEM_SIZE_SCALE) > kmempages)
+ kmempages = (physpages / VM_KMEM_SIZE_SCALE);
+#endif
+
+#if defined(VM_KMEM_SIZE_MAX)
+ if (kmempages * PAGE_SIZE >= VM_KMEM_SIZE_MAX)
+ kmempages = VM_KMEM_SIZE_MAX / PAGE_SIZE;
+#endif
kmemtunable = 0;
TUNABLE_INT_FETCH("kern.vm.kmem.size", &kmemtunable);
if (kmemtunable != 0)
kmempages = kmemtunable / PAGE_SIZE;
- else
- kmempages = VM_KMEM_SIZE_MAX / PAGE_SIZE;
kmempages = min(physpages, kmempages);
/* Base parameters */
maxusers = MAXUSERS;
@@ -178,7 +186,7 @@ init_param2(long physpages)
* pipe memory usage to 1% of the same. Ensure that all have
* reasonable floors. (See sys_pipe.c for more info.)
*/
- maxpipes = kmempages / 20;
+ maxpipes = kmempages / 5;
maxpipekva = (kmempages / 40) * PAGE_SIZE;
maxpipekvawired = (kmempages / 100) * PAGE_SIZE;