diff options
author | julian <julian@FreeBSD.org> | 2004-08-22 05:21:41 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2004-08-22 05:21:41 +0000 |
commit | 9349236b6fc39d3f6b2c2caaa8b77b476a327f55 (patch) | |
tree | da091924fa31641cd43d508d637dee31db38247b /sys/kern/sched_4bsd.c | |
parent | 5dba7e9faa7d6aca09bf8c6a30028135ff1a021b (diff) | |
download | FreeBSD-src-9349236b6fc39d3f6b2c2caaa8b77b476a327f55.zip FreeBSD-src-9349236b6fc39d3f6b2c2caaa8b77b476a327f55.tar.gz |
diff reduction for upcoming patch. Use a macro that masks
some of the odd goings on with sub-structures, because they will
go away anyhow.
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r-- | sys/kern/sched_4bsd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index c35e3dc..6c6f0c3 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -68,6 +68,7 @@ struct ke_sched { struct runq *ske_runq; /* runq the kse is currently on */ }; #define ke_runq ke_sched->ske_runq +#define ke_cpticks ke_sched->ske_cpticks #define KEF_BOUND KEF_SCHED1 #define SKE_RUNQ_PCPU(ke) \ @@ -341,20 +342,20 @@ schedcpu(void) * stop recalculating its priority until * it wakes up. */ - if (ke->ke_sched->ske_cpticks == 0) + if (ke->ke_cpticks == 0) continue; #if (FSHIFT >= CCPU_SHIFT) ke->ke_pctcpu += (realstathz == 100) - ? ((fixpt_t) ke->ke_sched->ske_cpticks) << + ? ((fixpt_t) ke->ke_cpticks) << (FSHIFT - CCPU_SHIFT) : - 100 * (((fixpt_t) ke->ke_sched->ske_cpticks) + 100 * (((fixpt_t) ke->ke_cpticks) << (FSHIFT - CCPU_SHIFT)) / realstathz; #else ke->ke_pctcpu += ((FSCALE - ccpu) * - (ke->ke_sched->ske_cpticks * + (ke->ke_cpticks * FSCALE / realstathz)) >> FSHIFT; #endif - ke->ke_sched->ske_cpticks = 0; + ke->ke_cpticks = 0; } /* end of kse loop */ /* * If there are ANY running threads in this KSEGRP, @@ -514,7 +515,7 @@ sched_clock(struct thread *td) kg = td->td_ksegrp; ke = td->td_kse; - ke->ke_sched->ske_cpticks++; + ke->ke_cpticks++; kg->kg_estcpu = ESTCPULIM(kg->kg_estcpu + 1); if ((kg->kg_estcpu % INVERSE_ESTCPU_WEIGHT) == 0) { resetpriority(kg); @@ -570,7 +571,7 @@ sched_fork(struct thread *td, struct proc *p1) void sched_fork_kse(struct thread *td, struct kse *child) { - child->ke_sched->ske_cpticks = 0; + child->ke_cpticks = 0; } void @@ -754,7 +755,7 @@ sched_rem(struct thread *td) if ((td->td_proc->p_flag & P_NOLOAD) == 0) sched_tdcnt--; - runq_remove(ke->ke_sched->ske_runq, ke); + runq_remove(ke->ke_runq, ke); ke->ke_state = KES_THREAD; ke->ke_ksegrp->kg_runq_kses--; |