From 1f29f2c5bd3fad36d01bbd1000d484cb8d45d851 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 19 Oct 2011 08:17:35 -0700 Subject: [PATCH 1/1] kernel - Increase exec args cache on 64-bit boxes * Increase the exec args cache on 64-bit boxes with more than 4G of ram. This increases the number of concurrent applicationss which can be undergoing an exec. --- sys/kern/kern_exec.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 729c8f5e42..e5b0a77fe8 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -112,8 +112,20 @@ void exec_objcache_init(void *arg __unused) { int cluster_limit; + size_t limsize; + + /* + * Maximum number of concurrent execs. This can be limiting on + * systems with a lot of cpu cores but it also eats a significant + * amount of memory. + */ + cluster_limit = 16; + limsize = kmem_lim_size(); + if (limsize > 7 * 1024) + cluster_limit *= 2; + if (limsize > 15 * 1024) + cluster_limit *= 2; - cluster_limit = 16; /* up to this many objects */ exec_objcache = objcache_create_mbacked( M_EXECARGS, PATH_MAX + ARG_MAX, &cluster_limit, 8, -- 2.41.0