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

Function tdq_runq_rem

freebsd/kern/sched_ule.c:510–531  ·  view source on GitHub ↗

* Remove a thread from a run-queue. This typically happens when a thread * is selected to run. Running threads are not on the queue and the * transferable count does not reflect them. */

Source from the content-addressed store, hash-verified

508 * transferable count does not reflect them.
509 */
510static __inline void
511tdq_runq_rem(struct tdq *tdq, struct thread *td)
512{
513 struct td_sched *ts;
514
515 ts = td_get_sched(td);
516 TDQ_LOCK_ASSERT(tdq, MA_OWNED);
517 THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED);
518 KASSERT(ts->ts_runq != NULL,
519 ("tdq_runq_remove: thread %p null ts_runq", td));
520 if (ts->ts_flags & TSF_XFERABLE) {
521 tdq->tdq_transferable--;
522 ts->ts_flags &= ~TSF_XFERABLE;
523 }
524 if (ts->ts_runq == &tdq->tdq_timeshare) {
525 if (tdq->tdq_idx != tdq->tdq_ridx)
526 runq_remove_idx(ts->ts_runq, td, &tdq->tdq_ridx);
527 else
528 runq_remove_idx(ts->ts_runq, td, NULL);
529 } else
530 runq_remove(ts->ts_runq, td);
531}
532
533/*
534 * Load is maintained for all threads RUNNING and ON_RUNQ. Add the load

Callers 2

sched_chooseFunction · 0.85
sched_remFunction · 0.85

Calls 3

td_get_schedFunction · 0.85
runq_remove_idxFunction · 0.85
runq_removeFunction · 0.85

Tested by

no test coverage detected