Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_rctl.c
Show First 20 Lines • Show All 594 Lines • ▼ Show 20 Lines | case RCTL_ACTION_DEVCTL: | ||||
sbuf_delete(&sb); | sbuf_delete(&sb); | ||||
free(buf, M_RCTL); | free(buf, M_RCTL); | ||||
link->rrl_exceeded = 1; | link->rrl_exceeded = 1; | ||||
continue; | continue; | ||||
case RCTL_ACTION_THROTTLE: | case RCTL_ACTION_THROTTLE: | ||||
if (p->p_state != PRS_NORMAL) | if (p->p_state != PRS_NORMAL) | ||||
continue; | continue; | ||||
if (rule->rr_amount == 0) { | |||||
racct_proc_throttle(p, rctl_throttle_max); | |||||
continue; | |||||
} | |||||
/* | /* | ||||
* Make the process sleep for a fraction of second | * Make the process sleep for a fraction of second | ||||
* proportional to the ratio of process' resource | * proportional to the ratio of process' resource | ||||
* utilization compared to the limit. The point is | * utilization compared to the limit. The point is | ||||
* to penalize resource hogs: processes that consume | * to penalize resource hogs: processes that consume | ||||
* more of the available resources sleep for longer. | * more of the available resources sleep for longer. | ||||
* | * | ||||
* We're trying to defer division until the very end, | * We're trying to defer division until the very end, | ||||
▲ Show 20 Lines • Show All 1,632 Lines • Show Last 20 Lines |