diff options
author | bde <bde@FreeBSD.org> | 1999-03-11 21:53:12 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-03-11 21:53:12 +0000 |
commit | 29f248cf7f670dd0fdcac48a9cb1d2f0c5d2af30 (patch) | |
tree | d2d3346e859cadc11b028337c16f958180157c83 /sys/kern/kern_exit.c | |
parent | d81c143718bd2975ba94402384484b1bd79807fc (diff) | |
download | FreeBSD-src-29f248cf7f670dd0fdcac48a9cb1d2f0c5d2af30.zip FreeBSD-src-29f248cf7f670dd0fdcac48a9cb1d2f0c5d2af30.tar.gz |
Fixed runtime accounting. The time since the previous context switch
was discarded on every call to calcru(). Hacking on the `switchtime'
global for a related fix in rev.1.38 of kern_resource.c was too fragile
and broke when p_switchtime went away.
PR: 10402
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 297d9a7..fba6fda 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). |