diff options
author | jake <jake@FreeBSD.org> | 2002-05-08 04:39:49 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-05-08 04:39:49 +0000 |
commit | 4b2b9b41e7f9c7f65a0aa0e32d68d18cb2fa74f9 (patch) | |
tree | 9576585e88ba24777dd6dcd7d7e3d32c7ca4c798 /sys | |
parent | da0dba20520f03a953a1cda6f1ea0958b3dfda4c (diff) | |
download | FreeBSD-src-4b2b9b41e7f9c7f65a0aa0e32d68d18cb2fa74f9.zip FreeBSD-src-4b2b9b41e7f9c7f65a0aa0e32d68d18cb2fa74f9.tar.gz |
Remove runq_findproc. This never worked right in the first place and can
be prohibitively expensive.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_switch.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 1b33f28..ef95037 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -154,25 +154,6 @@ runq_setbit(struct runq *rq, int pri) rqb->rqb_bits[RQB_WORD(pri)] |= RQB_BIT(pri); } -#if defined(INVARIANT_SUPPORT) && defined(DIAGNOSTIC) -/* - * Return true if the specified process is already in the run queue. - */ -static __inline int -runq_findproc(struct runq *rq, struct kse *ke) -{ - struct kse *ke2; - int i; - - mtx_assert(&sched_lock, MA_OWNED); - for (i = 0; i < RQB_LEN; i++) - TAILQ_FOREACH(ke2, &rq->rq_queues[i], ke_procq) - if (ke2 == ke) - return 1; - return 0; -} -#endif - /* * Add the process to the queue specified by its priority, and set the * corresponding status bit. @@ -191,10 +172,6 @@ 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)); -#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); |