Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 2004 00:21:18 GMT
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 54600 for review
Message-ID:  <200406110021.i5B0LIdd041398@repoman.freebsd.org>

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

Change 54600 by julian@julian_ref on 2004/06/11 00:21:14

	Merging in  from -current

Affected files ...

.. //depot/projects/nsched/sys/kern/kern_kse.c#10 edit

Differences ...

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

@@ -27,38 +27,23 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.175 2004/04/03 15:59:12 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_kse.c,v 1.180 2004/06/07 07:26:53 julian Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/lock.h>
-#include <sys/malloc.h>
 #include <sys/mutex.h>
 #include <sys/proc.h>
 #include <sys/smp.h>
 #include <sys/sysctl.h>
 #include <sys/sysproto.h>
-#include <sys/filedesc.h>
 #include <sys/sched.h>
 #include <sys/signalvar.h>
 #include <sys/sleepqueue.h>
-#include <sys/sx.h>
-#include <sys/tty.h>
-#include <sys/turnstile.h>
-#include <sys/user.h>
 #include <sys/kse.h>
 #include <sys/ktr.h>
-#include <sys/ucontext.h>
-
-#include <vm/vm.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_object.h>
-#include <vm/pmap.h>
 #include <vm/uma.h>
-#include <vm/vm_map.h>
-
-#include <machine/frame.h>
 
 /*
  * KSEGRP related storage.
@@ -74,7 +59,6 @@
 extern struct mtx kse_zombie_lock;
 
 
-
 #define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start))
 
 TAILQ_HEAD(, kse_upcall) zombie_upcalls =
@@ -83,7 +67,48 @@
 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)
 {
@@ -873,7 +898,6 @@
 	return (0);
 }
 
-
 /*
  * This function is intended to be used to initialize a spare thread
  * for upcall. Initialize thread's large data area outside sched_lock
@@ -1272,3 +1296,14 @@
 	return (error);	/* go sync */
 }
 
+#if 0
+int
+thread_upcall_check(struct thread *td)
+{
+	PROC_LOCK_ASSERT(td->td_proc, MA_OWNED);
+	if (td->td_kflags & TDK_WAKEUP)
+		return (1);
+	else
+		return (0);
+}
+#endif



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