diff options
author | bde <bde@FreeBSD.org> | 1999-02-28 10:53:29 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-02-28 10:53:29 +0000 |
commit | 6d8d63664b85d83414c7e28ee8e59af676bfa952 (patch) | |
tree | 687f7f8e1cfdf77b73db2ec7f83acef1a466639a /sys/kern/kern_resource.c | |
parent | a9ceb881dea24247c4222bdca9665ff11872a2e6 (diff) | |
download | FreeBSD-src-6d8d63664b85d83414c7e28ee8e59af676bfa952.zip FreeBSD-src-6d8d63664b85d83414c7e28ee8e59af676bfa952.tar.gz |
Removed all traces of `p_switchtime'. The relevant timestamp is per-cpu,
not per-process. Keep it in `switchtime' consistently.
It is now clear that the timestamp is always valid in fork_trampoline()
except when the child is running on a previously idle cpu, which
can only happen if there are multiple cpus, so don't check or set
the timestamp in fork_trampoline except in the (i386) SMP case.
Just remove the alpha code for setting it unconditionally, since
there is no SMP case for alpha and the code had rotted.
Parts reviewed by: dfr, phk
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r-- | sys/kern/kern_resource.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 7ab0ecc..2fee8f8 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.40 1999/01/31 03:15:13 newton Exp $ + * $Id: kern_resource.c,v 1.41 1999/02/25 11:03:08 bde Exp $ */ #include "opt_compat.h" @@ -523,8 +523,8 @@ calcru(p, up, sp, ip) * quantum, which is much greater than the sampling error. */ microuptime(&tv); - totusec += (tv.tv_usec - p->p_switchtime.tv_usec) + - (tv.tv_sec - p->p_switchtime.tv_sec) * (int64_t)1000000; + 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 |