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
This commit is contained in:
parent
c37faf267c
commit
41f16f8208
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user