€•l”Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ'/translations/zh_CN/scheduler/sched-bwc”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/scheduler/sched-bwc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/scheduler/sched-bwc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/scheduler/sched-bwc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/scheduler/sched-bwc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/scheduler/sched-bwc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/scheduler/sched-bwc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒCFS Bandwidth Control”h]”hŒCFS Bandwidth Control”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒA/var/lib/git/docbuild/linux/Documentation/scheduler/sched-bwc.rst”h´KubhŒnote”“”)”}”(hŒThis document only discusses CPU bandwidth control for SCHED_NORMAL. The SCHED_RT case is covered in Documentation/scheduler/sched-rt-group.rst”h]”hŒ paragraph”“”)”}”(hŒThis document only discusses CPU bandwidth control for SCHED_NORMAL. The SCHED_RT case is covered in Documentation/scheduler/sched-rt-group.rst”h]”hŒThis document only discusses CPU bandwidth control for SCHED_NORMAL. The SCHED_RT case is covered in Documentation/scheduler/sched-rt-group.rst”…””}”(hhÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KhhÍubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhh·h²hh³hÊh´NubhÒ)”}”(hŒ›CFS bandwidth control is a CONFIG_FAIR_GROUP_SCHED extension which allows the specification of the maximum CPU bandwidth available to a group or hierarchy.”h]”hŒ›CFS bandwidth control is a CONFIG_FAIR_GROUP_SCHED extension which allows the specification of the maximum CPU bandwidth available to a group or hierarchy.”…””}”(hhçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K hh·h²hubhÒ)”}”(hXìThe bandwidth allowed for a group is specified using a quota and period. Within each given "period" (microseconds), a task group is allocated up to "quota" microseconds of CPU time. That quota is assigned to per-cpu run queues in slices as threads in the cgroup become runnable. Once all quota has been assigned any additional requests for quota will result in those threads being throttled. Throttled threads will not be able to run again until the next period when the quota is replenished.”h]”hXôThe bandwidth allowed for a group is specified using a quota and period. Within each given “period†(microseconds), a task group is allocated up to “quota†microseconds of CPU time. That quota is assigned to per-cpu run queues in slices as threads in the cgroup become runnable. Once all quota has been assigned any additional requests for quota will result in those threads being throttled. Throttled threads will not be able to run again until the next period when the quota is replenished.”…””}”(hhõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K hh·h²hubhÒ)”}”(hX)A group's unassigned quota is globally tracked, being refreshed back to cfs_quota units at each period boundary. As threads consume this bandwidth it is transferred to cpu-local "silos" on a demand basis. The amount transferred within each of these updates is tunable and described as the "slice".”h]”hX3A group’s unassigned quota is globally tracked, being refreshed back to cfs_quota units at each period boundary. As threads consume this bandwidth it is transferred to cpu-local “silos†on a demand basis. The amount transferred within each of these updates is tunable and described as the “sliceâ€.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Khh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ Burst feature”h]”hŒ Burst feature”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KubhÒ)”}”(hŒ”This feature borrows time now against our future underrun, at the cost of increased interference against the other system users. All nicely bounded.”h]”hŒ”This feature borrows time now against our future underrun, at the cost of increased interference against the other system users. All nicely bounded.”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Khjh²hubhÒ)”}”(hŒ9Traditional (UP-EDF) bandwidth control is something like:”h]”hŒ9Traditional (UP-EDF) bandwidth control is something like:”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Khjh²hubhŒ block_quote”“”)”}”(hŒ(U = \Sum u_i) <= 1 ”h]”hÒ)”}”(hŒ(U = \Sum u_i) <= 1”h]”hŒ(U = Sum u_i) <= 1”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K hj@ubah}”(h]”h ]”h"]”h$]”h&]”uh1j>h³hÊh´K hjh²hubhÒ)”}”(hXDThis guaranteeds both that every deadline is met and that the system is stable. After all, if U were > 1, then for every second of walltime, we'd have to run more than a second of program time, and obviously miss our deadline, but the next deadline will be further out still, there is never time to catch up, unbounded fail.”h]”hXFThis guaranteeds both that every deadline is met and that the system is stable. After all, if U were > 1, then for every second of walltime, we’d have to run more than a second of program time, and obviously miss our deadline, but the next deadline will be further out still, there is never time to catch up, unbounded fail.”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K"hjh²hubhÒ)”}”(hŒ’The burst feature observes that a workload doesn't always executes the full quota; this enables one to describe u_i as a statistical distribution.”h]”hŒ”The burst feature observes that a workload doesn’t always executes the full quota; this enables one to describe u_i as a statistical distribution.”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K(hjh²hubhÒ)”}”(hX‡For example, have u_i = {x,e}_i, where x is the p(95) and x+e p(100) (the traditional WCET). This effectively allows u to be smaller, increasing the efficiency (we can pack more tasks in the system), but at the cost of missing deadlines when all the odds line up. However, it does maintain stability, since every overrun must be paired with an underrun as long as our x is above the average.”h]”hX‡For example, have u_i = {x,e}_i, where x is the p(95) and x+e p(100) (the traditional WCET). This effectively allows u to be smaller, increasing the efficiency (we can pack more tasks in the system), but at the cost of missing deadlines when all the odds line up. However, it does maintain stability, since every overrun must be paired with an underrun as long as our x is above the average.”…””}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K+hjh²hubhÒ)”}”(hX¸That is, suppose we have 2 tasks, both specify a p(95) value, then we have a p(95)*p(95) = 90.25% chance both tasks are within their quota and everything is good. At the same time we have a p(5)p(5) = 0.25% chance both tasks will exceed their quota at the same time (guaranteed deadline fail). Somewhere in between there's a threshold where one exceeds and the other doesn't underrun enough to compensate; this depends on the specific CDFs.”h]”hX¼That is, suppose we have 2 tasks, both specify a p(95) value, then we have a p(95)*p(95) = 90.25% chance both tasks are within their quota and everything is good. At the same time we have a p(5)p(5) = 0.25% chance both tasks will exceed their quota at the same time (guaranteed deadline fail). Somewhere in between there’s a threshold where one exceeds and the other doesn’t underrun enough to compensate; this depends on the specific CDFs.”…””}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K2hjh²hubhÒ)”}”(hŒ§At the same time, we can say that the worst case deadline miss, will be \Sum e_i; that is, there is a bounded tardiness (under the assumption that x+e is indeed WCET).”h]”hŒ§At the same time, we can say that the worst case deadline miss, will be Sum e_i; that is, there is a bounded tardiness (under the assumption that x+e is indeed WCET).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K:hjh²hubhÒ)”}”(hXGThe interference when using burst is valued by the possibilities for missing the deadline and the average WCET. Test results showed that when there many cgroups or CPU is under utilized, the interference is limited. More details are shown in: https://lore.kernel.org/lkml/5371BD36-55AE-4F71-B9D7-B86DC32E3D2B@linux.alibaba.com/”h]”(hŒóThe interference when using burst is valued by the possibilities for missing the deadline and the average WCET. Test results showed that when there many cgroups or CPU is under utilized, the interference is limited. More details are shown in: ”…””}”(hjžh²hh³Nh´NubhŒ reference”“”)”}”(hŒThttps://lore.kernel.org/lkml/5371BD36-55AE-4F71-B9D7-B86DC32E3D2B@linux.alibaba.com/”h]”hŒThttps://lore.kernel.org/lkml/5371BD36-55AE-4F71-B9D7-B86DC32E3D2B@linux.alibaba.com/”…””}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jªuh1j¦hjžubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K>hjh²hubeh}”(h]”Œ burst-feature”ah ]”h"]”Œ burst feature”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒ Management”h]”hŒ Management”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÅh²hh³hÊh´KEubhÒ)”}”(hŒJQuota, period and burst are managed within the cpu subsystem via cgroupfs.”h]”hŒJQuota, period and burst are managed within the cpu subsystem via cgroupfs.”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KFhjÅh²hubhÌ)”}”(hŒ¡The cgroupfs files described in this section are only applicable to cgroup v1. For cgroup v2, see :ref:`Documentation/admin-guide/cgroup-v2.rst `.”h]”hÒ)”}”(hŒ¡The cgroupfs files described in this section are only applicable to cgroup v1. For cgroup v2, see :ref:`Documentation/admin-guide/cgroup-v2.rst `.”h]”(hŒbThe cgroupfs files described in this section are only applicable to cgroup v1. For cgroup v2, see ”…””}”(hjèh²hh³Nh´Nubh)”}”(hŒ>:ref:`Documentation/admin-guide/cgroup-v2.rst `”h]”hŒinline”“”)”}”(hjòh]”hŒ'Documentation/admin-guide/cgroup-v2.rst”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1jôhjðubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œscheduler/sched-bwc”Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œ cgroup-v2-cpu”uh1hh³hÊh´KIhjèubhŒ.”…””}”(hjèh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KIhjäubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjÅh²hh³hÊh´NubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒHcpu.cfs_quota_us: run-time replenished within a period (in microseconds)”h]”hÒ)”}”(hj.h]”hŒHcpu.cfs_quota_us: run-time replenished within a period (in microseconds)”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KMhj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj'h²hh³hÊh´Nubj+)”}”(hŒ;cpu.cfs_period_us: the length of a period (in microseconds)”h]”hÒ)”}”(hjEh]”hŒ;cpu.cfs_period_us: the length of a period (in microseconds)”…””}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KNhjCubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj'h²hh³hÊh´Nubj+)”}”(hŒAcpu.stat: exports throttling statistics [explained further below]”h]”hÒ)”}”(hj\h]”hŒAcpu.stat: exports throttling statistics [explained further below]”…””}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KOhjZubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj'h²hh³hÊh´Nubj+)”}”(hŒEcpu.cfs_burst_us: the maximum accumulated run-time (in microseconds) ”h]”hÒ)”}”(hŒDcpu.cfs_burst_us: the maximum accumulated run-time (in microseconds)”h]”hŒDcpu.cfs_burst_us: the maximum accumulated run-time (in microseconds)”…””}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KPhjqubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj'h²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j%h³hÊh´KMhjÅh²hubhÒ)”}”(hŒThe default values are::”h]”hŒThe default values are:”…””}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KRhjÅh²hubhŒ literal_block”“”)”}”(hŒ>cpu.cfs_period_us=100ms cpu.cfs_quota_us=-1 cpu.cfs_burst_us=0”h]”hŒ>cpu.cfs_period_us=100ms cpu.cfs_quota_us=-1 cpu.cfs_burst_us=0”…””}”hj¡sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jŸh³hÊh´KThjÅh²hubhÒ)”}”(hŒîA value of -1 for cpu.cfs_quota_us indicates that the group does not have any bandwidth restriction in place, such a group is described as an unconstrained bandwidth group. This represents the traditional work-conserving behavior for CFS.”h]”hŒîA value of -1 for cpu.cfs_quota_us indicates that the group does not have any bandwidth restriction in place, such a group is described as an unconstrained bandwidth group. This represents the traditional work-conserving behavior for CFS.”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KXhjÅh²hubhÒ)”}”(hXeWriting any (valid) positive value(s) no smaller than cpu.cfs_burst_us will enact the specified bandwidth limit. The minimum quota allowed for the quota or period is 1ms. There is also an upper bound on the period length of 1s. Additional restrictions exist when bandwidth limits are used in a hierarchical fashion, these are explained in more detail below.”h]”hXeWriting any (valid) positive value(s) no smaller than cpu.cfs_burst_us will enact the specified bandwidth limit. The minimum quota allowed for the quota or period is 1ms. There is also an upper bound on the period length of 1s. Additional restrictions exist when bandwidth limits are used in a hierarchical fashion, these are explained in more detail below.”…””}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K]hjÅh²hubhÒ)”}”(hŒˆWriting any negative value to cpu.cfs_quota_us will remove the bandwidth limit and return the group to an unconstrained state once more.”h]”hŒˆWriting any negative value to cpu.cfs_quota_us will remove the bandwidth limit and return the group to an unconstrained state once more.”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KchjÅh²hubhÒ)”}”(hX;A value of 0 for cpu.cfs_burst_us indicates that the group can not accumulate any unused bandwidth. It makes the traditional bandwidth control behavior for CFS unchanged. Writing any (valid) positive value(s) no larger than cpu.cfs_quota_us into cpu.cfs_burst_us will enact the cap on unused bandwidth accumulation.”h]”hX;A value of 0 for cpu.cfs_burst_us indicates that the group can not accumulate any unused bandwidth. It makes the traditional bandwidth control behavior for CFS unchanged. Writing any (valid) positive value(s) no larger than cpu.cfs_quota_us into cpu.cfs_burst_us will enact the cap on unused bandwidth accumulation.”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KfhjÅh²hubhÒ)”}”(hŒxAny updates to a group's bandwidth specification will result in it becoming unthrottled if it is in a constrained state.”h]”hŒzAny updates to a group’s bandwidth specification will result in it becoming unthrottled if it is in a constrained state.”…””}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KlhjÅh²hubeh}”(h]”Œ management”ah ]”h"]”Œ management”ah$]”h&]”uh1hµhh·h²hh³hÊh´KEubh¶)”}”(hhh]”(h»)”}”(hŒSystem wide settings”h]”hŒSystem wide settings”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÿh²hh³hÊh´KpubhÒ)”}”(hXFor efficiency run-time is transferred between the global pool and CPU local "silos" in a batch fashion. This greatly reduces global accounting pressure on large systems. The amount transferred each time such an update is required is described as the "slice".”h]”hX For efficiency run-time is transferred between the global pool and CPU local “silos†in a batch fashion. This greatly reduces global accounting pressure on large systems. The amount transferred each time such an update is required is described as the “sliceâ€.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kqhjÿh²hubhÒ)”}”(hŒThis is tunable via procfs::”h]”hŒThis is tunable via procfs:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kvhjÿh²hubj )”}”(hŒ;/proc/sys/kernel/sched_cfs_bandwidth_slice_us (default=5ms)”h]”hŒ;/proc/sys/kernel/sched_cfs_bandwidth_slice_us (default=5ms)”…””}”hj,sbah}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1jŸh³hÊh´Kxhjÿh²hubhÒ)”}”(hŒqLarger slice values will reduce transfer overheads, while smaller values allow for more fine-grained consumption.”h]”hŒqLarger slice values will reduce transfer overheads, while smaller values allow for more fine-grained consumption.”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kzhjÿh²hubeh}”(h]”Œsystem-wide-settings”ah ]”h"]”Œsystem wide settings”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kpubh¶)”}”(hhh]”(h»)”}”(hŒ Statistics”h]”hŒ Statistics”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjPh²hh³hÊh´K~ubhÒ)”}”(hŒEA group's bandwidth statistics are exported via 5 fields in cpu.stat.”h]”hŒGA group’s bandwidth statistics are exported via 5 fields in cpu.stat.”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KhjPh²hubhÒ)”}”(hŒ cpu.stat:”h]”hŒ cpu.stat:”…””}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KhjPh²hubj&)”}”(hhh]”(j+)”}”(hŒ>nr_periods: Number of enforcement intervals that have elapsed.”h]”hÒ)”}”(hj‚h]”hŒ>nr_periods: Number of enforcement intervals that have elapsed.”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kƒhj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj}h²hh³hÊh´Nubj+)”}”(hŒCnr_throttled: Number of times the group has been throttled/limited.”h]”hÒ)”}”(hj™h]”hŒCnr_throttled: Number of times the group has been throttled/limited.”…””}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K„hj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj}h²hh³hÊh´Nubj+)”}”(hŒmthrottled_time: The total time duration (in nanoseconds) for which entities of the group have been throttled.”h]”hÒ)”}”(hŒmthrottled_time: The total time duration (in nanoseconds) for which entities of the group have been throttled.”h]”hŒmthrottled_time: The total time duration (in nanoseconds) for which entities of the group have been throttled.”…””}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K…hj®ubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj}h²hh³hÊh´Nubj+)”}”(hŒ*nr_bursts: Number of periods burst occurs.”h]”hÒ)”}”(hjÈh]”hŒ*nr_bursts: Number of periods burst occurs.”…””}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K‡hjÆubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj}h²hh³hÊh´Nubj+)”}”(hŒlburst_time: Cumulative wall-time (in nanoseconds) that any CPUs has used above quota in respective periods. ”h]”hÒ)”}”(hŒkburst_time: Cumulative wall-time (in nanoseconds) that any CPUs has used above quota in respective periods.”h]”hŒkburst_time: Cumulative wall-time (in nanoseconds) that any CPUs has used above quota in respective periods.”…””}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KˆhjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hj}h²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jjuh1j%h³hÊh´KƒhjPh²hubhÒ)”}”(hŒThis interface is read-only.”h]”hŒThis interface is read-only.”…””}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K‹hjPh²hubeh}”(h]”Œ statistics”ah ]”h"]”Œ statistics”ah$]”h&]”uh1hµhh·h²hh³hÊh´K~ubh¶)”}”(hhh]”(h»)”}”(hŒHierarchical considerations”h]”hŒHierarchical considerations”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KŽubhÒ)”}”(hŒéThe interface enforces that an individual entity's bandwidth is always attainable, that is: max(c_i) <= C. However, over-subscription in the aggregate case is explicitly allowed to enable work-conserving semantics within a hierarchy:”h]”hŒëThe interface enforces that an individual entity’s bandwidth is always attainable, that is: max(c_i) <= C. However, over-subscription in the aggregate case is explicitly allowed to enable work-conserving semantics within a hierarchy:”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Khjh²hubj?)”}”(hŒe.g. \Sum (c_i) may exceed C ”h]”hÒ)”}”(hŒe.g. \Sum (c_i) may exceed C”h]”hŒe.g. Sum (c_i) may exceed C”…””}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K”hj0ubah}”(h]”h ]”h"]”h$]”h&]”uh1j>h³hÊh´K”hjh²hubhÒ)”}”(hŒ;[ Where C is the parent's bandwidth, and c_i its children ]”h]”hŒ=[ Where C is the parent’s bandwidth, and c_i its children ]”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K–hjh²hubhÒ)”}”(hŒ9There are two ways in which a group may become throttled:”h]”hŒ9There are two ways in which a group may become throttled:”…””}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K™hjh²hubj?)”}”(hŒka. it fully consumes its own quota within a period b. a parent's quota is fully consumed within its period ”h]”hŒenumerated_list”“”)”}”(hhh]”(j+)”}”(hŒ/it fully consumes its own quota within a period”h]”hÒ)”}”(hjoh]”hŒ/it fully consumes its own quota within a period”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K›hjmubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hjjubj+)”}”(hŒ5a parent's quota is fully consumed within its period ”h]”hÒ)”}”(hŒ4a parent's quota is fully consumed within its period”h]”hŒ6a parent’s quota is fully consumed within its period”…””}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kœhj„ubah}”(h]”h ]”h"]”h$]”h&]”uh1j*hjjubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œ loweralpha”Œprefix”hŒsuffix”Œ.”uh1jhhjdubah}”(h]”h ]”h"]”h$]”h&]”uh1j>h³hÊh´K›hjh²hubhÒ)”}”(hŒ…In case b) above, even though the child may have runtime remaining it will not be allowed to until the parent's runtime is refreshed.”h]”hŒ‡In case b) above, even though the child may have runtime remaining it will not be allowed to until the parent’s runtime is refreshed.”…””}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kžhjh²hubeh}”(h]”Œhierarchical-considerations”ah ]”h"]”Œhierarchical considerations”ah$]”h&]”uh1hµhh·h²hh³hÊh´KŽubh¶)”}”(hhh]”(h»)”}”(hŒCFS Bandwidth Quota Caveats”h]”hŒCFS Bandwidth Quota Caveats”…””}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÃh²hh³hÊh´K¢ubhÒ)”}”(hXCOnce a slice is assigned to a cpu it does not expire. However all but 1ms of the slice may be returned to the global pool if all threads on that cpu become unrunnable. This is configured at compile time by the min_cfs_rq_runtime variable. This is a performance tweak that helps prevent added contention on the global lock.”h]”hXCOnce a slice is assigned to a cpu it does not expire. However all but 1ms of the slice may be returned to the global pool if all threads on that cpu become unrunnable. This is configured at compile time by the min_cfs_rq_runtime variable. This is a performance tweak that helps prevent added contention on the global lock.”…””}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K£hjÃh²hubhÒ)”}”(hŒpThe fact that cpu-local slices do not expire results in some interesting corner cases that should be understood.”h]”hŒpThe fact that cpu-local slices do not expire results in some interesting corner cases that should be understood.”…””}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K©hjÃh²hubhÒ)”}”(hXvFor cgroup cpu constrained applications that are cpu limited this is a relatively moot point because they will naturally consume the entirety of their quota as well as the entirety of each cpu-local slice in each period. As a result it is expected that nr_periods roughly equal nr_throttled, and that cpuacct.usage will increase roughly equal to cfs_quota_us in each period.”h]”hXvFor cgroup cpu constrained applications that are cpu limited this is a relatively moot point because they will naturally consume the entirety of their quota as well as the entirety of each cpu-local slice in each period. As a result it is expected that nr_periods roughly equal nr_throttled, and that cpuacct.usage will increase roughly equal to cfs_quota_us in each period.”…””}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K¬hjÃh²hubhÒ)”}”(hX—For highly-threaded, non-cpu bound applications this non-expiration nuance allows applications to briefly burst past their quota limits by the amount of unused slice on each cpu that the task group is running on (typically at most 1ms per cpu or as defined by min_cfs_rq_runtime). This slight burst only applies if quota had been assigned to a cpu and then not fully used or returned in previous periods. This burst amount will not be transferred between cores. As a result, this mechanism still strictly limits the task group to quota average usage, albeit over a longer time window than a single period. This also limits the burst ability to no more than 1ms per cpu. This provides better more predictable user experience for highly threaded applications with small quota limits on high core count machines. It also eliminates the propensity to throttle these applications while simultaneously using less than quota amounts of cpu. Another way to say this, is that by allowing the unused portion of a slice to remain valid across periods we have decreased the possibility of wastefully expiring quota on cpu-local silos that don't need a full slice's amount of cpu time.”h]”hX›For highly-threaded, non-cpu bound applications this non-expiration nuance allows applications to briefly burst past their quota limits by the amount of unused slice on each cpu that the task group is running on (typically at most 1ms per cpu or as defined by min_cfs_rq_runtime). This slight burst only applies if quota had been assigned to a cpu and then not fully used or returned in previous periods. This burst amount will not be transferred between cores. As a result, this mechanism still strictly limits the task group to quota average usage, albeit over a longer time window than a single period. This also limits the burst ability to no more than 1ms per cpu. This provides better more predictable user experience for highly threaded applications with small quota limits on high core count machines. It also eliminates the propensity to throttle these applications while simultaneously using less than quota amounts of cpu. Another way to say this, is that by allowing the unused portion of a slice to remain valid across periods we have decreased the possibility of wastefully expiring quota on cpu-local silos that don’t need a full slice’s amount of cpu time.”…””}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K²hjÃh²hubhÒ)”}”(hXíThe interaction between cpu-bound and non-cpu-bound-interactive applications should also be considered, especially when single core usage hits 100%. If you gave each of these applications half of a cpu-core and they both got scheduled on the same CPU it is theoretically possible that the non-cpu bound application will use up to 1ms additional quota in some periods, thereby preventing the cpu-bound application from fully using its quota by that same amount. In these instances it will be up to the CFS algorithm (see sched-design-CFS.rst) to decide which application is chosen to run, as they will both be runnable and have remaining quota. This runtime discrepancy will be made up in the following periods when the interactive application idles.”h]”hXíThe interaction between cpu-bound and non-cpu-bound-interactive applications should also be considered, especially when single core usage hits 100%. If you gave each of these applications half of a cpu-core and they both got scheduled on the same CPU it is theoretically possible that the non-cpu bound application will use up to 1ms additional quota in some periods, thereby preventing the cpu-bound application from fully using its quota by that same amount. In these instances it will be up to the CFS algorithm (see sched-design-CFS.rst) to decide which application is chosen to run, as they will both be runnable and have remaining quota. This runtime discrepancy will be made up in the following periods when the interactive application idles.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÃhjÃh²hubeh}”(h]”Œcfs-bandwidth-quota-caveats”ah ]”h"]”Œcfs bandwidth quota caveats”ah$]”h&]”uh1hµhh·h²hh³hÊh´K¢ubh¶)”}”(hhh]”(h»)”}”(hŒExamples”h]”hŒExamples”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj"h²hh³hÊh´KÏubji)”}”(hhh]”(j+)”}”(hXLimit a group to 1 CPU worth of runtime:: If period is 250ms and quota is also 250ms, the group will get 1 CPU worth of runtime every 250ms. # echo 250000 > cpu.cfs_quota_us /* quota = 250ms */ # echo 250000 > cpu.cfs_period_us /* period = 250ms */ ”h]”(hÒ)”}”(hŒ)Limit a group to 1 CPU worth of runtime::”h]”hŒ(Limit a group to 1 CPU worth of runtime:”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÐhj6ubj )”}”(hŒÏIf period is 250ms and quota is also 250ms, the group will get 1 CPU worth of runtime every 250ms. # echo 250000 > cpu.cfs_quota_us /* quota = 250ms */ # echo 250000 > cpu.cfs_period_us /* period = 250ms */”h]”hŒÏIf period is 250ms and quota is also 250ms, the group will get 1 CPU worth of runtime every 250ms. # echo 250000 > cpu.cfs_quota_us /* quota = 250ms */ # echo 250000 > cpu.cfs_period_us /* period = 250ms */”…””}”hjHsbah}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1jŸh³hÊh´KÒhj6ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j*hj3h²hh³hÊh´Nubj+)”}”(hXXLimit a group to 2 CPUs worth of runtime on a multi-CPU machine With 500ms period and 1000ms quota, the group can get 2 CPUs worth of runtime every 500ms:: # echo 1000000 > cpu.cfs_quota_us /* quota = 1000ms */ # echo 500000 > cpu.cfs_period_us /* period = 500ms */ The larger period here allows for increased burst capacity. ”h]”(hÒ)”}”(hŒ?Limit a group to 2 CPUs worth of runtime on a multi-CPU machine”h]”hŒ?Limit a group to 2 CPUs worth of runtime on a multi-CPU machine”…””}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KØhj\ubhÒ)”}”(hŒ[With 500ms period and 1000ms quota, the group can get 2 CPUs worth of runtime every 500ms::”h]”hŒZWith 500ms period and 1000ms quota, the group can get 2 CPUs worth of runtime every 500ms:”…””}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÚhj\ubj )”}”(hŒª# echo 1000000 > cpu.cfs_quota_us /* quota = 1000ms */ # echo 500000 > cpu.cfs_period_us /* period = 500ms */ The larger period here allows for increased burst capacity.”h]”hŒª# echo 1000000 > cpu.cfs_quota_us /* quota = 1000ms */ # echo 500000 > cpu.cfs_period_us /* period = 500ms */ The larger period here allows for increased burst capacity.”…””}”hj|sbah}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1jŸh³hÊh´KÝhj\ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j*hj3h²hh³hÊh´Nubj+)”}”(hXCLimit a group to 20% of 1 CPU. With 50ms period, 10ms quota will be equivalent to 20% of 1 CPU:: # echo 10000 > cpu.cfs_quota_us /* quota = 10ms */ # echo 50000 > cpu.cfs_period_us /* period = 50ms */ By using a small period here we are ensuring a consistent latency response at the expense of burst capacity. ”h]”(hÒ)”}”(hŒLimit a group to 20% of 1 CPU.”h]”hŒLimit a group to 20% of 1 CPU.”…””}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KâhjubhÒ)”}”(hŒAWith 50ms period, 10ms quota will be equivalent to 20% of 1 CPU::”h]”hŒ@With 50ms period, 10ms quota will be equivalent to 20% of 1 CPU:”…””}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kähjubj )”}”(hŒg# echo 10000 > cpu.cfs_quota_us /* quota = 10ms */ # echo 50000 > cpu.cfs_period_us /* period = 50ms */”h]”hŒg# echo 10000 > cpu.cfs_quota_us /* quota = 10ms */ # echo 50000 > cpu.cfs_period_us /* period = 50ms */”…””}”hj°sbah}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1jŸh³hÊh´KæhjubhÒ)”}”(hŒlBy using a small period here we are ensuring a consistent latency response at the expense of burst capacity.”h]”hŒlBy using a small period here we are ensuring a consistent latency response at the expense of burst capacity.”…””}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kéhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j*hj3h²hh³hÊh´Nubj+)”}”(hXæLimit a group to 40% of 1 CPU, and allow accumulate up to 20% of 1 CPU additionally, in case accumulation has been done. With 50ms period, 20ms quota will be equivalent to 40% of 1 CPU. And 10ms burst will be equivalent to 20% of 1 CPU:: # echo 20000 > cpu.cfs_quota_us /* quota = 20ms */ # echo 50000 > cpu.cfs_period_us /* period = 50ms */ # echo 10000 > cpu.cfs_burst_us /* burst = 10ms */ Larger buffer setting (no larger than quota) allows greater burst capacity.”h]”(hÒ)”}”(hŒxLimit a group to 40% of 1 CPU, and allow accumulate up to 20% of 1 CPU additionally, in case accumulation has been done.”h]”hŒxLimit a group to 40% of 1 CPU, and allow accumulate up to 20% of 1 CPU additionally, in case accumulation has been done.”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KìhjÒubhÒ)”}”(hŒtWith 50ms period, 20ms quota will be equivalent to 40% of 1 CPU. And 10ms burst will be equivalent to 20% of 1 CPU::”h]”hŒsWith 50ms period, 20ms quota will be equivalent to 40% of 1 CPU. And 10ms burst will be equivalent to 20% of 1 CPU:”…””}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KïhjÒubj )”}”(hŒš# echo 20000 > cpu.cfs_quota_us /* quota = 20ms */ # echo 50000 > cpu.cfs_period_us /* period = 50ms */ # echo 10000 > cpu.cfs_burst_us /* burst = 10ms */”h]”hŒš# echo 20000 > cpu.cfs_quota_us /* quota = 20ms */ # echo 50000 > cpu.cfs_period_us /* period = 50ms */ # echo 10000 > cpu.cfs_burst_us /* burst = 10ms */”…””}”hjòsbah}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1jŸh³hÊh´KòhjÒubhÒ)”}”(hŒKLarger buffer setting (no larger than quota) allows greater burst capacity.”h]”hŒKLarger buffer setting (no larger than quota) allows greater burst capacity.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KöhjÒubeh}”(h]”h ]”h"]”h$]”h&]”uh1j*hj3h²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j¢Œarabic”j¤hj¥j¦uh1jhhj"h²hh³hÊh´KÐubeh}”(h]”Œexamples”ah ]”h"]”Œexamples”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÏubeh}”(h]”Œcfs-bandwidth-control”ah ]”h"]”Œcfs bandwidth control”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jNŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j(j%jÂj¿jüjùjMjJjj jÀj½jjj juŒ nametypes”}”(j(‰j‰jü‰jM‰j‰jÀ‰j‰j ‰uh}”(j%h·j¿jjùjÅjJjÿj jPj½jjjÃjj"uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.