diff options
author | silby <silby@FreeBSD.org> | 2003-07-08 18:59:21 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-07-08 18:59:21 +0000 |
commit | fa9cd99702046cfda15082e7b8f8e3ebb3f5e0f4 (patch) | |
tree | 321d0fd1b511f4a07f8a72713a3bc387dc271032 /sys/kern | |
parent | 810e95d9a74415521fcdc42fec34f678a610e04a (diff) | |
download | FreeBSD-src-fa9cd99702046cfda15082e7b8f8e3ebb3f5e0f4.zip FreeBSD-src-fa9cd99702046cfda15082e7b8f8e3ebb3f5e0f4.tar.gz |
Pull in the entire kmem_map size calculation from kern_malloc, rather
than the shortcircuited version I had been using, which only worked
properly on i386 & amd64.
Also, change an autoscale constant to account for the more correct
kmem_map size.
Problem noticed by: mux
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_param.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 2b7a66f..427a94a 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; |