diff options
author | des <des@FreeBSD.org> | 2002-03-06 15:34:07 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-03-06 15:34:07 +0000 |
commit | 8096f018ff4f9438d3a8d90a4f9f180dbeb6a96b (patch) | |
tree | 82e25557cbbf80ec203644a54d5f318bff9f7642 | |
parent | b91092523b42cd29d0216fea7df07106fdf5b311 (diff) | |
download | FreeBSD-src-8096f018ff4f9438d3a8d90a4f9f180dbeb6a96b.zip FreeBSD-src-8096f018ff4f9438d3a8d90a4f9f180dbeb6a96b.tar.gz |
Rename runq_find() to runq_findproc(), and hide it behind #ifdef DIAGNOSTIC,
as it can have a severe impact on performance under high load, and the bug
it was meant to catch was fixed ages ago.
-rw-r--r-- | sys/kern/kern_switch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index bd9c4bf..78505a3 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -152,12 +152,12 @@ runq_setbit(struct runq *rq, int pri) rqb->rqb_bits[RQB_WORD(pri)] |= RQB_BIT(pri); } -#ifdef INVARIANT_SUPPORT +#if defined(INVARIANT_SUPPORT) && defined(DIAGNOSTIC) /* * Return true if the specified process is already in the run queue. */ static __inline int -runq_find(struct runq *rq, struct kse *ke) +runq_findproc(struct runq *rq, struct kse *ke) { struct kse *ke2; int i; @@ -189,8 +189,10 @@ runq_add(struct runq *rq, struct kse *ke) mtx_assert(&sched_lock, MA_OWNED); KASSERT(p->p_stat == SRUN, ("runq_add: proc %p (%s) not SRUN", p, p->p_comm)); - KASSERT(runq_find(rq, ke) == 0, +#if defined(INVARIANTS) && defined(DIAGNOSTIC) + KASSERT(runq_findproc(rq, ke) == 0, ("runq_add: proc %p (%s) already in run queue", ke, p->p_comm)); +#endif pri = ke->ke_thread->td_priority / RQ_PPQ; ke->ke_rqindex = pri; runq_setbit(rq, pri); |