diff options
author | scottl <scottl@FreeBSD.org> | 2003-02-02 08:24:32 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2003-02-02 08:24:32 +0000 |
commit | c0109dece26cf22a06b4facb0f11b1b0f4524ce6 (patch) | |
tree | 178bd98b68329c3cf1ac9b49a3893a482c9845f9 | |
parent | 999c7e2247cae0427d431a2ff518fb73efa28ba0 (diff) | |
download | FreeBSD-src-c0109dece26cf22a06b4facb0f11b1b0f4524ce6.zip FreeBSD-src-c0109dece26cf22a06b4facb0f11b1b0f4524ce6.tar.gz |
Use hz if stathz is zero. Adopted from sched_4bsd.
-rw-r--r-- | sys/kern/sched_ule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 3ad61d6..88b1a47 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -710,8 +710,10 @@ fixpt_t sched_pctcpu(struct kse *ke) { fixpt_t pctcpu; + int realstathz; pctcpu = 0; + realstathz = stathz ? stathz : hz; if (ke->ke_ticks) { int rtick; @@ -722,7 +724,7 @@ sched_pctcpu(struct kse *ke) /* How many rtick per second ? */ rtick = ke->ke_ticks / (SCHED_CPU_TIME * 10000); - pctcpu = (FSCALE * ((FSCALE * rtick)/stathz)) >> FSHIFT; + pctcpu = (FSCALE * ((FSCALE * rtick)/realstathz)) >> FSHIFT; } ke->ke_proc->p_swtime = ke->ke_ltick - ke->ke_ftick; |