Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2007 23:43:11 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 129917 for review
Message-ID:  <200712012343.lB1NhB3p096717@repoman.freebsd.org>

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

Change 129917 by peter@peter_daintree on 2007/12/01 23:42:38

	misc cleanups. don't blame things on KSE that are general problems
	for threads.

Affected files ...

.. //depot/projects/bike_sched/sys/amd64/amd64/vm_machdep.c#5 edit
.. //depot/projects/bike_sched/sys/i386/i386/vm_machdep.c#4 edit
.. //depot/projects/bike_sched/sys/kern/imgact_elf.c#3 edit
.. //depot/projects/bike_sched/sys/kern/kern_exec.c#3 edit
.. //depot/projects/bike_sched/sys/kern/kern_intr.c#6 edit
.. //depot/projects/bike_sched/sys/kern/kern_proc.c#4 edit
.. //depot/projects/bike_sched/sys/kern/kern_resource.c#4 edit
.. //depot/projects/bike_sched/sys/kern/kern_sig.c#5 edit
.. //depot/projects/bike_sched/sys/kern/kern_thread.c#7 edit
.. //depot/projects/bike_sched/sys/kern/p1003_1b.c#2 edit
.. //depot/projects/bike_sched/sys/kern/sched_4bsd.c#12 edit
.. //depot/projects/bike_sched/sys/kern/sched_ule.c#12 edit
.. //depot/projects/bike_sched/sys/kern/subr_sleepqueue.c#3 edit
.. //depot/projects/bike_sched/sys/kern/subr_trap.c#6 edit
.. //depot/projects/bike_sched/sys/sys/kse.h#2 delete

Differences ...

==== //depot/projects/bike_sched/sys/amd64/amd64/vm_machdep.c#5 (text+ko) ====

@@ -51,7 +51,6 @@
 #include <sys/systm.h>
 #include <sys/bio.h>
 #include <sys/buf.h>
-#include <sys/kse.h>
 #include <sys/kernel.h>
 #include <sys/ktr.h>
 #include <sys/lock.h>

==== //depot/projects/bike_sched/sys/i386/i386/vm_machdep.c#4 (text+ko) ====

@@ -53,7 +53,6 @@
 #include <sys/systm.h>
 #include <sys/bio.h>
 #include <sys/buf.h>
-#include <sys/kse.h>
 #include <sys/kernel.h>
 #include <sys/ktr.h>
 #include <sys/lock.h>

==== //depot/projects/bike_sched/sys/kern/imgact_elf.c#3 (text+ko) ====

@@ -479,9 +479,7 @@
 	u_long base_addr = 0;
 	int vfslocked, error, i, numsegs;
 
-	if (curthread->td_proc != p)
-		panic("elf_load_file - thread");	/* XXXKSE DIAGNOSTIC */
-
+	KASSERT(curthread->td_proc == p, ("elf_load_file - thread"));
 	tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK);
 	nd = &tempdata->nd;
 	attr = &tempdata->attr;
@@ -497,7 +495,6 @@
 	imgp->object = NULL;
 	imgp->execlabel = NULL;
 
-	/* XXXKSE */
 	NDINIT(nd, LOOKUP, MPSAFE|LOCKLEAF|FOLLOW, UIO_SYSSPACE, file,
 	    curthread);
 	vfslocked = 0;
@@ -947,7 +944,7 @@
 			    (caddr_t)(uintptr_t)php->p_vaddr,
 			    php->p_filesz, offset, UIO_USERSPACE,
 			    IO_UNIT | IO_DIRECT, cred, NOCRED, NULL,
-			    curthread); /* XXXKSE */
+			    curthread);
 			if (error != 0)
 				break;
 			offset += php->p_filesz;
@@ -1094,8 +1091,7 @@
 
 	/* Write it to the core file. */
 	return (vn_rdwr_inchunks(UIO_WRITE, vp, hdr, hdrsize, (off_t)0,
-	    UIO_SYSSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, NULL,
-	    td)); /* XXXKSE */
+	    UIO_SYSSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, td));
 }
 
 #if defined(COMPAT_IA32) && __ELF_WORD_SIZE == 32

==== //depot/projects/bike_sched/sys/kern/kern_exec.c#3 (text+ko) ====

@@ -1186,7 +1186,7 @@
 	struct thread *td;
 	int error;
 
-	td = curthread;			/* XXXKSE */
+	td = curthread;
 
 	/* Get file attributes */
 	error = VOP_GETATTR(vp, attr, td->td_ucred, td);

==== //depot/projects/bike_sched/sys/kern/kern_intr.c#6 (text+ko) ====

@@ -905,7 +905,7 @@
 	}
 	return (intr_event_add_handler(ie, name, NULL, handler, arg,
 		    (pri * RQ_PPQ) + PI_SOFT, flags, cookiep));
-		    /* XXKSE.. think of a better way to get separate queues */
+		    /* XXX: think of a better way to get separate queues */
 }
 
 /*

==== //depot/projects/bike_sched/sys/kern/kern_proc.c#4 (text+ko) ====

@@ -634,7 +634,6 @@
 	kp->ki_structsize = sizeof(*kp);
 	kp->ki_paddr = p;
 	PROC_LOCK_ASSERT(p, MA_OWNED);
-	kp->ki_addr =/* p->p_addr; */0; /* XXXKSE */
 	kp->ki_args = p->p_args;
 	kp->ki_textvp = p->p_textvp;
 #ifdef KTRACE
@@ -782,7 +781,7 @@
 		bzero(kp->ki_lockname, sizeof(kp->ki_lockname));
 	}
 
-	if (p->p_state == PRS_NORMAL) { /*  XXXKSE very approximate */
+	if (p->p_state == PRS_NORMAL) {
 		if (TD_ON_RUNQ(td) ||
 		    TD_CAN_RUN(td) ||
 		    TD_IS_RUNNING(td)) {

==== //depot/projects/bike_sched/sys/kern/kern_resource.c#4 (text+ko) ====

@@ -406,7 +406,7 @@
 		 * or if one is, report the highest priority
 		 * in the process.  There isn't much more you can do as 
 		 * there is only room to return a single priority.
-		 * XXXKSE: maybe need a new interface to report 
+		 * XXX: maybe need a new interface to report 
 		 * priorities of multiple system scope threads.
 		 * Note: specifying our own pid is not the same
 		 * as leaving it zero.

==== //depot/projects/bike_sched/sys/kern/kern_sig.c#5 (text+ko) ====

@@ -49,7 +49,6 @@
 #include <sys/event.h>
 #include <sys/fcntl.h>
 #include <sys/kernel.h>
-#include <sys/kse.h>
 #include <sys/ktr.h>
 #include <sys/ktrace.h>
 #include <sys/lock.h>

==== //depot/projects/bike_sched/sys/kern/kern_thread.c#7 (text+ko) ====

@@ -306,7 +306,6 @@
  *
  * called from:
  * exit1()
- * kse_exit()
  * thr_exit()
  * thread_suspend_check()
  */
@@ -386,7 +385,6 @@
 			 * what should we do?
 			 * Theoretically this can't happen
  			 * exit1() - clears threading flags before coming here
- 			 * kse_exit() - treats last thread specially
  			 * thr_exit() - treats last thread specially
  			 * thread_suspend_check() - only if more exist
 			 */
@@ -434,7 +432,7 @@
  * be used by the process.
  *
  * Note that we do not link to the proc's ucred here.
- * The thread is linked as if running but no KSE assigned.
+ *
  * Called from:
  *  proc_linkup()
  *  thr_create()
@@ -463,7 +461,6 @@
  * Convert a process with one thread to an unthreaded process.
  * Called from:
  *  thread_single(exit)  (called from execve and exit)
- *  kse_exit()		XXX may need cleaning up wrt KSE stuff
  */
 void
 thread_unthread(struct thread *td)

==== //depot/projects/bike_sched/sys/kern/p1003_1b.c#2 (text+ko) ====

@@ -156,7 +156,8 @@
 		if (targetp == NULL) {
 			return (ESRCH);
 		}
-		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
+		/* XXX: This doesn't work well for threads. */
+		targettd = FIRST_THREAD_IN_PROC(targetp);
 	}
 
 	e = p_cansee(td, targetp);
@@ -223,7 +224,8 @@
 			e = ESRCH;
 			goto done2;
 		}
-		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
+		/* XXX: This doesn't work well for threads. */
+		targettd = FIRST_THREAD_IN_PROC(targetp);
 	}
 
 	e = p_cansee(td, targetp);

==== //depot/projects/bike_sched/sys/kern/sched_4bsd.c#12 (text+ko) ====

@@ -383,7 +383,6 @@
 			/*
 			 * ts_pctcpu is only for ps and ttyinfo().
 			 * Do it per td_sched, and add them up at the end?
-			 * XXXKSE
 			 */
 			ts->ts_pctcpu = (ts->ts_pctcpu * ccpu) >> FSHIFT;
 			/*

==== //depot/projects/bike_sched/sys/kern/sched_ule.c#12 (text+ko) ====

@@ -1884,7 +1884,7 @@
 	 */
 	TDQ_LOCK_ASSERT(tdq, MA_OWNED | MA_NOTRECURSED);
 	/*
-	 * If KSE assigned a new thread just add it here and let choosethread
+	 * If preemption assigned a new thread just add it here and let choosethread
 	 * select the best one.
 	 */
 	if (newtd != NULL)

==== //depot/projects/bike_sched/sys/kern/subr_sleepqueue.c#3 (text+ko) ====

@@ -414,7 +414,6 @@
 			sleepq_switch(wchan);
 			return (0);
 		}
-		/* KSE threads tried unblocking us. */
 		ret = td->td_intrval;
 		MPASS(ret == EINTR || ret == ERESTART || ret == EWOULDBLOCK);
 	}

==== //depot/projects/bike_sched/sys/kern/subr_trap.c#6 (text+ko) ====

@@ -189,7 +189,7 @@
 	PCPU_INC(cnt.v_trap);
 
 	/*
-	 * XXXKSE While the fact that we owe a user profiling
+	 * XXX While the fact that we owe a user profiling
 	 * tick is stored per thread in this code, the statistics
 	 * themselves are still stored per process.
 	 * This should probably change, by which I mean that



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