Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 May 2010 19:26:28 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r208580 - in stable/8/sys: kern sys
Message-ID:  <201005261926.o4QJQSoi037270@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005261926.o4QJQSoi037270>