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

Function sched_runnable

freebsd/kern/sched_ule.c:2474–2492  ·  view source on GitHub ↗

* Return whether the current CPU has runnable tasks. Used for in-kernel * cooperative idle threads. */

Source from the content-addressed store, hash-verified

2472 * cooperative idle threads.
2473 */
2474int
2475sched_runnable(void)
2476{
2477 struct tdq *tdq;
2478 int load;
2479
2480 load = 1;
2481
2482 tdq = TDQ_SELF();
2483 if ((curthread->td_flags & TDF_IDLETD) != 0) {
2484 if (tdq->tdq_load > 0)
2485 goto out;
2486 } else
2487 if (tdq->tdq_load - 1 > 0)
2488 goto out;
2489 load = 0;
2490out:
2491 return (load);
2492}
2493
2494/*
2495 * Choose the highest priority thread to run. The thread is removed from

Callers 6

cpu_idleFunction · 0.50
cpu_idleFunction · 0.50
cpu_idle_acpiFunction · 0.50
cpu_idle_hltFunction · 0.50
cpu_idle_mwaitFunction · 0.50
cpu_idle_spinFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected