* 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. */
| 1666 | * to learn that the compiler is behaving badly very quickly. |
| 1667 | */ |
| 1668 | static void |
| 1669 | sched_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. |
no test coverage detected