rctl(4): support throttling resource usage to 0
For rate-based resources that support throttling (e.g. readiops/writeips), this fixes a divide-by-zero panic when rctl(8) passes 0 as the throttle value. For these resources, treat zero-throttle requests as requests to suspend forward progress as long as possible using the duration specified in kern.racct.rctl.throttle_max. PR: 251803 Reported by: chris@cretaforce.gr Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27858
This commit is contained in:
parent
2defbe9f0e
commit
e8a5a1ad71
@ -600,6 +600,11 @@ rctl_enforce(struct proc *p, int resource, uint64_t amount)
|
||||
if (p->p_state != PRS_NORMAL)
|
||||
continue;
|
||||
|
||||
if (rule->rr_amount == 0) {
|
||||
racct_proc_throttle(p, rctl_throttle_max);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make the process sleep for a fraction of second
|
||||
* proportional to the ratio of process' resource
|
||||
|
Loading…
x
Reference in New Issue
Block a user