summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-12-11 04:23:39 +0000
committerjeff <jeff@FreeBSD.org>2003-12-11 04:23:39 +0000
commit6edc4a1eb1e438d8bca422337979f029155961e7 (patch)
tree355200e9e61b010837b4d8e098d3a4eea8c12a01
parentda98a74234d770fbe15d09a3a0f51778cb9d9974 (diff)
downloadFreeBSD-src-6edc4a1eb1e438d8bca422337979f029155961e7.zip
FreeBSD-src-6edc4a1eb1e438d8bca422337979f029155961e7.tar.gz
- Don't let the pctcpu rate limiter throttle us if we have recorded over
SCHED_CPU_TICKS ticks. This was allowing processes to display (1/SCHED_CPU_TIME * 100) % more cpu than they had used.
-rw-r--r--sys/kern/sched_ule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index f7a9636..8c4eeaa 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -1584,7 +1584,8 @@ sched_pctcpu(struct thread *td)
* this causes the cpu usage to decay away too quickly due to
* rounding errors.
*/
- if (ke->ke_ltick < (ticks - (hz / 2)))
+ if (ke->ke_ftick + SCHED_CPU_TICKS < ke->ke_ltick ||
+ ke->ke_ltick < (ticks - (hz / 2)))
sched_pctcpu_update(ke);
/* How many rtick per second ? */
rtick = min(ke->ke_ticks / SCHED_CPU_TIME, SCHED_CPU_TICKS);
OpenPOWER on IntegriCloud