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

Function tdq_steal

freebsd/kern/sched_ule.c:1183–1195  ·  view source on GitHub ↗

* Attempt to steal a thread in priority order from a thread queue. */

Source from the content-addressed store, hash-verified

1181 * Attempt to steal a thread in priority order from a thread queue.
1182 */
1183static struct thread *
1184tdq_steal(struct tdq *tdq, int cpu)
1185{
1186 struct thread *td;
1187
1188 TDQ_LOCK_ASSERT(tdq, MA_OWNED);
1189 if ((td = runq_steal(&tdq->tdq_realtime, cpu)) != NULL)
1190 return (td);
1191 if ((td = runq_steal_from(&tdq->tdq_timeshare,
1192 cpu, tdq->tdq_ridx)) != NULL)
1193 return (td);
1194 return (runq_steal(&tdq->tdq_idle, cpu));
1195}
1196
1197/*
1198 * Sets the thread lock and ts_cpu to match the requested cpu. Unlocks the

Callers 1

tdq_moveFunction · 0.85

Calls 2

runq_stealFunction · 0.85
runq_steal_fromFunction · 0.85

Tested by

no test coverage detected