MCPcopy Create free account
hub / github.com/F-Stack/f-stack / runq_choose

Function runq_choose

freebsd/kern/kern_switch.c:472–490  ·  view source on GitHub ↗

* Find the highest priority process on the run queue. */

Source from the content-addressed store, hash-verified

470 * Find the highest priority process on the run queue.
471 */
472struct thread *
473runq_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
492struct thread *
493runq_choose_from(struct runq *rq, u_char idx)

Callers 2

sched_chooseFunction · 0.85
tdq_chooseFunction · 0.85

Calls 1

runq_findbitFunction · 0.85

Tested by

no test coverage detected