From owner-p4-projects@FreeBSD.ORG Tue Mar 14 15:20:56 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6B2FF16A422; Tue, 14 Mar 2006 15:20:56 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19A8D16A41F for ; Tue, 14 Mar 2006 15:20:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D93C143D46 for ; Tue, 14 Mar 2006 15:20:55 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2EFKtsk060267 for ; Tue, 14 Mar 2006 15:20:55 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2EFKtws060264 for perforce@freebsd.org; Tue, 14 Mar 2006 15:20:55 GMT (envelope-from jhb@freebsd.org) Date: Tue, 14 Mar 2006 15:20:55 GMT Message-Id: <200603141520.k2EFKtws060264@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 93291 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2006 15:20:56 -0000 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);