summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2001-10-10 23:06:54 +0000
committerps <ps@FreeBSD.org>2001-10-10 23:06:54 +0000
commitdb0d5cd641f1c95ac8f8c41ae9c79b92756fb2e2 (patch)
tree851a2b6bf1a0825cd12cca18ac56abe59123f449 /sys/vm
parent63fe581848b6f9a1e281df1b746662fd252d3eab (diff)
downloadFreeBSD-src-db0d5cd641f1c95ac8f8c41ae9c79b92756fb2e2.zip
FreeBSD-src-db0d5cd641f1c95ac8f8c41ae9c79b92756fb2e2.tar.gz
Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable. Reviewed by: peter MFC after: 2 weeks
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_glue.c9
-rw-r--r--sys/vm/vm_map.c6
-rw-r--r--sys/vm/vm_mmap.c5
-rw-r--r--sys/vm/vm_param.h6
4 files changed, 15 insertions, 11 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index d239516..7a03cca 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -62,7 +62,6 @@
* $FreeBSD$
*/
-#include "opt_rlimit.h"
#include "opt_vm.h"
#include <sys/param.h>
@@ -328,10 +327,10 @@ vm_init_limits(udata)
* of memory - half of main memory helps to favor smaller processes,
* and reduces thrashing of the object cache.
*/
- p->p_rlimit[RLIMIT_STACK].rlim_cur = DFLSSIZ;
- p->p_rlimit[RLIMIT_STACK].rlim_max = MAXSSIZ;
- p->p_rlimit[RLIMIT_DATA].rlim_cur = DFLDSIZ;
- p->p_rlimit[RLIMIT_DATA].rlim_max = MAXDSIZ;
+ p->p_rlimit[RLIMIT_STACK].rlim_cur = dflssiz;
+ p->p_rlimit[RLIMIT_STACK].rlim_max = maxssiz;
+ p->p_rlimit[RLIMIT_DATA].rlim_cur = dfldsiz;
+ p->p_rlimit[RLIMIT_DATA].rlim_max = maxdsiz;
/* limit the limit to no less than 2MB */
rss_limit = max(cnt.v_free_count, 512);
p->p_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit);
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index e7a4898..30ff0c7 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2396,10 +2396,10 @@ vm_map_stack (vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
if (VM_MIN_ADDRESS > 0 && addrbos < VM_MIN_ADDRESS)
return (KERN_NO_SPACE);
- if (max_ssize < SGROWSIZ)
+ if (max_ssize < sgrowsiz)
init_ssize = max_ssize;
else
- init_ssize = SGROWSIZ;
+ init_ssize = sgrowsiz;
vm_map_lock(map);
@@ -2542,7 +2542,7 @@ Retry:
}
/* Round up the grow amount modulo SGROWSIZ */
- grow_amount = roundup (grow_amount, SGROWSIZ);
+ grow_amount = roundup (grow_amount, sgrowsiz);
if (grow_amount > stack_entry->avail_ssize) {
grow_amount = stack_entry->avail_ssize;
}
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index c03c588..015ef9b 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -47,7 +47,6 @@
#include "opt_bleed.h"
#include "opt_compat.h"
-#include "opt_rlimit.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -276,8 +275,8 @@ mmap(td, uap)
*/
else if (addr == 0 ||
(addr >= round_page((vm_offset_t)vms->vm_taddr) &&
- addr < round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ)))
- addr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ);
+ addr < round_page((vm_offset_t)vms->vm_daddr + maxdsiz)))
+ addr = round_page((vm_offset_t)vms->vm_daddr + maxdsiz);
mtx_lock(&Giant); /* syscall marked mp-safe but isn't */
if (flags & MAP_ANON) {
diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h
index 7237638..795157f 100644
--- a/sys/vm/vm_param.h
+++ b/sys/vm/vm_param.h
@@ -133,6 +133,12 @@ struct xswdev {
#ifdef _KERNEL
#define num_pages(x) \
((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
+extern u_quad_t maxtsiz;
+extern u_quad_t dfldsiz;
+extern u_quad_t maxdsiz;
+extern u_quad_t dflssiz;
+extern u_quad_t maxssiz;
+extern u_quad_t sgrowsiz;
#endif /* _KERNEL */
#endif /* ASSEMBLER */
#endif /* _VM_PARAM_ */
OpenPOWER on IntegriCloud