* Penalize the parent for creating a new child and initialize the child's * priority. */
| 2240 | * priority. |
| 2241 | */ |
| 2242 | void |
| 2243 | sched_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. |
no test coverage detected