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

Function sched_exit_thread

freebsd/kern/sched_ule.c:2338–2354  ·  view source on GitHub ↗

* Penalize another thread for the time spent on this one. This helps to * worsen the priority and interactivity of processes which schedule batch * jobs such as make. This has little effect on the make process itself but * causes new processes spawned by it to receive worse scores immediately. */

Source from the content-addressed store, hash-verified

2336 * causes new processes spawned by it to receive worse scores immediately.
2337 */
2338void
2339sched_exit_thread(struct thread *td, struct thread *child)
2340{
2341
2342 KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "thread exit",
2343 "prio:%d", child->td_priority);
2344 /*
2345 * Give the child's runtime to the parent without returning the
2346 * sleep time as a penalty to the parent. This causes shells that
2347 * launch expensive things to mark their children as expensive.
2348 */
2349 thread_lock(td);
2350 td_get_sched(td)->ts_runtime += td_get_sched(child)->ts_runtime;
2351 sched_interact_update(td);
2352 sched_priority(td);
2353 thread_unlock(td);
2354}
2355
2356void
2357sched_preempt(struct thread *td)

Callers 2

thread_exitFunction · 0.70
sched_exitFunction · 0.70

Calls 4

td_get_schedFunction · 0.85
sched_interact_updateFunction · 0.85
sched_tdnameFunction · 0.70
sched_priorityFunction · 0.70

Tested by

no test coverage detected