Lines Matching defs:pri

275  * Clear the status bit of the queue corresponding to priority level pri,
279 runq_clrbit(struct runq *rq, int pri)
285 rqb->rqb_bits[RQB_WORD(pri)],
286 rqb->rqb_bits[RQB_WORD(pri)] & ~RQB_BIT(pri),
287 RQB_BIT(pri), RQB_WORD(pri));
288 rqb->rqb_bits[RQB_WORD(pri)] &= ~RQB_BIT(pri);
299 int pri;
305 pri = RQB_FFS(rqb->rqb_bits[i]) + (i << RQB_L2BPW);
306 CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d pri=%d",
307 rqb->rqb_bits[i], i, pri);
308 return (pri);
315 runq_findbit_from(struct runq *rq, u_char pri)
322 * Set the mask for the first word so we ignore priorities before 'pri'.
324 mask = (rqb_word_t)-1 << (pri & (RQB_BPW - 1));
327 for (i = RQB_WORD(pri); i < RQB_LEN; mask = -1, i++) {
331 pri = RQB_FFS(mask) + (i << RQB_L2BPW);
332 CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d pri=%d",
333 mask, i, pri);
334 return (pri);
336 if (pri == 0)
342 pri = 0;
347 * Set the status bit of the queue corresponding to priority level pri,
351 runq_setbit(struct runq *rq, int pri)
357 rqb->rqb_bits[RQB_WORD(pri)],
358 rqb->rqb_bits[RQB_WORD(pri)] | RQB_BIT(pri),
359 RQB_BIT(pri), RQB_WORD(pri));
360 rqb->rqb_bits[RQB_WORD(pri)] |= RQB_BIT(pri);
371 int pri;
373 pri = td->td_priority / RQ_PPQ;
374 td->td_rqindex = pri;
375 runq_setbit(rq, pri);
376 rqh = &rq->rq_queues[pri];
377 CTR4(KTR_RUNQ, "runq_add: td=%p pri=%d %d rqh=%p",
378 td, td->td_priority, pri, rqh);
387 runq_add_pri(struct runq *rq, struct thread *td, u_char pri, int flags)
391 KASSERT(pri < RQ_NQS, ("runq_add_pri: %d out of range", pri));
392 td->td_rqindex = pri;
393 runq_setbit(rq, pri);
394 rqh = &rq->rq_queues[pri];
395 CTR4(KTR_RUNQ, "runq_add_pri: td=%p pri=%d idx=%d rqh=%p",
396 td, td->td_priority, pri, rqh);
434 int pri;
436 while ((pri = runq_findbit(rq)) != -1) {
437 rqh = &rq->rq_queues[pri];
460 "runq_choose_fuzz: pri=%d thread=%p rqh=%p", pri, td, rqh);
463 CTR1(KTR_RUNQ, "runq_choose_fuzz: idleproc pri=%d", pri);
476 int pri;
478 while ((pri = runq_findbit(rq)) != -1) {
479 rqh = &rq->rq_queues[pri];
483 "runq_choose: pri=%d thread=%p rqh=%p", pri, td, rqh);
486 CTR1(KTR_RUNQ, "runq_choose: idlethread pri=%d", pri);
496 int pri;
498 if ((pri = runq_findbit_from(rq, idx)) != -1) {
499 rqh = &rq->rq_queues[pri];
503 "runq_choose_from: pri=%d thread=%p idx=%d rqh=%p",
504 pri, td, td->td_rqindex, rqh);
507 CTR1(KTR_RUNQ, "runq_choose_from: idlethread pri=%d", pri);
527 u_char pri;
531 pri = td->td_rqindex;
532 KASSERT(pri < RQ_NQS, ("runq_remove_idx: Invalid index %d\n", pri));
533 rqh = &rq->rq_queues[pri];
534 CTR4(KTR_RUNQ, "runq_remove_idx: td=%p, pri=%d %d rqh=%p",
535 td, td->td_priority, pri, rqh);
539 runq_clrbit(rq, pri);
540 if (idx != NULL && *idx == pri)
541 *idx = (pri + 1) % RQ_NQS;