FreeBSD Bugzilla – Attachment 220704 Details for
Bug 251803
rctl -a user:test:readiops:throttle=0/user crash the system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
treat throttle=0 rules as deny=0 rules
patch_rctl2 (text/plain), 1.94 KB, created by
Jason A. Harmening
on 2020-12-18 23:55:35 UTC
(
hide
)
Description:
treat throttle=0 rules as deny=0 rules
Filename:
MIME Type:
Creator:
Jason A. Harmening
Created:
2020-12-18 23:55:35 UTC
Size:
1.94 KB
patch
obsolete
>Index: sys/kern/kern_rctl.c >=================================================================== >--- sys/kern/kern_rctl.c (revision 368751) >+++ sys/kern/kern_rctl.c (working copy) >@@ -600,6 +600,9 @@ > if (p->p_state != PRS_NORMAL) > continue; > >+ KASSERT(rule->rr_amount != 0, >+ ("%s: attempt to throttle to 0", __func__)); >+ > /* > * Make the process sleep for a fraction of second > * proportional to the ratio of process' resource >@@ -1283,18 +1286,10 @@ > KASSERT(rctl_rule_fully_specified(rule), ("rule not fully specified")); > > /* >- * Some rules just don't make sense, like "deny" rule for an undeniable >- * resource. The exception are the RSS and %CPU resources - they are >- * not deniable in the racct sense, but the limit is enforced in >- * a different way. >+ * Some rules just don't make sense, like a "deny" rule for an >+ * undeniable resource or a "throttle" rule for a non-decaying >+ * resource. > */ >- if (rule->rr_action == RCTL_ACTION_DENY && >- !RACCT_IS_DENIABLE(rule->rr_resource) && >- rule->rr_resource != RACCT_RSS && >- rule->rr_resource != RACCT_PCTCPU) { >- return (EOPNOTSUPP); >- } >- > if (rule->rr_action == RCTL_ACTION_THROTTLE && > !RACCT_IS_DECAYING(rule->rr_resource)) { > return (EOPNOTSUPP); >@@ -1311,6 +1306,26 @@ > } > > /* >+ * Rules for throttling a resource to 0 are treated as "deny" rules >+ * and checked accordingly. >+ */ >+ if (rule->rr_action == RCTL_ACTION_THROTTLE && >+ rule->rr_amount == 0) { >+ rule->rr_action = RCTL_ACTION_DENY; >+ } >+ >+ /* >+ * RSS and %CPU are not deniable in the racct sense, but the limit is >+ * enforced in a different way. >+ */ >+ if (rule->rr_action == RCTL_ACTION_DENY && >+ !RACCT_IS_DENIABLE(rule->rr_resource) && >+ rule->rr_resource != RACCT_RSS && >+ rule->rr_resource != RACCT_PCTCPU) { >+ return (EOPNOTSUPP); >+ } >+ >+ /* > * Make sure there are no duplicated rules. Also, for the "deny" > * rules, remove ones differing only by "amount". > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 251803
:
220704
|
220739