Date: Tue, 14 Mar 2006 15:20:55 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93291 for review Message-ID: <200603141520.k2EFKtws060264@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93291 Change 93291 by jhb@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603141520.k2EFKtws060264>