PERFORCE change 52106 for review
Julian Elischer
julian at FreeBSD.org
Sun May 2 16:48:05 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=52106
Change 52106 by julian at julian_desk on 2004/05/02 16:47:51
shuffle stuff between files to move towards compiling
without (say) kse code
Affected files ...
.. //depot/projects/nsched/sys/kern/kern_kse.c#2 edit
.. //depot/projects/nsched/sys/kern/kern_thread.c#9 edit
.. //depot/projects/nsched/sys/sys/proc.h#5 edit
Differences ...
==== //depot/projects/nsched/sys/kern/kern_kse.c#2 (text+ko) ====
@@ -68,7 +68,12 @@
static uma_zone_t upcall_zone;
/* DEBUG ONLY */
-static int virtual_cpu;
+extern int virtual_cpu;
+extern int thread_debug = 0;
+extern int max_threads_per_proc = 1500;
+extern int max_groups_per_proc = 500;
+extern int max_threads_hits;
+
#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start))
@@ -263,13 +268,13 @@
mtx_lock_spin(&sched_lock);
upcall_remove(td);
if (p->p_numthreads == 1) {
- kse_purge(p, td);
+ thread_purge(p, td);
p->p_flag &= ~P_SA;
mtx_unlock_spin(&sched_lock);
PROC_UNLOCK(p);
} else {
if (kg->kg_numthreads == 1) { /* Shutdown a group */
- kse_purge_group(td);
+ thread_purge_group(td);
sched_exit_ksegrp(p->p_pptr, td);
}
thread_stopped(p);
==== //depot/projects/nsched/sys/kern/kern_thread.c#9 (text+ko) ====
@@ -69,23 +69,23 @@
/* DEBUG ONLY */
SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, "thread allocation");
-static int thread_debug = 0;
+int thread_debug = 0;
SYSCTL_INT(_kern_threads, OID_AUTO, debug, CTLFLAG_RW,
&thread_debug, 0, "thread debug");
-static int max_threads_per_proc = 1500;
+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_groups_per_proc = 500;
+int max_groups_per_proc = 500;
SYSCTL_INT(_kern_threads, OID_AUTO, max_groups_per_proc, CTLFLAG_RW,
&max_groups_per_proc, 0, "Limit on thread groups per proc");
-static int max_threads_hits;
+int max_threads_hits;
SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
&max_threads_hits, 0, "");
-static int virtual_cpu;
+int virtual_cpu;
#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start))
@@ -94,8 +94,6 @@
struct mtx kse_zombie_lock;
MTX_SYSINIT(kse_zombie_lock, &kse_zombie_lock, "kse zombie lock", MTX_SPIN);
-static void kse_purge(struct proc *p, struct thread *td);
-static void kse_purge_group(struct thread *td);
static int thread_update_usr_ticks(struct thread *td, int user);
static void thread_alloc_spare(struct thread *td, struct thread *spare);
@@ -677,7 +675,7 @@
* exit, it calls this function.
*/
static void
-kse_purge_group(struct thread *td)
+thread_purge_group(struct thread *td)
{
struct ksegrp *kg;
@@ -691,11 +689,11 @@
/*
* Purge a process's KSE resource. When a process is preparing to
- * exit, it calls kse_purge to release any extra KSE resources in
+ * exit, it calls thread_purge to release any extra KSE resources in
* the process.
*/
-static void
-kse_purge(struct proc *p, struct thread *td)
+void
+thread_purge(struct proc *p, struct thread *td)
{
struct ksegrp *kg;
@@ -808,7 +806,7 @@
if (force_exit == SINGLE_EXIT) {
if (td->td_upcall)
upcall_remove(td);
- kse_purge(p, td);
+ thread_purge(p, td);
}
mtx_unlock_spin(&sched_lock);
return (0);
==== //depot/projects/nsched/sys/sys/proc.h#5 (text+ko) ====
@@ -809,6 +809,8 @@
void thread_free(struct thread *td);
void thread_link(struct thread *td, struct ksegrp *kg);
int thread_new_tid(void);
+void thread_purge(struct proc *p, struct thread *td);
+void thread_purge_group(struct thread *td);
void thread_reap(void);
struct thread *thread_schedule_upcall(struct thread *td, struct kse_upcall *ku);
int thread_single(int how);
More information about the p4-projects
mailing list