Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Mar 2011 00:36:28 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r219159 - stable/8/sys/kern
Message-ID:  <201103020036.p220aSei072100@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar  2 00:36:28 2011
New Revision: 219159
URL: http://svn.freebsd.org/changeset/base/219159

Log:
  MFC r218972:
  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.
  
  MFC r218976 (by pluknet):
  Clean up the now unused #include statement.

Modified:
  stable/8/sys/kern/kern_thr.c
  stable/8/sys/kern/kern_thread.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_thr.c
==============================================================================
--- stable/8/sys/kern/kern_thr.c	Wed Mar  2 00:29:14 2011	(r219158)
+++ stable/8/sys/kern/kern_thr.c	Wed Mar  2 00:36:28 2011	(r219159)
@@ -45,6 +45,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>
@@ -55,6 +56,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
@@ -73,9 +84,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,

Modified: stable/8/sys/kern/kern_thread.c
==============================================================================
--- stable/8/sys/kern/kern_thread.c	Wed Mar  2 00:29:14 2011	(r219158)
+++ stable/8/sys/kern/kern_thread.c	Wed Mar  2 00:36:28 2011	(r219159)
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/proc.h>
 #include <sys/resourcevar.h>
 #include <sys/smp.h>
-#include <sys/sysctl.h>
 #include <sys/sched.h>
 #include <sys/sleepqueue.h>
 #include <sys/selinfo.h>
@@ -64,16 +63,6 @@ __FBSDID("$FreeBSD$");
  */
 static uma_zone_t thread_zone;
 
-SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, "thread allocation");
-
-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");
-
-int max_threads_hits;
-SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
-	&max_threads_hits, 0, "");
-
 TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads);
 static struct mtx zombie_lock;
 MTX_SYSINIT(zombie_lock, &zombie_lock, "zombie lock", MTX_SPIN);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103020036.p220aSei072100>