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

Function runq_findbit

freebsd/kern/kern_switch.c:296–313  ·  view source on GitHub ↗

* Find the index of the first non-empty run queue. This is done by * scanning the status bits, a set bit indicates a non-empty queue. */

Source from the content-addressed store, hash-verified

294 * scanning the status bits, a set bit indicates a non-empty queue.
295 */
296static __inline int
297runq_findbit(struct runq *rq)
298{
299 struct rqbits *rqb;
300 int pri;
301 int i;
302
303 rqb = &rq->rq_status;
304 for (i = 0; i < RQB_LEN; i++)
305 if (rqb->rqb_bits[i]) {
306 pri = RQB_FFS(rqb->rqb_bits[i]) + (i << RQB_L2BPW);
307 CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d pri=%d",
308 rqb->rqb_bits[i], i, pri);
309 return (pri);
310 }
311
312 return (-1);
313}
314
315static __inline int
316runq_findbit_from(struct runq *rq, u_char pri)

Callers 2

runq_choose_fuzzFunction · 0.85
runq_chooseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected