From f5fca0d8be8677631289562ae598160d1f94e723 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Mon, 25 Apr 2005 19:22:05 +0000 Subject: [PATCH] Add the vm.exec_map_entries tunable and read-only sysctl, which controls the number of entries in exec_map (maximum number of simultaneous execs that can be handled by the kernel). The default value of 16 is insufficient on heavily loaded machines (particularly SMP machines), and if it is exceeded then executing further processes will generate a SIGABRT. This is a workaround until a better solution can be implemented. Reviewed by: alc MFC after: 3 days --- sys/vm/vm_init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_init.c b/sys/vm/vm_init.c index baa667839c20..9125366fc78a 100644 --- a/sys/vm/vm_init.c +++ b/sys/vm/vm_init.c @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -87,6 +88,11 @@ __FBSDID("$FreeBSD$"); long physmem; +static int exec_map_entries = 16; +TUNABLE_INT("vm.exec_map_entries", &exec_map_entries); +SYSCTL_INT(_vm, OID_AUTO, exec_map_entries, CTLFLAG_RD, &exec_map_entries, 0, + "Maximum number of simultaneous execs"); + /* * System initialization */ @@ -188,7 +194,7 @@ vm_ksubmap_init(struct kva_md_info *kmi) (nswbuf*MAXPHYS)); pager_map->system_map = 1; exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, - (16*(ARG_MAX+(PAGE_SIZE*3)))); + (exec_map_entries*(ARG_MAX+(PAGE_SIZE*3)))); pipe_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, maxpipekva); /*