* Returns amount of the %cpu resource that process 'p' can add to its %cpu * utilization. Adding more than that would lead to the process being * throttled. */
| 825 | * throttled. |
| 826 | */ |
| 827 | static int64_t |
| 828 | racct_pcpu_available(struct proc *p) |
| 829 | { |
| 830 | #ifdef RCTL |
| 831 | uint64_t available; |
| 832 | |
| 833 | ASSERT_RACCT_ENABLED(); |
| 834 | |
| 835 | RACCT_LOCK(); |
| 836 | available = rctl_pcpu_available(p); |
| 837 | RACCT_UNLOCK(); |
| 838 | |
| 839 | return (available); |
| 840 | #else |
| 841 | |
| 842 | return (INT64_MAX); |
| 843 | #endif |
| 844 | } |
| 845 | |
| 846 | /* |
| 847 | * Decrease allocation of 'resource' by 'amount' for process 'p'. |
no test coverage detected