Author: kib
Date: Wed May 26 19:26:28 2010
New Revision: 208580
URL: http://svn.freebsd.org/changeset/base/208580

Log:
  MFC r208488:
  Fix the double counting of the last process thread td_incruntime
  on exit, that is done once in thread_exit() and the second time in
  proc_reap(), by clearing td_incruntime.
  
  Approved by:  re (kensmith)

Modified:
  stable/8/sys/kern/kern_resource.c
  stable/8/sys/kern/kern_thread.c
  stable/8/sys/sys/resourcevar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/kern/kern_resource.c
==============================================================================
--- stable/8/sys/kern/kern_resource.c   Wed May 26 19:06:40 2010        
(r208579)
+++ stable/8/sys/kern/kern_resource.c   Wed May 26 19:26:28 2010        
(r208580)
@@ -76,7 +76,7 @@ static void   calcru1(struct proc *p, stru
                    struct timeval *up, struct timeval *sp);
 static int     donice(struct thread *td, struct proc *chgp, int n);
 static struct uidinfo *uilookup(uid_t uid);
-static void    ruxagg(struct proc *p, struct thread *td);
+static void    ruxagg_locked(struct rusage_ext *rux, struct thread *td);
 
 /*
  * Resource controls and accounting.
@@ -1010,7 +1010,7 @@ ruadd(struct rusage *ru, struct rusage_e
 /*
  * Aggregate tick counts into the proc's rusage_ext.
  */
-void
+static void
 ruxagg_locked(struct rusage_ext *rux, struct thread *td)
 {
 
@@ -1022,7 +1022,7 @@ ruxagg_locked(struct rusage_ext *rux, st
        rux->rux_iticks += td->td_iticks;
 }
 
-static void
+void
 ruxagg(struct proc *p, struct thread *td)
 {
 

Modified: stable/8/sys/kern/kern_thread.c
==============================================================================
--- stable/8/sys/kern/kern_thread.c     Wed May 26 19:06:40 2010        
(r208579)
+++ stable/8/sys/kern/kern_thread.c     Wed May 26 19:26:28 2010        
(r208580)
@@ -430,8 +430,8 @@ thread_exit(void)
                PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT);
 #endif
        PROC_UNLOCK(p);
+       ruxagg(p, td);
        thread_lock(td);
-       ruxagg_locked(&p->p_rux, td);
        PROC_SUNLOCK(p);
        td->td_state = TDS_INACTIVE;
 #ifdef WITNESS

Modified: stable/8/sys/sys/resourcevar.h
==============================================================================
--- stable/8/sys/sys/resourcevar.h      Wed May 26 19:06:40 2010        
(r208579)
+++ stable/8/sys/sys/resourcevar.h      Wed May 26 19:26:28 2010        
(r208580)
@@ -131,7 +131,7 @@ void         rucollect(struct rusage *ru, struc
 void    rufetch(struct proc *p, struct rusage *ru);
 void    rufetchcalc(struct proc *p, struct rusage *ru, struct timeval *up,
            struct timeval *sp);
-void    ruxagg_locked(struct rusage_ext *rux, struct thread *td);
+void    ruxagg(struct proc *p, struct thread *td);
 int     suswintr(void *base, int word);
 struct uidinfo
        *uifind(uid_t uid);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to