summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-07-17 01:08:09 +0000
committerjeff <jeff@FreeBSD.org>2007-07-17 01:08:09 +0000
commita682b8e2c4ebb4fde4dc91189d0ca63893f90a68 (patch)
tree0f659d841093aeac1ee77fb9ad7526055547f479 /sys/kern
parent9dbdaa956b3c7e2731d903814b8e2e5f8f8ad40a (diff)
downloadFreeBSD-src-a682b8e2c4ebb4fde4dc91189d0ca63893f90a68.zip
FreeBSD-src-a682b8e2c4ebb4fde4dc91189d0ca63893f90a68.tar.gz
- Use ruxagg() in calcru() to make sure we have current tick information
from all threads. Discussed with: bde, attilio Approved by: re
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_resource.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 8627a14..5086a59 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -840,6 +840,14 @@ calcru(struct proc *p, struct timeval *up, struct timeval *sp)
p->p_rux.rux_runtime += u - PCPU_GET(switchtime);
PCPU_SET(switchtime, u);
}
+ /* Make sure the per-thread stats are current. */
+ FOREACH_THREAD_IN_PROC(p, td) {
+ if (td->td_runtime == 0)
+ continue;
+ thread_lock(td);
+ ruxagg(&p->p_rux, td);
+ thread_unlock(td);
+ }
calcru1(p, &p->p_rux, up, sp);
}
OpenPOWER on IntegriCloud