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

Function sched_fork

freebsd/kern/sched_ule.c:2242–2256  ·  view source on GitHub ↗

* Penalize the parent for creating a new child and initialize the child's * priority. */

Source from the content-addressed store, hash-verified

2240 * priority.
2241 */
2242void
2243sched_fork(struct thread *td, struct thread *child)
2244{
2245 THREAD_LOCK_ASSERT(td, MA_OWNED);
2246 sched_pctcpu_update(td_get_sched(td), 1);
2247 sched_fork_thread(td, child);
2248 /*
2249 * Penalize the parent and child for forking.
2250 */
2251 sched_interact_fork(child);
2252 sched_priority(child);
2253 td_get_sched(td)->ts_runtime += tickincr;
2254 sched_interact_update(td);
2255 sched_priority(td);
2256}
2257
2258/*
2259 * Fork a new thread, may be within the same process.

Callers 1

do_forkFunction · 0.70

Calls 6

sched_pctcpu_updateFunction · 0.85
td_get_schedFunction · 0.85
sched_interact_forkFunction · 0.85
sched_interact_updateFunction · 0.85
sched_fork_threadFunction · 0.70
sched_priorityFunction · 0.70

Tested by

no test coverage detected