* 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. */
| 2630 | * exit by calling sched_exit_thread() and sched_throw() themselves. |
| 2631 | */ |
| 2632 | void |
| 2633 | sched_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. |
no test coverage detected