PERFORCE change 93291 for review
John Baldwin
jhb at FreeBSD.org
Tue Mar 14 15:20:56 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=93291
Change 93291 by jhb at jhb_slimer on 2006/03/14 15:19:55
Move this to where david committed it in CVS.
Affected files ...
.. //depot/projects/smpng/sys/kern/kern_thread.c#87 edit
Differences ...
==== //depot/projects/smpng/sys/kern/kern_thread.c#87 (text+ko) ====
@@ -499,6 +499,23 @@
*/
sched_thread_exit(td);
+ /* Do the same timestamp bookkeeping that mi_switch() would do. */
+ new_switchtime = cpu_ticks();
+ p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime));
+ p->p_rux.rux_uticks += td->td_uticks;
+ p->p_rux.rux_sticks += td->td_sticks;
+ p->p_rux.rux_iticks += td->td_iticks;
+ PCPU_SET(switchtime, new_switchtime);
+ PCPU_SET(switchticks, ticks);
+ cnt.v_swtch++;
+
+ /*
+ * If we are the last thread, the process is dying, so add our
+ * usage into the usage of all our children.
+ */
+ if (p->p_numthreads == 1)
+ ruadd(p->p_ru, &p->p_rux, &p->p_stats->p_cru, &p->p_crux);
+
/*
* The last thread is left attached to the process
* So that the whole bundle gets recycled. Skip
@@ -587,23 +604,6 @@
*/
}
- /* Do the same timestamp bookkeeping that mi_switch() would do. */
- new_switchtime = cpu_ticks();
- p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime));
- p->p_rux.rux_uticks += td->td_uticks;
- p->p_rux.rux_sticks += td->td_sticks;
- p->p_rux.rux_iticks += td->td_iticks;
- PCPU_SET(switchtime, new_switchtime);
- PCPU_SET(switchticks, ticks);
- cnt.v_swtch++;
-
- /*
- * If we are the last thread, the process is dying, so add our
- * usage into the usage of all our children.
- */
- if (p->p_numthreads == 1)
- ruadd(p->p_ru, &p->p_rux, &p->p_stats->p_cru, &p->p_crux);
-
PROC_UNLOCK(p);
td->td_state = TDS_INACTIVE;
CTR1(KTR_PROC, "thread_exit: cpu_throw() thread %p", td);
More information about the p4-projects
mailing list