- 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.
This commit is contained in:
jeff 2003-12-11 04:23:39 +00:00
parent da98a74234
commit 6edc4a1eb1

View File

@ -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);