PERFORCE change 53017 for review
Julian Elischer
julian at FreeBSD.org
Tue May 18 16:34:55 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=53017
Change 53017 by julian at julian_desk on 2004/05/18 16:33:49
rename a function.
add comments
Affected files ...
.. //depot/projects/nsched/sys/kern/kern_exit.c#7 edit
.. //depot/projects/nsched/sys/sparc64/sparc64/vm_machdep.c#3 edit
.. //depot/projects/nsched/sys/sys/proc.h#8 edit
Differences ...
==== //depot/projects/nsched/sys/kern/kern_exit.c#7 (text+ko) ====
@@ -485,7 +485,7 @@
* Finally, call machine-dependent code to release the remaining
* resources including address space.
* The address space is released by "vmspace_exitfree(p)" in
- * vm_waitproc().
+ * vm_waitproc(). To be called BEFORE taking the final schedlock.
*/
cpu_exit(td);
@@ -516,17 +516,21 @@
binuptime(PCPU_PTR(switchtime));
PCPU_SET(switchticks, ticks);
- cpu_sched_exit(td); /* XXXKSE check if this should be in thread_exit */
+ /*
+ * CPU specific things that need to be done
+ * after taking the final schedlock before calling cpu_throw().
+ * Currently only used on sparc64.
+ */
+ cpu_exit2(td);
+
/*
* Allow the scheduler to adjust the priority of the
* parent when a process is exiting.
*/
- if (p->p_pptr != initproc)
- sched_exit(p->p_pptr, td);
+ sched_exit(p->p_pptr, td);
/*
- * Make sure the scheduler takes this thread out of its tables etc.
- * This will also release this thread's reference to the ucred.
+ * Make sure the system takes this thread out of its tables etc.
* Other thread parts to release include pcb bits and such.
*/
thread_exit();
==== //depot/projects/nsched/sys/sparc64/sparc64/vm_machdep.c#3 (text+ko) ====
@@ -120,8 +120,17 @@
}
}
+/*
+ * Must be called after the final schedlock has been
+ * procured in the glidepath for thread/process destruction.
+ * This removes some values checked by the optimisation that allows
+ * the change of vmspace to be short-circuited in some cases.
+ * by making these values NULL the switch() code will be
+ * forced to load a new vmspace in each cpu, thus making this one
+ * free for recycling etc.
+ */
void
-cpu_sched_exit(struct thread *td)
+cpu_exit2(struct thread *td)
{
struct vmspace *vm;
struct pcpu *pc;
==== //depot/projects/nsched/sys/sys/proc.h#8 (text+ko) ====
@@ -787,7 +787,7 @@
void userret(struct thread *, struct trapframe *, u_int);
void cpu_exit(struct thread *);
-void cpu_sched_exit(struct thread *);
+void cpu_exit2(struct thread *);
void exit1(struct thread *, int) __dead2;
void cpu_fork(struct thread *, struct proc *, struct thread *, int);
void cpu_set_fork_handler(struct thread *, void (*)(void *), void *);
More information about the p4-projects
mailing list