aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_thr.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2011-02-23 13:50:24 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2011-02-23 13:50:24 +0000
commit25a9cfc9e88fae21602d044f60516e9c0c2c0faa (patch)
tree91875ecf2d862fbb0fc16782e7531c43ece7ad64 /sys/kern/kern_thr.c
parenta328d5359ca83fea135d2e0022ddf7fdcd4e6722 (diff)
downloadsrc-25a9cfc9e88fae21602d044f60516e9c0c2c0faa.tar.gz
src-25a9cfc9e88fae21602d044f60516e9c0c2c0faa.zip
Notes
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r--sys/kern/kern_thr.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 75656f03c186..58c38062a6a5 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/signalvar.h>
+#include <sys/sysctl.h>
#include <sys/ucontext.h>
#include <sys/thr.h>
#include <sys/rtprio.h>
@@ -56,6 +57,16 @@ __FBSDID("$FreeBSD$");
#include <security/audit/audit.h>
+SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, "thread allocation");
+
+static int max_threads_per_proc = 1500;
+SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_per_proc, CTLFLAG_RW,
+ &max_threads_per_proc, 0, "Limit on threads per proc");
+
+static int max_threads_hits;
+SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
+ &max_threads_hits, 0, "");
+
#ifdef COMPAT_FREEBSD32
static inline int
@@ -74,9 +85,6 @@ suword_lwpid(void *addr, lwpid_t lwpid)
#define suword_lwpid suword
#endif
-extern int max_threads_per_proc;
-extern int max_threads_hits;
-
static int create_thread(struct thread *td, mcontext_t *ctx,
void (*start_func)(void *), void *arg,
char *stack_base, size_t stack_size,