* Find the highest priority process on the run queue. */
| 470 | * Find the highest priority process on the run queue. |
| 471 | */ |
| 472 | struct thread * |
| 473 | runq_choose(struct runq *rq) |
| 474 | { |
| 475 | struct rqhead *rqh; |
| 476 | struct thread *td; |
| 477 | int pri; |
| 478 | |
| 479 | while ((pri = runq_findbit(rq)) != -1) { |
| 480 | rqh = &rq->rq_queues[pri]; |
| 481 | td = TAILQ_FIRST(rqh); |
| 482 | KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); |
| 483 | CTR3(KTR_RUNQ, |
| 484 | "runq_choose: pri=%d thread=%p rqh=%p", pri, td, rqh); |
| 485 | return (td); |
| 486 | } |
| 487 | CTR1(KTR_RUNQ, "runq_choose: idlethread pri=%d", pri); |
| 488 | |
| 489 | return (NULL); |
| 490 | } |
| 491 | |
| 492 | struct thread * |
| 493 | runq_choose_from(struct runq *rq, u_char idx) |
no test coverage detected