forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commit2802bf3
sched/fair: Add over-utilization/tipping point indicator
Energy-aware scheduling is only meant to be active while the system is_not_ over-utilized. That is, there are spare cycles available to shifttasks around based on their actual utilization to get a moreenergy-efficient task distribution without depriving any tasks. Whenabove the tipping point task placement is done the traditional way basedon load_avg, spreading the tasks across as many cpus as possible basedon priority scaled load to preserve smp_nice. Below the tipping point wewant to use util_avg instead. We need to define a criteria for when wemake the switch.The util_avg for each cpu converges towards 100% regardless of how manyadditional tasks we may put on it. If we define over-utilized as:sum_{cpus}(rq.cfs.avg.util_avg) + margin > sum_{cpus}(rq.capacity)some individual cpus may be over-utilized running multiple tasks evenwhen the above condition is false. That should be okay as long as we tryto spread the tasks out to avoid per-cpu over-utilization as much aspossible and if all tasks have the _same_ priority. If the latter isn'ttrue, we have to consider priority to preserve smp_nice.For example, we could have n_cpus nice=-10 util_avg=55% tasks andn_cpus/2 nice=0 util_avg=60% tasks. Balancing based on util_avg we arelikely to end up with nice=-10 tasks sharing cpus and nice=0 tasksgetting their own as we 1.5*n_cpus tasks in total and 55%+55% is lessover-utilized than 55%+60% for those cpus that have to be shared. Thesystem utilization is only 85% of the system capacity, but we arebreaking smp_nice.To be sure not to break smp_nice, we have defined over-utilizationconservatively as when any cpu in the system is fully utilized at itshighest frequency instead:cpu_rq(any).cfs.avg.util_avg + margin > cpu_rq(any).capacityIOW, as soon as one cpu is (nearly) 100% utilized, we switch to load_avgto factor in priority to preserve smp_nice.With this definition, we can skip periodic load-balance as no cpu has analways-running task when the system is not over-utilized. All tasks willbe periodic and we can balance them at wake-up. This conservativecondition does however mean that some scenarios that could benefit fromenergy-aware decisions even if one cpu is fully utilized would not getthose benefits.For systems where some cpus might have reduced capacity on some cpus(RT-pressure and/or big.LITTLE), we want periodic load-balance checks assoon a just a single cpu is fully utilized as it might one of those withreduced capacity and in that case we want to migrate it.[ peterz: Added a comment explaining why new tasks are not accounted during overutilization detection. ]Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>Signed-off-by: Quentin Perret <quentin.perret@arm.com>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>Cc: Linus Torvalds <torvalds@linux-foundation.org>Cc: Mike Galbraith <efault@gmx.de>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Thomas Gleixner <tglx@linutronix.de>Cc: adharmap@codeaurora.orgCc: chris.redpath@arm.comCc: currojerez@riseup.netCc: dietmar.eggemann@arm.comCc: edubezval@gmail.comCc: gregkh@linuxfoundation.orgCc: javi.merino@kernel.orgCc: joel@joelfernandes.orgCc: juri.lelli@redhat.comCc: patrick.bellasi@arm.comCc: pkondeti@codeaurora.orgCc: rjw@rjwysocki.netCc: skannan@codeaurora.orgCc: smuckle@google.comCc: srinivas.pandruvada@linux.intel.comCc: thara.gopinath@linaro.orgCc: tkjos@google.comCc: valentin.schneider@arm.comCc: vincent.guittot@linaro.orgCc: viresh.kumar@linaro.orgLink:https://lkml.kernel.org/r/20181203095628.11858-13-quentin.perret@arm.comSigned-off-by: Ingo Molnar <mingo@kernel.org>1 parent630246a commit2802bf3
2 files changed
+61
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5082 | 5082 | | |
5083 | 5083 | | |
5084 | 5084 | | |
| 5085 | + | |
| 5086 | + | |
| 5087 | + | |
| 5088 | + | |
| 5089 | + | |
| 5090 | + | |
| 5091 | + | |
| 5092 | + | |
| 5093 | + | |
| 5094 | + | |
| 5095 | + | |
| 5096 | + | |
| 5097 | + | |
| 5098 | + | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
| 5102 | + | |
5085 | 5103 | | |
5086 | 5104 | | |
5087 | 5105 | | |
| |||
5139 | 5157 | | |
5140 | 5158 | | |
5141 | 5159 | | |
5142 | | - | |
| 5160 | + | |
5143 | 5161 | | |
| 5162 | + | |
| 5163 | + | |
| 5164 | + | |
| 5165 | + | |
| 5166 | + | |
| 5167 | + | |
| 5168 | + | |
| 5169 | + | |
| 5170 | + | |
| 5171 | + | |
| 5172 | + | |
| 5173 | + | |
| 5174 | + | |
| 5175 | + | |
| 5176 | + | |
| 5177 | + | |
| 5178 | + | |
| 5179 | + | |
5144 | 5180 | | |
5145 | 5181 | | |
5146 | 5182 | | |
| |||
7940 | 7976 | | |
7941 | 7977 | | |
7942 | 7978 | | |
| 7979 | + | |
| 7980 | + | |
| 7981 | + | |
7943 | 7982 | | |
7944 | 7983 | | |
7945 | 7984 | | |
| |||
8170 | 8209 | | |
8171 | 8210 | | |
8172 | 8211 | | |
| 8212 | + | |
| 8213 | + | |
8173 | 8214 | | |
8174 | | - | |
| 8215 | + | |
| 8216 | + | |
| 8217 | + | |
| 8218 | + | |
| 8219 | + | |
| 8220 | + | |
8175 | 8221 | | |
8176 | 8222 | | |
8177 | 8223 | | |
| |||
8398 | 8444 | | |
8399 | 8445 | | |
8400 | 8446 | | |
| 8447 | + | |
| 8448 | + | |
| 8449 | + | |
| 8450 | + | |
| 8451 | + | |
| 8452 | + | |
| 8453 | + | |
| 8454 | + | |
8401 | 8455 | | |
8402 | 8456 | | |
8403 | 8457 | | |
| |||
9798 | 9852 | | |
9799 | 9853 | | |
9800 | 9854 | | |
| 9855 | + | |
9801 | 9856 | | |
9802 | 9857 | | |
9803 | 9858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
| 721 | + | |
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
| |||
741 | 742 | | |
742 | 743 | | |
743 | 744 | | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
744 | 748 | | |
745 | 749 | | |
746 | 750 | | |
| |||
0 commit comments
Comments
(0)