diff options
author | Scott Long <scottl@FreeBSD.org> | 2003-02-02 08:24:32 +0000 |
---|---|---|
committer | Scott Long <scottl@FreeBSD.org> | 2003-02-02 08:24:32 +0000 |
commit | 7121cce58a59ea4a1e284e327044643e626f1d34 (patch) | |
tree | 178bd98b68329c3cf1ac9b49a3893a482c9845f9 /sys/kern/sched_ule.c | |
parent | a1c0a7851820c972336dc34e50dee1eb9e13b172 (diff) | |
download | src-7121cce58a59ea4a1e284e327044643e626f1d34.tar.gz src-7121cce58a59ea4a1e284e327044643e626f1d34.zip |
Use hz if stathz is zero. Adopted from sched_4bsd.
Notes
Notes:
svn path=/head/; revision=110226
Diffstat (limited to 'sys/kern/sched_ule.c')
-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 3ad61d6a52dc..88b1a4722f92 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; |