Lines Matching refs:pri

274 runq_clrbit(struct runq *rq, int pri)  in runq_clrbit()  argument
280 rqb->rqb_bits[RQB_WORD(pri)], in runq_clrbit()
281 rqb->rqb_bits[RQB_WORD(pri)] & ~RQB_BIT(pri), in runq_clrbit()
282 RQB_BIT(pri), RQB_WORD(pri)); in runq_clrbit()
283 rqb->rqb_bits[RQB_WORD(pri)] &= ~RQB_BIT(pri); in runq_clrbit()
294 int pri; in runq_findbit() local
300 pri = RQB_FFS(rqb->rqb_bits[i]) + (i << RQB_L2BPW); in runq_findbit()
302 rqb->rqb_bits[i], i, pri); in runq_findbit()
303 return (pri); in runq_findbit()
310 runq_findbit_from(struct runq *rq, u_char pri) in runq_findbit_from() argument
319 mask = (rqb_word_t)-1 << (pri & (RQB_BPW - 1)); in runq_findbit_from()
322 for (i = RQB_WORD(pri); i < RQB_LEN; mask = -1, i++) { in runq_findbit_from()
326 pri = RQB_FFS(mask) + (i << RQB_L2BPW); in runq_findbit_from()
328 mask, i, pri); in runq_findbit_from()
329 return (pri); in runq_findbit_from()
331 if (pri == 0) in runq_findbit_from()
337 pri = 0; in runq_findbit_from()
346 runq_setbit(struct runq *rq, int pri) in runq_setbit() argument
352 rqb->rqb_bits[RQB_WORD(pri)], in runq_setbit()
353 rqb->rqb_bits[RQB_WORD(pri)] | RQB_BIT(pri), in runq_setbit()
354 RQB_BIT(pri), RQB_WORD(pri)); in runq_setbit()
355 rqb->rqb_bits[RQB_WORD(pri)] |= RQB_BIT(pri); in runq_setbit()
366 int pri; in runq_add() local
368 pri = td->td_priority / RQ_PPQ; in runq_add()
369 td->td_rqindex = pri; in runq_add()
370 runq_setbit(rq, pri); in runq_add()
371 rqh = &rq->rq_queues[pri]; in runq_add()
373 td, td->td_priority, pri, rqh); in runq_add()
382 runq_add_pri(struct runq *rq, struct thread *td, u_char pri, int flags) in runq_add_pri() argument
386 KASSERT(pri < RQ_NQS, ("runq_add_pri: %d out of range", pri)); in runq_add_pri()
387 td->td_rqindex = pri; in runq_add_pri()
388 runq_setbit(rq, pri); in runq_add_pri()
389 rqh = &rq->rq_queues[pri]; in runq_add_pri()
391 td, td->td_priority, pri, rqh); in runq_add_pri()
429 int pri; in runq_choose_fuzz() local
431 while ((pri = runq_findbit(rq)) != -1) { in runq_choose_fuzz()
432 rqh = &rq->rq_queues[pri]; in runq_choose_fuzz()
455 "runq_choose_fuzz: pri=%d thread=%p rqh=%p", pri, td, rqh); in runq_choose_fuzz()
458 CTR1(KTR_RUNQ, "runq_choose_fuzz: idleproc pri=%d", pri); in runq_choose_fuzz()
471 int pri; in runq_choose() local
473 while ((pri = runq_findbit(rq)) != -1) { in runq_choose()
474 rqh = &rq->rq_queues[pri]; in runq_choose()
478 "runq_choose: pri=%d thread=%p rqh=%p", pri, td, rqh); in runq_choose()
481 CTR1(KTR_RUNQ, "runq_choose: idlethread pri=%d", pri); in runq_choose()
491 int pri; in runq_choose_from() local
493 if ((pri = runq_findbit_from(rq, idx)) != -1) { in runq_choose_from()
494 rqh = &rq->rq_queues[pri]; in runq_choose_from()
499 pri, td, td->td_rqindex, rqh); in runq_choose_from()
502 CTR1(KTR_RUNQ, "runq_choose_from: idlethread pri=%d", pri); in runq_choose_from()
522 u_char pri; in runq_remove_idx() local
526 pri = td->td_rqindex; in runq_remove_idx()
527 KASSERT(pri < RQ_NQS, ("runq_remove_idx: Invalid index %d\n", pri)); in runq_remove_idx()
528 rqh = &rq->rq_queues[pri]; in runq_remove_idx()
530 td, td->td_priority, pri, rqh); in runq_remove_idx()
534 runq_clrbit(rq, pri); in runq_remove_idx()
535 if (idx != NULL && *idx == pri) in runq_remove_idx()
536 *idx = (pri + 1) % RQ_NQS; in runq_remove_idx()