Internal method: return parameters for CFS bandwidth
( self, f )
| 793 | return pstr, qstr, self.period_us, quota |
| 794 | |
| 795 | def cfsInfo( self, f ): |
| 796 | "Internal method: return parameters for CFS bandwidth" |
| 797 | pstr, qstr = 'cfs_period_us', 'cfs_quota_us' |
| 798 | if self.cgversion == 'cgroup2': |
| 799 | pstr, qstr = 'max', '' |
| 800 | # CFS uses wall clock time for period and CPU time for quota. |
| 801 | quota = int( self.period_us * f * numCores() ) |
| 802 | period = self.period_us |
| 803 | if f > 0 and quota < 1000: |
| 804 | debug( '(cfsInfo: increasing default period) ' ) |
| 805 | quota = 1000 |
| 806 | period = int( quota / f / numCores() ) |
| 807 | # Reset to unlimited on negative quota |
| 808 | if quota < 0: |
| 809 | quota = 'max' if self.cgversion == 'cgroup2' else -1 |
| 810 | return pstr, qstr, period, quota |
| 811 | |
| 812 | # BL comment: |
| 813 | # This may not be the right API, |