Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 2004 01:05:12 GMT
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 54602 for review
Message-ID:  <200406110105.i5B15CDG057795@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54602

Change 54602 by julian@julian_ref on 2004/06/11 01:04:35

	compile

Affected files ...

.. //depot/projects/nsched/sys/kern/kern_kse.c#11 edit
.. //depot/projects/nsched/sys/kern/kern_thread.c#20 edit

Differences ...

==== //depot/projects/nsched/sys/kern/kern_kse.c#11 (text+ko) ====

@@ -36,7 +36,6 @@
 #include <sys/mutex.h>
 #include <sys/proc.h>
 #include <sys/smp.h>
-#include <sys/sysctl.h>
 #include <sys/sysproto.h>
 #include <sys/sched.h>
 #include <sys/signalvar.h>
@@ -53,6 +52,7 @@
 /* DEBUG ONLY */
 extern int virtual_cpu;
 extern int thread_debug;
+
 extern int max_threads_per_proc;
 extern int max_groups_per_proc;
 extern int max_threads_hits;
@@ -67,48 +67,6 @@
 static int thread_update_usr_ticks(struct thread *td, int user);
 static void thread_alloc_spare(struct thread *td, struct thread *spare);
 
-#if 0
-/* move to proc.h */
-extern void kse_purge(struct proc *p, struct thread *td);
-extern void kse_purge_group(struct thread *td);
-void kseinit(void);
-void kse_GC(void);
-
-static int virtual_cpu;
-SYSCTL_DECL(_kern_threads);
-
-static int
-sysctl_kse_virtual_cpu(SYSCTL_HANDLER_ARGS)
-{
-	int error, new_val;
-	int def_val;
-
-#ifdef SMP
-	def_val = mp_ncpus;
-#else
-	def_val = 1;
-#endif
-	if (virtual_cpu == 0)
-		new_val = def_val;
-	else
-		new_val = virtual_cpu;
-	error = sysctl_handle_int(oidp, &new_val, 0, req);
-        if (error != 0 || req->newptr == NULL)
-		return (error);
-	if (new_val < 0)
-		return (EINVAL);
-	virtual_cpu = new_val;
-	return (0);
-}
-
-/* DEBUG ONLY */
-SYSCTL_PROC(_kern_threads, OID_AUTO, virtual_cpu, CTLTYPE_INT|CTLFLAG_RW,
-	0, sizeof(virtual_cpu), sysctl_kse_virtual_cpu, "I",
-	"debug virtual cpus");
-
-
-#endif
-
 struct kse_upcall *
 upcall_alloc(void)
 {
@@ -1296,7 +1254,6 @@
 	return (error);	/* go sync */
 }
 
-#if 0
 int
 thread_upcall_check(struct thread *td)
 {
@@ -1306,4 +1263,4 @@
 	else
 		return (0);
 }
-#endif
+

==== //depot/projects/nsched/sys/kern/kern_thread.c#20 (text+ko) ====

@@ -35,6 +35,7 @@
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/proc.h>
+#include <sys/smp.h>
 #include <sys/sysctl.h>
 #include <sys/sched.h>
 #include <sys/sleepqueue.h>
@@ -69,19 +70,43 @@
 SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
 	&max_threads_hits, 0, "");
 
+int virtual_cpu;
 
+#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start))
+
 TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads);
 TAILQ_HEAD(, ksegrp) zombie_ksegrps = TAILQ_HEAD_INITIALIZER(zombie_ksegrps);
 struct mtx kse_zombie_lock;
 MTX_SYSINIT(kse_zombie_lock, &kse_zombie_lock, "kse zombie lock", MTX_SPIN);
 
-void kse_purge(struct proc *p, struct thread *td);
-void kse_purge_group(struct thread *td);
+static int
+sysctl_kse_virtual_cpu(SYSCTL_HANDLER_ARGS)
+{
+	int error, new_val;
+	int def_val;
 
-/* move to proc.h */
-extern void	kseinit(void);
-extern void	kse_GC(void);
+#ifdef SMP
+	def_val = mp_ncpus;
+#else
+	def_val = 1;
+#endif
+	if (virtual_cpu == 0)
+		new_val = def_val;
+	else
+		new_val = virtual_cpu;
+	error = sysctl_handle_int(oidp, &new_val, 0, req);
+        if (error != 0 || req->newptr == NULL)
+		return (error);
+	if (new_val < 0)
+		return (EINVAL);
+	virtual_cpu = new_val;
+	return (0);
+}
 
+/* DEBUG ONLY */
+SYSCTL_PROC(_kern_threads, OID_AUTO, virtual_cpu, CTLTYPE_INT|CTLFLAG_RW,
+	0, sizeof(virtual_cpu), sysctl_kse_virtual_cpu, "I",
+	"debug virtual cpus");
 
 /*
  * Thread ID allocator. The allocator keeps track of assigned IDs by



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