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

Function sched_interact_fork

freebsd/kern/sched_ule.c:1668–1682  ·  view source on GitHub ↗

* Scale back the interactivity history when a child thread is created. The * history is inherited from the parent but the thread may behave totally * differently. For example, a shell spawning a compiler process. We want * to learn that the compiler is behaving badly very quickly. */

Source from the content-addressed store, hash-verified

1666 * to learn that the compiler is behaving badly very quickly.
1667 */
1668static void
1669sched_interact_fork(struct thread *td)
1670{
1671 struct td_sched *ts;
1672 int ratio;
1673 int sum;
1674
1675 ts = td_get_sched(td);
1676 sum = ts->ts_runtime + ts->ts_slptime;
1677 if (sum > SCHED_SLP_RUN_FORK) {
1678 ratio = sum / SCHED_SLP_RUN_FORK;
1679 ts->ts_runtime /= ratio;
1680 ts->ts_slptime /= ratio;
1681 }
1682}
1683
1684/*
1685 * Called from proc0_init() to setup the scheduler fields.

Callers 1

sched_forkFunction · 0.85

Calls 1

td_get_schedFunction · 0.85

Tested by

no test coverage detected