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
This commit is contained in:
kris 2005-04-25 19:22:05 +00:00
parent 34a3406244
commit 2584e37c8d

View File

@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/selinfo.h>
#include <sys/pipe.h>
@ -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);
/*