From owner-svn-src-all@FreeBSD.ORG Wed Feb 23 13:50:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C110106566C; Wed, 23 Feb 2011 13:50:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 305508FC13; Wed, 23 Feb 2011 13:50:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1NDoPlG069545; Wed, 23 Feb 2011 13:50:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1NDoPO1069542; Wed, 23 Feb 2011 13:50:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102231350.p1NDoPO1069542@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Feb 2011 13:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218972 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2011 13:50:25 -0000 Author: kib Date: Wed Feb 23 13:50:24 2011 New Revision: 218972 URL: http://svn.freebsd.org/changeset/base/218972 Log: 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 Modified: head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Wed Feb 23 13:25:42 2011 (r218971) +++ head/sys/kern/kern_thr.c Wed Feb 23 13:50:24 2011 (r218972) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -56,6 +57,16 @@ __FBSDID("$FreeBSD$"); #include +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, Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Feb 23 13:25:42 2011 (r218971) +++ head/sys/kern/kern_thread.c Wed Feb 23 13:50:24 2011 (r218972) @@ -65,16 +65,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);