Lines Matching refs:pri

270  * Clear the status bit of the queue corresponding to priority level pri,
274 runq_clrbit(struct runq *rq, int pri)
280 rqb->rqb_bits[RQB_WORD(pri)],
281 rqb->rqb_bits[RQB_WORD(pri)] & ~RQB_BIT(pri),
282 RQB_BIT(pri), RQB_WORD(pri));
283 rqb->rqb_bits[RQB_WORD(pri)] &= ~RQB_BIT(pri);
294 int pri;
300 pri = RQB_FFS(rqb->rqb_bits[i]) + (i << RQB_L2BPW);
301 CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d pri=%d",
302 rqb->rqb_bits[i], i, pri);
303 return (pri);
310 runq_findbit_from(struct runq *rq, u_char pri)
317 * Set the mask for the first word so we ignore priorities before 'pri'.
319 mask = (rqb_word_t)-1 << (pri & (RQB_BPW - 1));
322 for (i = RQB_WORD(pri); i < RQB_LEN; mask = -1, i++) {
326 pri = RQB_FFS(mask) + (i << RQB_L2BPW);
327 CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d pri=%d",
328 mask, i, pri);
329 return (pri);
331 if (pri == 0)
337 pri = 0;
342 * Set the status bit of the queue corresponding to priority level pri,
346 runq_setbit(struct runq *rq, int pri)
352 rqb->rqb_bits[RQB_WORD(pri)],
353 rqb->rqb_bits[RQB_WORD(pri)] | RQB_BIT(pri),
354 RQB_BIT(pri), RQB_WORD(pri));
355 rqb->rqb_bits[RQB_WORD(pri)] |= RQB_BIT(pri);
366 int pri;
368 pri = td->td_priority / RQ_PPQ;
369 td->td_rqindex = pri;
370 runq_setbit(rq, pri);
371 rqh = &rq->rq_queues[pri];
372 CTR4(KTR_RUNQ, "runq_add: td=%p pri=%d %d rqh=%p",
373 td, td->td_priority, pri, rqh);
382 runq_add_pri(struct runq *rq, struct thread *td, u_char pri, int flags)
386 KASSERT(pri < RQ_NQS, ("runq_add_pri: %d out of range", pri));
387 td->td_rqindex = pri;
388 runq_setbit(rq, pri);
389 rqh = &rq->rq_queues[pri];
390 CTR4(KTR_RUNQ, "runq_add_pri: td=%p pri=%d idx=%d rqh=%p",
391 td, td->td_priority, pri, rqh);
429 int pri;
431 while ((pri = runq_findbit(rq)) != -1) {
432 rqh = &rq->rq_queues[pri];
455 "runq_choose_fuzz: pri=%d thread=%p rqh=%p", pri, td, rqh);
458 CTR1(KTR_RUNQ, "runq_choose_fuzz: idleproc pri=%d", pri);
471 int pri;
473 while ((pri = runq_findbit(rq)) != -1) {
474 rqh = &rq->rq_queues[pri];
478 "runq_choose: pri=%d thread=%p rqh=%p", pri, td, rqh);
481 CTR1(KTR_RUNQ, "runq_choose: idlethread pri=%d", pri);
491 int pri;
493 if ((pri = runq_findbit_from(rq, idx)) != -1) {
494 rqh = &rq->rq_queues[pri];
498 "runq_choose_from: pri=%d thread=%p idx=%d rqh=%p",
499 pri, td, td->td_rqindex, rqh);
502 CTR1(KTR_RUNQ, "runq_choose_from: idlethread pri=%d", pri);
522 u_char pri;
526 pri = td->td_rqindex;
527 KASSERT(pri < RQ_NQS, ("runq_remove_idx: Invalid index %d\n", pri));
528 rqh = &rq->rq_queues[pri];
529 CTR4(KTR_RUNQ, "runq_remove_idx: td=%p, pri=%d %d rqh=%p",
530 td, td->td_priority, pri, rqh);
534 runq_clrbit(rq, pri);
535 if (idx != NULL && *idx == pri)
536 *idx = (pri + 1) % RQ_NQS;