Commit a7b359f
sched/fair: Correctly insert cfs_rq's to list on unthrottle
Fix an issue where fairness is decreased since cfs_rq's can end up not
being decayed properly. For two sibling control groups with the same
priority, this can often lead to a load ratio of 99/1 (!!).
This happens because when a cfs_rq is throttled, all the descendant
cfs_rq's will be removed from the leaf list. When they initial cfs_rq
is unthrottled, it will currently only re add descendant cfs_rq's if
they have one or more entities enqueued. This is not a perfect
heuristic.
Instead, we insert all cfs_rq's that contain one or more enqueued
entities, or it its load is not completely decayed.
Can often lead to situations like this for equally weighted control
groups:
$ ps u -C stress
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 10009 88.8 0.0 3676 100 pts/1 R+ 11:04 0:13 stress --cpu 1
root 10023 3.0 0.0 3676 104 pts/1 R+ 11:04 0:00 stress --cpu 1
Fixes: 31bc6ae ("sched/fair: Optimize update_blocked_averages()")
[vingo: !SMP build fix]
Signed-off-by: Odin Ugedal <odin@uged.al>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20210612112815.61678-1-odin@uged.al1 parent 009c9aa commit a7b359f
1 file changed
Lines changed: 25 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3298 | 3298 | | |
3299 | 3299 | | |
3300 | 3300 | | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
3301 | 3319 | | |
3302 | 3320 | | |
3303 | 3321 | | |
| |||
4091 | 4109 | | |
4092 | 4110 | | |
4093 | 4111 | | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
4094 | 4117 | | |
4095 | 4118 | | |
4096 | 4119 | | |
| |||
4749 | 4772 | | |
4750 | 4773 | | |
4751 | 4774 | | |
4752 | | - | |
4753 | | - | |
| 4775 | + | |
| 4776 | + | |
4754 | 4777 | | |
4755 | 4778 | | |
4756 | 4779 | | |
| |||
7996 | 8019 | | |
7997 | 8020 | | |
7998 | 8021 | | |
7999 | | - | |
8000 | | - | |
8001 | | - | |
8002 | | - | |
8003 | | - | |
8004 | | - | |
8005 | | - | |
8006 | | - | |
8007 | | - | |
8008 | | - | |
8009 | | - | |
8010 | | - | |
8011 | | - | |
8012 | | - | |
8013 | | - | |
8014 | | - | |
8015 | | - | |
8016 | 8022 | | |
8017 | 8023 | | |
8018 | 8024 | | |
| |||
0 commit comments