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

Function sched_rem

freebsd/kern/sched_ule.c:2632–2650  ·  view source on GitHub ↗

* Remove a thread from a run-queue without running it. This is used * when we're stealing a thread from a remote queue. Otherwise all threads * exit by calling sched_exit_thread() and sched_throw() themselves. */

Source from the content-addressed store, hash-verified

2630 * exit by calling sched_exit_thread() and sched_throw() themselves.
2631 */
2632void
2633sched_rem(struct thread *td)
2634{
2635 struct tdq *tdq;
2636
2637 KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "runq rem",
2638 "prio:%d", td->td_priority);
2639 SDT_PROBE3(sched, , , dequeue, td, td->td_proc, NULL);
2640 tdq = TDQ_CPU(td_get_sched(td)->ts_cpu);
2641 TDQ_LOCK_ASSERT(tdq, MA_OWNED);
2642 MPASS(td->td_lock == TDQ_LOCKPTR(tdq));
2643 KASSERT(TD_ON_RUNQ(td),
2644 ("sched_rem: thread not on run queue"));
2645 tdq_runq_rem(tdq, td);
2646 tdq_load_rem(tdq, td);
2647 TD_SET_CAN_RUN(td);
2648 if (td->td_priority == tdq->tdq_lowpri)
2649 tdq_setlowpri(tdq, NULL);
2650}
2651
2652/*
2653 * Fetch cpu utilization information. Updates on demand.

Callers 3

tdq_moveFunction · 0.70
sched_thread_priorityFunction · 0.70
sched_affinityFunction · 0.70

Calls 5

td_get_schedFunction · 0.85
tdq_runq_remFunction · 0.85
tdq_load_remFunction · 0.85
tdq_setlowpriFunction · 0.85
sched_tdnameFunction · 0.70

Tested by

no test coverage detected