* 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. */
| 508 | * transferable count does not reflect them. |
| 509 | */ |
| 510 | static __inline void |
| 511 | tdq_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 |
no test coverage detected