* 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. */
| 2336 | * causes new processes spawned by it to receive worse scores immediately. |
| 2337 | */ |
| 2338 | void |
| 2339 | sched_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 | |
| 2356 | void |
| 2357 | sched_preempt(struct thread *td) |
no test coverage detected