summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1999-03-11 21:53:12 +0000
committerBruce Evans <bde@FreeBSD.org>1999-03-11 21:53:12 +0000
commit56ce1a8dc43ddec31352b8d80762ac388b2a9b98 (patch)
treec944002d53815115144e8f9187281236d6a78497
parent40969e381b443331a10d0efc249f2b673e5b0194 (diff)
Notes
-rw-r--r--sys/kern/kern_exit.c11
-rw-r--r--sys/kern/kern_resource.c13
2 files changed, 11 insertions, 13 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 297d9a7260ca..fba6fda4ba6a 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
- * $Id: kern_exit.c,v 1.75 1999/02/19 14:25:34 luoqi Exp $
+ * $Id: kern_exit.c,v 1.76 1999/03/02 00:28:08 julian Exp $
*/
#include "opt_compat.h"
@@ -304,6 +304,15 @@ exit1(p, rv)
ruadd(p->p_ru, &p->p_stats->p_cru);
/*
+ * Pretend that an mi_switch() to the next process occurs now. We
+ * must set `switchtime' directly since we will call cpu_switch()
+ * directly. Set it now so that the rest of the exit time gets
+ * counted somewhere if possible.
+ */
+ microuptime(&switchtime);
+ switchticks = ticks;
+
+ /*
* Notify parent that we're gone. If parent has the P_NOCLDWAIT
* flag set, notify process 1 instead (and hope it will handle
* this situation).
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 99985f74592d..8683e1a60bc6 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_resource.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_resource.c,v 1.42 1999/02/28 10:53:29 bde Exp $
+ * $Id: kern_resource.c,v 1.43 1999/03/05 16:38:12 bde Exp $
*/
#include "opt_compat.h"
@@ -525,17 +525,6 @@ calcru(p, up, sp, ip)
microuptime(&tv);
totusec += (tv.tv_usec - switchtime.tv_usec) +
(tv.tv_sec - switchtime.tv_sec) * (int64_t)1000000;
-
- /*
- * Copy the time that was just read to `switchtime' in case
- * we are being called from exit1(). Exits don't go through
- * mi_switch(), so `switchtime' doesn't get set in the normal
- * way. We set it here instead of more cleanly in exit1()
- * to avoid losing track of the time between the calls to
- * microuptime(). Similarly for `switchticks'.
- */
- switchtime = tv;
- switchticks = ticks;
}
if (totusec < 0) {
/* XXX no %qd in kernel. Truncate. */