summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thr.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-02-23 13:50:24 +0000
committerkib <kib@FreeBSD.org>2011-02-23 13:50:24 +0000
commitb083c8ec9687960d7f3313cbef07ff435175721c (patch)
tree91875ecf2d862fbb0fc16782e7531c43ece7ad64 /sys/kern/kern_thr.c
parent5d87a422b4cda5d9ff1ec8e0bb1b36239d60e28e (diff)
downloadFreeBSD-src-b083c8ec9687960d7f3313cbef07ff435175721c.zip
FreeBSD-src-b083c8ec9687960d7f3313cbef07ff435175721c.tar.gz
Move the max_threads_per_proc and max_threads_hits variables to the
file where they are used. Declare the kern.threads sysctl node at the same location. Since no external use for the variables exists, make them static. Discussed with: dchagin MFC after: 1 week
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 75656f0..58c3806 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,
OpenPOWER on IntegriCloud