diff options
author | andre <andre@FreeBSD.org> | 2013-01-17 21:28:31 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2013-01-17 21:28:31 +0000 |
commit | d8067c27f54c1f0d1bc952da140a4f0b469b19ea (patch) | |
tree | 4ea33b1ea256eb1cad9fb08de3e6343f9199b000 /sys/kern/subr_param.c | |
parent | b7ec793bc800e8ebcc73c3f5371a4bf478262d8f (diff) | |
download | FreeBSD-src-d8067c27f54c1f0d1bc952da140a4f0b469b19ea.zip FreeBSD-src-d8067c27f54c1f0d1bc952da140a4f0b469b19ea.tar.gz |
Move the mbuf memory limit calculations from init_param2() to
tunable_mbinit() where it is next to where it is used later.
Change the sysinit level of tunable_mbinit() from SI_SUB_TUNABLES
to SI_SUB_KMEM after the VM is running. This allows to use better
methods to determine the effectively available physical and virtual
memory available to the kernel.
Update comments.
In a second step it can be merged into mbuf_init().
Diffstat (limited to 'sys/kern/subr_param.c')
-rw-r--r-- | sys/kern/subr_param.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 7671615..f36c769 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -93,7 +93,6 @@ int ncallout; /* maximum # of timer events */ int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; -quad_t maxmbufmem; /* max mbuf memory */ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ @@ -274,7 +273,6 @@ init_param1(void) void init_param2(long physpages) { - quad_t realmem; /* Base parameters */ maxusers = MAXUSERS; @@ -334,18 +332,6 @@ init_param2(long physpages) TUNABLE_INT_FETCH("kern.ncallout", &ncallout); /* - * The default limit for all mbuf related memory is 1/2 of all - * available kernel memory (physical or kmem). - * At most it can be 3/4 of available kernel memory. - */ - realmem = qmin((quad_t)physpages * PAGE_SIZE, - VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); - maxmbufmem = realmem / 2; - TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); - if (maxmbufmem > (realmem / 4) * 3) - maxmbufmem = (realmem / 4) * 3; - - /* * The default for maxpipekva is min(1/64 of the kernel address space, * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. */ |