Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_racct.c
Show First 20 Lines • Show All 1,141 Lines • ▼ Show 20 Lines | if (p->p_throttled < 0 || (timeout > 0 && p->p_throttled > timeout)) | ||||
return; | return; | ||||
p->p_throttled = timeout; | p->p_throttled = timeout; | ||||
FOREACH_THREAD_IN_PROC(p, td) { | FOREACH_THREAD_IN_PROC(p, td) { | ||||
thread_lock(td); | thread_lock(td); | ||||
td->td_flags |= TDF_ASTPENDING; | td->td_flags |= TDF_ASTPENDING; | ||||
switch (td->td_state) { | switch (TD_GET_STATE(td)) { | ||||
case TDS_RUNQ: | case TDS_RUNQ: | ||||
/* | /* | ||||
* If the thread is on the scheduler run-queue, we can | * If the thread is on the scheduler run-queue, we can | ||||
* not just remove it from there. So we set the flag | * not just remove it from there. So we set the flag | ||||
* TDF_NEEDRESCHED for the thread, so that once it is | * TDF_NEEDRESCHED for the thread, so that once it is | ||||
* running, it is taken off the cpu as soon as possible. | * running, it is taken off the cpu as soon as possible. | ||||
*/ | */ | ||||
td->td_flags |= TDF_NEEDRESCHED; | td->td_flags |= TDF_NEEDRESCHED; | ||||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |