- Don't pass a pointer into runq_choose_from(). The caller can adjust the

index if it chooses to.
This commit is contained in:
Jeff Roberson 2007-01-04 12:10:58 +00:00
parent dbd1ddacd4
commit cd49bb7047
2 changed files with 3 additions and 4 deletions

View File

@ -556,21 +556,20 @@ runq_choose(struct runq *rq)
}
struct td_sched *
runq_choose_from(struct runq *rq, int *idx)
runq_choose_from(struct runq *rq, int idx)
{
struct rqhead *rqh;
struct td_sched *ts;
int pri;
mtx_assert(&sched_lock, MA_OWNED);
if ((pri = runq_findbit_from(rq, *idx)) != -1) {
if ((pri = runq_findbit_from(rq, idx)) != -1) {
rqh = &rq->rq_queues[pri];
ts = TAILQ_FIRST(rqh);
KASSERT(ts != NULL, ("runq_choose: no proc on busy queue"));
CTR4(KTR_RUNQ,
"runq_choose_from: pri=%d kse=%p idx=%d rqh=%p",
pri, ts, ts->ts_rqindex, rqh);
*idx = ts->ts_rqindex;
return (ts);
}
CTR1(KTR_RUNQ, "runq_choose_from: idleproc pri=%d", pri);

View File

@ -66,7 +66,7 @@ void runq_add(struct runq *, struct td_sched *, int);
void runq_add_pri(struct runq *, struct td_sched *, int, int);
int runq_check(struct runq *);
struct td_sched *runq_choose(struct runq *);
struct td_sched *runq_choose_from(struct runq *, int *);
struct td_sched *runq_choose_from(struct runq *, int);
void runq_init(struct runq *);
void runq_remove(struct runq *, struct td_sched *);
void runq_remove_idx(struct runq *, struct td_sched *, int *);