MCPcopy Create free account
hub / github.com/F-Stack/f-stack / racct_pcpu_available

Function racct_pcpu_available

freebsd/kern/kern_racct.c:827–844  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

825 * throttled.
826 */
827static int64_t
828racct_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'.

Callers 1

racctdFunction · 0.85

Calls 1

rctl_pcpu_availableFunction · 0.85

Tested by

no test coverage detected