Skip to content

CFS Bandwidth Control v7.1

Paul Turner lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 29 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17sched: (fixlet) dont update shares twice on on_rq parentkernel/sched_fair.c+3 -01 reply
2/17sched: hierarchical task accounting for SCHED_OTHERkernel/sched.c kernel/sched_fair.c kernel/sched_rt.c +1 more+16 -70 replies
3/17sched: introduce primitives to account for CFS bandwidth trackinginit/Kconfig kernel/sched.c kernel/sched_fair.c+219 -42 replies
4/17sched: validate CFS quota hierarchieskernel/sched.c+96 -130 replies
5/17sched: accumulate per-cfs_rq cpu usage and charge against bandwidthinclude/linux/sched.h kernel/sched.c kernel/sched_fair.c +1 more+84 -30 replies
6/17sched: add a timer to handle CFS bandwidth refreshkernel/sched.c kernel/sched_fair.c+124 -240 replies
7/17sched: expire invalid runtimekernel/sched.c kernel/sched_fair.c+82 -50 replies
8/17sched: add support for throttling group entitieskernel/sched.c kernel/sched_fair.c+92 -40 replies
9/17sched: add support for unthrottling group entitieskernel/sched.c kernel/sched_fair.c+127 -40 replies
10/17sched: allow for positional tg_tree walkskernel/sched.c+39 -130 replies
11/17sched: prevent interactions with throttled entitieskernel/sched.c kernel/sched_fair.c+94 -70 replies
12/17sched: prevent buddy interactions with throttled entitieskernel/sched_fair.c+17 -10 replies
13/17sched: migrate throttled tasks on HOTPLUGkernel/sched.c+27 -00 replies
14/17sched: throttle entities exceeding their allowed bandwidthkernel/sched_fair.c+49 -10 replies
15/17sched: add exports tracking cfs bandwidth control statisticskernel/sched.c kernel/sched_fair.c+28 -00 replies
16/17sched: return unused runtime on group dequeuekernel/sched.c kernel/sched_fair.c+119 -10 replies
17/17sched: add documentation for bandwidth controlDocumentation/scheduler/sched-bwc.txt+122 -00 replies

Reviews trailers per patch

10 of 17 patches have a Reviewed-by or Acked-by.

PatchHidetoshi Seto
1/17
2/17R-b
3/17R-b
4/17
5/17R-b
6/17R-b
7/17R-b
8/17
9/17R-b
10/17R-b
11/17R-b
12/17
13/17R-b
14/17
15/17R-b
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 00/17] CFS Bandwidth Control v7.1

Hi all,

Please find attached an incremental revision on v7 of bandwidth control.

The only real functional change is an improvement to update shares only as we leave a throttled state. The remainder is largely refactoring, expansion of comments, and code clean-up.

Hidetoshi Seto and Hu Tao have been kind enough to run performance benchmarks against v7 measuring the scheduling path overheads versus pipe-test-100k. Results can be found at:

https://lkml.org/lkml/2011/6/24/10
https://lkml.org/lkml/2011/7/4/347

The summary results (from Hu Tao's most recent run) are:
cycles instructions branches
-------------------------------------------------------------------------------------------------------------------

base                                        7,526,317,497           8,666,579,347            1,771,078,445
+patch, cgroup not enabled                  7,610,354,447 (1.12%)   8,569,448,982 (-1.12%)   1,751,675,193 (-0.11%)
+patch, 10000000000/1000(quota/period)      7,856,873,327 (4.39%)   8,822,227,540 (1.80%)    1,801,766,182 (1.73%)
+patch, 10000000000/10000(quota/period)     7,797,711,600 (3.61%)   8,754,747,746 (1.02%)    1,788,316,969 (0.97%)
+patch, 10000000000/100000(quota/period)    7,777,784,384 (3.34%)   8,744,979,688 (0.90%)    1,786,319,566 (0.86%)
+patch, 10000000000/1000000(quota/period)   7,802,382,802 (3.67%)   8,755,638,235 (1.03%)    1,788,601,070 (0.99%)

------------------------------------------------------------------------------------------------------------------

Thanks again for running these benchmarks!

Changes:

v7.1
-----------
- We now only explicitly update entity shares as their hierarchy leaves a throttled state. This simplifies shares interactions as all tg->shares logic can now be omitted within a throttled hierarchy. This should also improve the quality of balance observed within Kamalesh's nested cgroup test as we are able to do a bottom-up shares update on unthrottle.
- do_sched_cfs_period_timer() refactored to be linear/readable.
- We now force a period timer restart in tg_set_cfs_bandwidth (before a dramatic decrease in the period length could have induced a period of starvation while we waited for the previous timer to expire). Also avoid a spurious start/restart that existed in the quota == RUNTIME_INF case.
- The above removes the case of bandwidth changing within the period timer which helps with the do_sched_cfs_period_timer() clean-up.
- Fixed potential cfs_b lock nesting on __start_cfs_bandwidth() (In the case that we are racing with call-back startup and not tear-down).
- The load-balancer checks to ensure that we are not moving tasks between throttled hierarchies have been refactored and now check both the src and dest cfs_rqs.
- Buddy isolation cleaned up and moved to its own patch.
- Enabling of throttling deferred later within the series so that load-balancer and buddy protections exist (for stability in bisection).
- Documentation given a once-over for clarity and content.
- General code cleanup & comments improved

Hidetoshi, the following patchsets have changed enough to necessitate tweaking of your Reviewed-by:
[patch 09/18] sched: add support for unthrottling group entities (extensive) [patch 11/18] sched: prevent interactions with throttled entities (update_cfs_shares) [patch 12/18] sched: prevent buddy interactions with throttled entities (new)

Previous postings:
-----------------
v7: http://lkml.org/lkml/2011/6/21/43
v6: http://lkml.org/lkml/2011/5/7/37
v5: http://lkml.org/lkml/2011/3 /22/477
v4: http://lkml.org/lkml/2011/2/23/44
v3: http://lkml.org/lkml/2010/10/12/44
v2: http://lkml.org/lkml/2010/4/28/88
Original posting: http://lkml.org/lkml/2010/2/12/393
Prior approaches: http://lkml.org/lkml/2010/1/5/44 ["CFS Hard limits v5"]

Thanks,

- Paul