Hi,
With Android UI and benchmarks the latency of cpufreq response to
certain scheduling events can become very critical. Currently, callbacks
into schedutil are only made from the scheduler if the target CPU of the
event is the same as the current CPU. This means there are certain
situations where a target CPU may not run schedutil for some time.
One testcase to show this behavior is where a task starts running on
CPU0, then a new task is also spawned on CPU0 by a task on CPU1. If the
system is configured such that new tasks should receive maximum demand
initially, this should result in CPU0 increasing frequency immediately.
Because of the above mentioned limitation though this does not occur.
This is verified using ftrace with the sample [1] application.
Maybe the ideal solution is to always allow remote callbacks but that
has its own challenges:
o There is no protection required for single CPU per policy case today,
and adding any kind of locking there, to supply remote callbacks,
isn't really a good idea.
o If is local CPU isn't part of the same cpufreq policy as the target
CPU, then we wouldn't be able to do fast switching at all and have to
use some kind of bottom half to schedule work on the target CPU to do
real switching. That may be overkill as well.
And so this series only allows remote callbacks for target CPUs that
share the cpufreq policy with the local CPU.
This series is tested with couple of usecases (Android: hackbench,
recentfling, galleryfling, vellamo, Ubuntu: hackbench) on ARM hikey
board (64 bit octa-core, single policy). Only galleryfling showed minor
improvements, while others didn't had much deviation.
The reason being that this patchset only targets a corner case, where
following are required to be true to improve performance and that
doesn't happen too often with these tests:
- Task is migrated to another CPU.
- The task has maximum demand initially, and should take the CPU to
higher OPPs.
- And the target CPU doesn't call into schedutil until the next tick.
V2->V3:
- Rearranged/merged patches as suggested by Rafael (looks much better
now)
- Also handle new hook added to intel-pstate driver.
- The final code remains the same as V2, except for the above hook.
V1->V2:
- Don't support remote callbacks for unshared cpufreq policies.
- Don't support remote callbacks where local CPU isn't part of the
target CPU's cpufreq policy.
- Dropped dvfs_possible_from_any_cpu flag.
--
viresh
[1] http://pastebin.com/7LkMSRxE
Viresh Kumar (3):
sched: cpufreq: Allow remote cpufreq callbacks
cpufreq: schedutil: Process remote callback for shared policies
cpufreq: governor: Process remote callback for shared policies
drivers/cpufreq/cpufreq_governor.c | 4 ++++
drivers/cpufreq/intel_pstate.c | 8 ++++++++
include/linux/sched/cpufreq.h | 1 +
kernel/sched/cpufreq.c | 1 +
kernel/sched/cpufreq_schedutil.c | 19 ++++++++++++++-----
kernel/sched/deadline.c | 2 +-
kernel/sched/fair.c | 8 +++++---
kernel/sched/rt.c | 2 +-
kernel/sched/sched.h | 10 ++--------
9 files changed, 37 insertions(+), 18 deletions(-)
--
2.13.0.71.gd7076ec9c9cb
Hi,
I had some IRC discussions with Peter and V4 is based on his feedback.
Here is the diff between V3 and V4:
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index d64754fb912e..df9aa1ee53ff 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -79,6 +79,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
s64 delta_ns;
bool update;
+ /* Allow remote callbacks only on the CPUs sharing cpufreq policy */
+ if (!cpumask_test_cpu(smp_processor_id(), sg_policy->policy->cpus))
+ return false;
+
if (sg_policy->work_in_progress)
return false;
@@ -225,10 +229,6 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
unsigned int next_f;
bool busy;
- /* Remote callbacks aren't allowed for policies which aren't shared */
- if (smp_processor_id() != hook->cpu)
- return;
-
sugov_set_iowait_boost(sg_cpu, time, flags);
sg_cpu->last_update = time;
@@ -298,14 +298,9 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time,
{
struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util);
struct sugov_policy *sg_policy = sg_cpu->sg_policy;
- struct cpufreq_policy *policy = sg_policy->policy;
unsigned long util, max;
unsigned int next_f;
- /* Allow remote callbacks only on the CPUs sharing cpufreq policy */
- if (!cpumask_test_cpu(smp_processor_id(), policy->cpus))
- return;
-
sugov_get_util(&util, &max, hook->cpu);
raw_spin_lock(&sg_policy->update_lock);
-------------------------8<-------------------------
With Android UI and benchmarks the latency of cpufreq response to
certain scheduling events can become very critical. Currently, callbacks
into schedutil are only made from the scheduler if the target CPU of the
event is the same as the current CPU. This means there are certain
situations where a target CPU may not run schedutil for some time.
One testcase to show this behavior is where a task starts running on
CPU0, then a new task is also spawned on CPU0 by a task on CPU1. If the
system is configured such that new tasks should receive maximum demand
initially, this should result in CPU0 increasing frequency immediately.
Because of the above mentioned limitation though this does not occur.
This is verified using ftrace with the sample [1] application.
Maybe the ideal solution is to always allow remote callbacks but that
has its own challenges:
o There is no protection required for single CPU per policy case today,
and adding any kind of locking there, to supply remote callbacks,
isn't really a good idea.
o If is local CPU isn't part of the same cpufreq policy as the target
CPU, then we wouldn't be able to do fast switching at all and have to
use some kind of bottom half to schedule work on the target CPU to do
real switching. That may be overkill as well.
And so this series only allows remote callbacks for target CPUs that
share the cpufreq policy with the local CPU.
This series is tested with couple of usecases (Android: hackbench,
recentfling, galleryfling, vellamo, Ubuntu: hackbench) on ARM hikey
board (64 bit octa-core, single policy). Only galleryfling showed minor
improvements, while others didn't had much deviation.
The reason being that this patchset only targets a corner case, where
following are required to be true to improve performance and that
doesn't happen too often with these tests:
- Task is migrated to another CPU.
- The task has maximum demand initially, and should take the CPU to
higher OPPs.
- And the target CPU doesn't call into schedutil until the next tick.
V3->V4:
- Respect iowait boost flag and util updates for the all remote
callbacks.
- Minor updates in commit log of 2/3.
V2->V3:
- Rearranged/merged patches as suggested by Rafael (looks much better
now)
- Also handle new hook added to intel-pstate driver.
- The final code remains the same as V2, except for the above hook.
V1->V2:
- Don't support remote callbacks for unshared cpufreq policies.
- Don't support remote callbacks where local CPU isn't part of the
target CPU's cpufreq policy.
- Dropped dvfs_possible_from_any_cpu flag.
--
viresh
Viresh Kumar (3):
sched: cpufreq: Allow remote cpufreq callbacks
cpufreq: schedutil: Process remote callback for shared policies
cpufreq: governor: Process remote callback for shared policies
drivers/cpufreq/cpufreq_governor.c | 4 ++++
drivers/cpufreq/intel_pstate.c | 8 ++++++++
include/linux/sched/cpufreq.h | 1 +
kernel/sched/cpufreq.c | 1 +
kernel/sched/cpufreq_schedutil.c | 14 +++++++++-----
kernel/sched/deadline.c | 2 +-
kernel/sched/fair.c | 8 +++++---
kernel/sched/rt.c | 2 +-
kernel/sched/sched.h | 10 ++--------
9 files changed, 32 insertions(+), 18 deletions(-)
--
2.13.0.71.gd7076ec9c9cb
Thanks guys for all the great info! I will take another look and see what I
can do now that I have a better idea of how to go about it. Once again,
it's appreciated that you guys are working out in the open. I know many
others that are also keeping up with this mailing list. It has been a great
learning experience.
Kind Regards,
Zachariah Kennedy
Good day!
I have been following EAS development for sometime now. Currently, I have
implemented EAS in my own personal kernel for the Oneplus 3. It was largely
based on the work done for the pixel and I am happy to say that currently,
I have gotten better performance and battery life compared to stock CAF
with HMP.
These questions will be based on the ACK android-4.4 branch
My first question is regarding tunings for EAS. I have seen many different
values thrown around for awhile but I was curious about what everyone close
to the project is using for schedutil up/down_rate_limit. Currently the
stock values are 1000 (for up and down). Is this still the case for those
testing the newest EAS changes using schedutil?
Also what about stune? I know stock pixel is using 50 for
top-app\schedtune.boost for interactions but that turns out to be overkill
with schedutil.
Lastly, I had purchased the Oneplus 5 with the SD835 just so I can port EAS
to it as well. I am looking forward to testing how EAS scales with the
extra cores to work with when compared to the SD820/821. One main questions
regarding the SD835 is I wanted to see if anyone on the EAS-DEV list has
developed an energy model for the SD835 (MSM8998). Even if it is just
preliminary, I would appreciate any help with this. I do not have a proper
energy meter yet.
This is something I am truly interested in. I love the openness of all the
Devs close to this project. I have become a better developer having
participated and watching from the sidelines. Thanks guys for your hard
work.
Kind Regards,
Zachariah Kennedy
Hi,
Here is the second version of this series. The first [1] version was
sent several months back.
With Android UI and benchmarks the latency of cpufreq response to
certain scheduling events can become very critical. Currently, callbacks
into schedutil are only made from the scheduler if the target CPU of the
event is the same as the current CPU. This means there are certain
situations where a target CPU may not run schedutil for some time.
One testcase to show this behavior is where a task starts running on
CPU0, then a new task is also spawned on CPU0 by a task on CPU1. If the
system is configured such that new tasks should receive maximum demand
initially, this should result in CPU0 increasing frequency immediately.
Because of the above mentioned limitation though this does not occur.
This is verified using ftrace with the sample [2] application.
Maybe the ideal solution is to always allow remote callbacks but that
has its own challenges:
o There is no protection required for single CPU per policy case today,
and adding any kind of locking there, to supply remote callbacks,
isn't really a good idea.
o If is local CPU isn't part of the same cpufreq policy as the target
CPU, then we wouldn't be able to do fast switching at all and have to
use some kind of bottom half to schedule work on the target CPU to do
real switching. That may be overkill as well.
Taking above challenges into consideration, this version proposes a much
simpler diff as compared to the first version.
This series only allows remote callbacks for target CPUs that share the
cpufreq policy with the local CPU. Locking is mostly in place everywhere
and we wouldn't be required to change a lot of things.
This series is tested with couple of usecases (Android: hackbench,
recentfling, galleryfling, vellamo, Ubuntu: hackbench) on ARM hikey
board (64 bit octa-core, single policy). Only galleryfling showed minor
improvements, while others didn't had much deviation.
The reason being that this patchset only targets a corner case, where
following are required to be true to improve performance and that
doesn't happen too often with these tests:
- Task is migrated to another CPU.
- The task has maximum demand initially, and should take the CPU to
higher OPPs.
- And the target CPU doesn't call into schedutil until the next tick.
V1->V2:
- Don't support remote callbacks for unshared cpufreq policies.
- Don't support remote callbacks where local CPU isn't part of the
target CPU's cpufreq policy.
- Dropped dvfs_possible_from_any_cpu flag.
--
viresh
[1] https://marc.info/?l=linux-pm&m=148906015927796&w=2
[2] http://pastebin.com/7LkMSRxE
Steve Muckle (1):
intel_pstate: Ignore scheduler cpufreq callbacks on remote CPUs
Viresh Kumar (3):
cpufreq: schedutil: Process remote callback for shared policies
cpufreq: governor: Process remote callback for shared policies
sched: cpufreq: Enable remote sched cpufreq callbacks
drivers/cpufreq/cpufreq_governor.c | 4 ++++
drivers/cpufreq/intel_pstate.c | 3 +++
include/linux/sched/cpufreq.h | 1 +
kernel/sched/cpufreq.c | 1 +
kernel/sched/cpufreq_schedutil.c | 19 ++++++++++++++-----
kernel/sched/deadline.c | 2 +-
kernel/sched/fair.c | 8 +++++---
kernel/sched/rt.c | 2 +-
kernel/sched/sched.h | 10 ++--------
9 files changed, 32 insertions(+), 18 deletions(-)
--
2.13.0.71.gd7076ec9c9cb
### Basic Ideas ###
This patch set is rebased on EASv1.2 for power optimization on Hikey960.
The ARM big.LITTLE systems have many variants, some platforms use the
same CPU architecture for multi-clusters, every cluster has different
manufacture process (or clock design) so the clusters can have different
OPP settings; this kind system the 'LITTLE' core and 'big' core have the
same architecture but we can get power benefit from the 'LITTLE' core due
it has better power efficiency compared to 'big' core at the same OPP.
On the other hand, for this kind system, usually the 'LITTLE' core power
efficiency doesn't has huge difference compared to 'big' core's; and
furthermore the final CPU power saving percentage will discount twice,
so when optimize power for some scenarios, the optimization may not
significant as expected; or this means power optimization is not priority
issue on these platforms.
Regarding the CPU power discouting for whole system, the first discount
is related with CPU duty cycle, the second discount is related with
SoC/Board baseline power data. We can estimate the CPU power saving
percentage for system level with below formula:
CPU power saving percentage: CPU_PS%
CPU duty cycle: CPU_DC%
The percentage between CPU power and whole system: CPU_SYS%
So finally the estimated power saving percentage as below:
CPU_PS% * CPU_DC% * CPU_SYS%
Let's see one example, we have two CA53 clusters, the 'LITTLE' cluster can
improve 30% power efficiency than 'big' cluster, so CPU_PS% = 30%; the video
playback (1080p) has CPU duty cycle CPU_DC% = 30% (1 core); the ratio between
CPU power and system power is CPU_SYS% = 15%, so finally we can save power
by using 'LITTLE' compared to 'big' core:
CPU_PS% * CPU_DC% * CPU_SYS% = 30% * 30% * 15% = 1.35%
Naturally we consider 1.35% percentage is not a significant improvement; but
for some cases there have the concept for delta power; and if we compare it
with delta power can see the importantance for power saving. Let's use video
playback as example, the delta power percentage (DP%) is:
DP% = (video_playback_power - home_screen_power) / video_playback_power
So DP% is one important criteria for phone models to check some scenarios
compared to Android idle syste. If we think DP% = 15% and power saving
percentage 1.35%, then power saving with 1.35% is meaningful when we compare
1.35% vs 15%.
Another kind of big.LITTLE system has big different power efficiency, if we
review the power efficiency on Hikey960, we can see the coefficient (mw/MHz)
the worst case is the CA73 is 6.2 times than CA53, if we select the median
OPPs as reference we can see CA73 is 2.42 times than CA52. So the highest
CPU_PS%(max) = 86%, the median CPU_PS%(median) = 70%. Let's check upper case
we can save how much on Hikey960 in theory:
CPU_PS%(max) * CPU_DC% * CPU_SYS% = 86% * 30% * 15% = 3.87%
CPU_PS%(median) * CPU_DC% * CPU_SYS% = 70% * 30% * 15% = 3.15%
We can see power saving percentage 3.87%/3.15% is significant to DP% (15%).
So on Hikey960, if there have some scenarios with high CPU duty cycle and
sustainable power consuming, the power optimization is important for them.
### Implementations ###
Below are detailed implemenation for the optimizations:
a) Add back CPU selection based on power efficiency
EASv1.2 has function find_best_target(), this function mainly focus
on the idlest CPU so reduce the scheduling latency; but in some cases it
will miss to select the best power efficiency CPU.
So patch 0001/0002 are mainly to add back CPU selection based on power
efficiency; we still keep the function find_best_target() but it's only
used for "boost" and "prefer_idle" cases, and use power efficiency path
for normal cases.
b) EAS core algorithm optimization
For EAS core algorithm, it should resolve problems for below items:
1. Support more than two clusters;
2. Keep CPU to stay lowest OPP as possible, and pack small tasks
when system is idle;
3. Directly migrate waken task to best CPU to meet performance
requirement, this means the task could be migrated to higher
capacity CPU and vice versa;
4. Consistent result for energy calculation and simple implemenation;
Patch 0003/0004 change to select CPU with cluster basis; this means
scheduler firstly select candidate CPUs within every cluster, so every
cluster can has one candidate CPU or the cluster hasn't any one CPU can
meet the requirement. Finally all energy difference calculation happens
within these candidate CPUs. This gives us several benefit, the first
one is scheduler doesn't couple with previous CPU anymore; in the old
code it always compare energy between previous CPU and a new possible
CPU, but for some case the previous CPU is completely wrong CPU for the
task so the comparison is pointless actually. After applied patch 0003/
0004, it introduces one side effect: the task can be directly migrate
from lower capacity CPU to higher capacity CPU (LITTLE -> big), usually
this doesn't happen in old code, due the energy comparison the lower
capacity CPU can beat higher capacity CPU so the task is missed the
chance to migrate to higher capacity CPU.
Patch 0005/0006 are to select best CPU within cluster. In task waken
path, EAS core algorithm is responsible for task selection; it should
achieve two targets: keep CPU to stay lowest OPP as possible and spread
tasks if we can predict the OPP is possible to increased after place
waken task on one specific CPU. So patch 0003/0004 are to find the CPU
with lowest OPP and has highest utilization compared with other CPUs
with the same OPP, so we can rely on EAS core algorithm to spread tasks
if CPU OPP is increasing and pack tasks after CPU is decreased to
lowest OPP.
After applied patch 0003/0004, there introduced much more times energy
comparison between one big CPU and one little CPU. As result, it's
observed the EAS core algorithm is fragile for some corner cases. So
patch 0007/0008/0009 are for more robust energy calculation, especailly
0008/0009 patches introduce an extra signal for "util_waken_avg", by
using this signal we can remove waken task value for CPU's utilization,
so finally all CPU signals are cleaned by removing waken task stale
utilization value.
Patch 0010 is a significant change for EAS core algorithm, the main
idea is to change energy calculation from CPU oriented to task oriented.
Based on energy modeling we can easily anwser the question is: if place
the task onto one specific CPU, how much power is consumed by this task?
So essentially we can calculate the task consumed energy for specific
CPU, so can get to know the power consumption for every possible CPU
and finally filter out which CPU is best power saving one. After
changed to task oriented energy calculation, it's also more smooth to
generate perf idx and energy idx based on task oriented but not CPU
oriented so hope this also can benefit for schedTune PE filter as well.
c) Tipping point optimization
Power saving optimization mainly focus on how to defer the system
tipping point so energy aware path can be enabled for most case, but
deferring tipping point also means it hurts performance case if system
cannot over tipping point for overloaded scenarios (like benchmarks).
So the target is: optimize power without performance regression.
Patch 0011 is Thara's patch v1 "Per Sched domain over utilization",
the patch gives good method for how to store the per sched domain flag.
I tweaked it with below criterias for overutilization:
1. If single CPU is more than 80% util, then set lowest level sched
domain as 'overutilized'; so this is the tipping point for 'inner
overutilized' flag.
2. If any CPU has 'misfit' task or the cluster's overall util > 80% of
the cluster overall capacity, then set parent level sched doamin as
'overutilized', this is the tipping point for 'outer overutilized'
flag.
3. If overall util > 50% of the all CPU overall capacity, then set
root domain's 'overutilized' flag. The 50% actually is a quite high
bar, e.g. if there have two clusters that means the overall util >
the middle capacity for two clusters, also means the overall util
has totally beyond one cluster capacity so kick 'global' tipping
point and spread tasks cross two clusters.
So with 'per sched domain flag', we can defer the 'global' tipping point
and rely on it as a switch for energy aware path. Patch 0011 is to move
energy aware function to the beginning of waken path, so this give the
function energy_aware_wake_cpu() more chance to execute if system is
under tipping point; only when system is over tipping point then it will
go back to execute traditional waken balance to select idlest CPU.
### Testing result ###
On Hikey960, below is testing enviornment:
- Android AOSP kernel 4.4
https://android.googlesource.com/kernel/hikey-linaro
branch: android-hikey-linaro-4.4
- CPUFreq governor: sched-freq
- Fxied DDR: 400MHz
- Fixed GPU: 533MHz
- HDMI: unplugged
- WIFI: disabled
Please note, the video playback (1080p) is using software codec with VLC
player on Android, camera recording is use synthesized workload
camera-long.json to simulate the camera scenario.
Test_Case Referenced_Phone PELT_Optimized PELT_Optimized WALT_Optimized WALT_Optimized
(mW) [*] (mW) (Percentage) (mW) (Percentage)
homescreen 800 -5.05 [**] -0.63% -10.46 -1.31%
Audio(MP3) 200 (LCD OFF) 5.33 2.66% 60.62 30.31%
Video(1080p) 1000 133.09 13.31% 26.10 2.61%
Camera Recording 2000 163.94 8.20% -79.57 [***] -3.98%
[*] The reference phone is not any specific phone model, here I give
out some very roughly power data for well optimized commercial
phones. So this are only some data based on old experience and they
are not not very precise. These power data is based on power data
from the battery measurement point with 4.2v.
[**] Positive value: power reducing by this patch set
Negative value: power increasing by this patch set
[***] Camera Recording + WALT power data is much worse with this patch set;
Will explian in "conclusion" section.
Testing raw data: http://people.linaro.org/~leo.yan/eas_upstream/hikey960_result/
### Conclusion ###
Firstly Hikey960 is a good candidate platform to verify power saving
optimization :)
This patch set with PELT signal has good result on Hikey960, especially
for cases video playback (saving 133.09mW) and camera recording (saving
164.94mW). For audio playback, it can save 5.33mW; for homescreen it has
a bit regression (increased 5.05mW), suspect this related with task packing
on LITTLE core but need investigate for this.
This patch set with WALT signal has good result for audio playback and
video playback, but it's broken for camera recording case. After reviewed
the trace log, the main issue is many tasks' WALT signal can reach into
the range 100~200, so there have many comparision between LITTLE CPU
1844MHz and big CPU 903MHz. From the power modeling parameters, the big
CPU 903MHz has lower power efficiency than LITTLE CPU 1844MHz, so tasks
are migrated onto big core frequently. Compared to WALT signal, PELT signal
can co-work with power modeling parameters well, so we can see the energy
awaring algorithm can avoid task easily migration to big cores. (seems to me,
this is a question as: what's the signal can match for eas core algorithm?)
Some known issues:
- CPUFreq governor impacts power consumption much, sched-freq is easily
to reach 1844MHz. so need check if have mechanism to optimize the policy
to reduce the chance to set 1844MHz;
Another testing is to use other governors: schedutil, interactive.
- RT threads now are not energy awared, so they are migrated to big cores;
- Load balancing flow has no energy awared optimization;
- Now fixed DDR frequency, if enable DDR frequency change then power modeling
will be changed significant:
Need devfreq driver for DDR, and tune power modeling for this.
- Though these patches have been verified on Juno there have no harm for
performance, need do performance comprision on Hikey960.
Leo Yan (12):
sched/fair: add function find_nrg_efficient_target()
sched/fair: enable energy efficiency selection
sched/fair: use new function to select CPU from sched group
sched/fair: select candidate CPUs by cluster basis
sched/fair: refine find_new_capacity()
sched/fair: optimize CPU selection with lowest OPP
sched/fair: increase resolution for energy calculation
sched/fair: introduce signal util_waken_avg for CPU
sched/fair: select idle CPU as backup for waken up path
sched/fair: task oriented energy calculation
sched/fair: update idle CPU blocked load in update_sg_lb_stats()
sched/fair: add trace event for sched group energy
Thara Gopinath (1):
Per Sched domain over utilization
include/linux/sched.h | 2 +-
include/trace/events/sched.h | 45 ++++
kernel/sched/fair.c | 593 +++++++++++++++++++++++++++++++------------
kernel/sched/sched.h | 1 +
4 files changed, 484 insertions(+), 157 deletions(-)
mode change 100644 => 100755 include/trace/events/sched.h
mode change 100644 => 100755 kernel/sched/fair.c
--
1.9.1
Hello eas-dev, I wanted to give you all an update on EAS product codeline development for Android.
As you may have noticed, the Android Common Kernel branch android-4.4 (https://android.googlesource.com/kernel/common.git/+/android-4.4) now has the EAS product codeline merged. All the patches in there have been validated on a big.LITTLE device. Some of the more experimental patches which were part of the EASr1.2 stack did not make the cut yet, but we will continue to develop them.
All development for the Android Common Kernel will be done in the open so that interested people can see the code, pull the patches and participate in code reviews on the AOSP Gerrit. Development is expected to be continuous - we plan a number of enhancements and upstream backports over the coming months. The main focus for EAS development on the product codeline is to have a kernel which has good performance and efficiency on big.LITTLE devices running Android. As part of this we aim to reduce the delta to mainline as much as possible while of course maintaining any differences necessary for mobile devices.
EAS is intended to be an upstream technology eventually and as we upstream various components we will be backporting them to the product codeline where suitable.
We intend not only to push patches which we consider ready (for code review) but also more ‘experimental’ patches for things that we are working on, an example is here:
https://android-review.googlesource.com/#/c/411501/
This is a stack consisting of 11 patches. The first 6 patches make some changes to the performance index filtering in schedtune, and have a topic of 'fix_performance_index'. On top of those are 2 patches with a topic of 'small_optimizations' which are some optimizations which can be done to existing code. Finally there are 3 patches with a topic of 'experimental_utilest' which is a backport of the current mainline-focussed util_est solution.
Util_est is a filtered version of the existing PELT signals intended to address some of the generally acknowledged responsiveness issues PELT has when compared to WALT. There are multiple mainline ideas about making PELT more suitable for the uses we have, util_est is not the only one and may not be attractive to maintainers but it is included here to help evaluating the signal characteristics.
Where we have multiple patches which make sense to review together, we will send them as a single set and set the topics as appropriate. The review patch stacks will be structured as less controversial changes at the start, and more experimental/risky patches at the end - it's perfectly possible that some will be merged and not others.
As we push patches for review, we intend to post here announcing them.
Since we will now be doing continuous development in the open, the EAS releases (EASr1.3 etc.) become documentation points where we describe the features which are merged and are expected to be merged soon. The development model for android is to have frequent merges of the common kernel, and we feel this fits.
For EAS product codeline testing, we are starting to use Hikey960 as it has big.LITTLE (4xA73+4xA53). Note that we find it essential to add a heatsink and a fan, so firmware thermal capping doesn’t affect EAS performance. We’ve been using a 14mm x 14mm heatsink on the SoC:
http://uk.farnell.com/abl-heatsinks/bga-std-015/heat-sink-bga-standard-26-5…
with a 5v fan blowing on it. We are using Baylibre ACME for power measurement, which is supported in LISA (https://github.com/ARM-software/lisa) which we're using for development testing and trace analysis.
The current (21-June-2017) Hikey960 status is that cpufreq/cpuidle is working using the ARM Trusted Firmware. There is an open issue relating to OPP switch time on the little cluster which is being investigated. We are also engaged with Leo in validating the energy model.
For Android Common Kernel 4.9 (https://android.googlesource.com/kernel/common.git/+/android-4.9) we have a first pass of a patch stack bringing it up to parity with android-4.4 which is being tested on Juno and original hikey. This will be posted for review against the android-4.9 branch and is a change to the existing EAS code that’s there. The tests are passing on Juno, but please note there is significantly less testing than for kernel 4.4
We very much welcome broad participation in the future direction of EAS for products - to participate in EAS product codeline development, please ensure you are registered for a googlesource Gerrit userid which you can get at https://android.googlesource.com/new-password
Thanks,
Chris
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Hi,
This is based of the work done by Steve Muckle [1] before he left Linaro
and most of the patches are still under his authorship. I have done
couple of improvements (detailed in individual patches) and removed the
late callback support [2] as I wasn't sure of the value it adds. We can
include it separately if others feel it is required. This series is
based on pm/linux-next with patches [3] and [4] applied on top of it.
With Android UI and benchmarks the latency of cpufreq response to
certain scheduling events can become very critical. Currently, callbacks
into schedutil are only made from the scheduler if the target CPU of the
event is the same as the current CPU. This means there are certain
situations where a target CPU may not run schedutil for some time.
One testcase to show this behavior is where a task starts running on
CPU0, then a new task is also spawned on CPU0 by a task on CPU1. If the
system is configured such that new tasks should receive maximum demand
initially, this should result in CPU0 increasing frequency immediately.
Because of the above mentioned limitation though this does not occur.
This is verified using ftrace with the sample [5] application.
This patchset updates the scheduler to call cpufreq callbacks for remote
CPUs as well and updates schedutil governor to deal with it. An
additional flag is added to cpufreq policies to avoid sending IPIs to
remote CPUs to update the frequency, if CPUs on the platform can change
frequency of any other CPU.
This series is tested with couple of usecases (Android: hackbench,
recentfling, galleryfling, vellamo, Ubuntu: hackbench) on ARM hikey
board (64 bit octa-core, single policy). Only galleryfling showed minor
improvements, while others didn't had much deviation.
The reason being that this patchset only targets a corner case, where
following are required to be true to improve performance and that
doesn't happen too often with these tests:
- Task is migrated to another CPU.
- The task has maximum demand initially, and should take the CPU to
higher OPPs.
- And the target CPU doesn't call into schedutil until the next tick,
without this patchset.
--
viresh
[1] https://git.linaro.org/people/steve.muckle/kernel.git/log/?h=pmwg-integrati…
[2] https://git.linaro.org/people/steve.muckle/kernel.git/commit/?h=pmwg-integr…
[3] https://marc.info/?l=linux-kernel&m=148766093718487&w=2
[4] https://marc.info/?l=linux-kernel&m=148903231720432&w=2
[5] http://pastebin.com/7LkMSRxE
Steve Muckle (8):
sched: cpufreq: add cpu to update_util_data
irq_work: add irq_work_queue_on for !CONFIG_SMP
sched: cpufreq: extend irq work to support fast switches
sched: cpufreq: remove smp_processor_id() in remote paths
sched: cpufreq: detect, process remote callbacks
cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs
intel_pstate: ignore scheduler cpufreq callbacks on remote CPUs
sched: cpufreq: enable remote sched cpufreq callbacks
Viresh Kumar (1):
cpufreq: Add dvfs_possible_from_any_cpu policy flag
drivers/cpufreq/cpufreq-dt.c | 1 +
drivers/cpufreq/cpufreq_governor.c | 2 +-
drivers/cpufreq/intel_pstate.c | 3 ++
include/linux/cpufreq.h | 9 +++++
include/linux/irq_work.h | 7 ++++
include/linux/sched/cpufreq.h | 1 +
kernel/sched/cpufreq.c | 1 +
kernel/sched/cpufreq_schedutil.c | 80 +++++++++++++++++++++++++++++---------
kernel/sched/fair.c | 6 ++-
kernel/sched/sched.h | 3 +-
10 files changed, 90 insertions(+), 23 deletions(-)
--
2.7.1.410.g6faf27b
Hello,
Your item has arrived at Tue, 11 Apr 2017 05:22:31 +0200, but our courier
was not able to deliver the parcel.
Please check the attachment for details!
Thanks and best regards.
Yevette Mains - USPS Senior Operation Agent.
Hi,
we are only a week away from the OSPM-summit!
Pack your bags (or stay tuned for the live streaming).
Don't forget to subscribe to the summit mailing list to receive updates by
either following the instructions available at the following link
http://groups.google.com/group/ospm-summit-2017/boxsubscribe?email=<your_email>
or sending an email to ospm-summit-2017+subscribe(a)googlegroups.com
Archives are available at https://groups.google.com/forum/#!forum/ospm-summit-2017
More information about schedule and logistics follow.
---
Power Management and Scheduling in the Linux Kernel (OSPM-summit)
April 3-4, 2017
Scuola Superiore Sant'Anna (SSSA)
Pisa, Italy
http://retis.sssup.it/ospm-summit/
---
.:: FOCUS
Power management and scheduling techniques to reduce energy consumption while
meeting performance and latency requirements are receiving considerable
attention from the Linux Kernel development community.
The Power Management and Scheduling in the Linux Kernel (OSPM-summit) summit
aims at fostering further interest and discussion to happen.
.:: SCHEDULE
The summit is organized to cover two days of discussions and talks.
What follows is a tentative schedule, subject to last minute changes.
Find more info and real time updates on this shared document:
https://docs.google.com/spreadsheets/d/1B-IsUIGitvRa7ZzppEAJBMgGpIgRAAnu_Oh…
Monday (2017-04-03)
*******************
09:00AM - 09:30AM Welcome and Introduction (DAY 1)
---
09:30AM - 10:20AM Tooling/LISA
---
10:20AM - 11:10AM About The Need to Power Instrument The Linux Kernel
---
11:10AM - 11:20AM Break
---
11:20AM - 12:10AM What are the latest evolutions in PELT and what next
---
12:10AM - 01:00PM PELT decay clamping/UTIL_EST
---
01:00PM - 02:30PM Lunch
---
02:30PM - 03:20PM EAS where we are
---
03:20PM - 04:10PM Energy model/Exotic topologies
---
04:10PM - 04:20PM Break
---
04:20PM - 05:10PM Schedtune
---
05:10PM - 06:00PM SCHED_DEADLINE and reclaiming
Tuesday (2017-04-04)
********************
09:00AM - 09:30AM Welcome and Introduction (DAY 2)
---
09:30AM - 10:20AM Discussion about possible improvements in the schedutil governor
---
10:20AM - 11:10AM Schedutil for SCHED_DEADLINE
---
11:10AM - 11:20AM Break
---
11:20AM - 12:10AM Parameterizing CFS load balancing: nr_running/util/load
---
12:10AM - 01:00PM Tracepoints for PELT
---
01:00PM - 02:30PM Lunch
---
02:30PM - 03:20PM IRQ prediction
---
03:20PM - 04:10PM I/O scheduling and power management with storage devices
---
04:10PM - 04:20PM Break
---
04:20PM - 05:10PM SCHED_DEADLINE group scheduling
---
05:10PM - 06:00PM A Hierarchical Scheduling Model for Dynamic Soft-Realtime Systems
---
06:00PM - 06:30PM Closing Remarks
We are looking into setting up live streaming of the sessions. Details
will be soon shared through the shared doc mentioned above and the
event mailing list.
List of attendees is also available in the doc and on the event website.
.:: VENUE
The workshop will take place at ReTiS Lab*, Scuola Superiore Sant'Anna, Pisa,
Italy. Pisa is a small town, walking distance from the city center to the venue
is 20 minutes, walking distance from the airport to the city center is 30
minutes. More details are available from the summit web page:
http://retis.sssup.it/ospm-summit/
A map of the town with venue location, points of interest and
transportation information is available at:
https://drive.google.com/open?id=1ANKOXr2cuZkABXskDurgrGdl_js&usp=sharing
Bus from Airport to city centre takes about 10 min and costs 1.20 euros
(2 euros if bought on board). Large bills are usually not accepted.
Taxi from Airport to city centre costs 10/15 euros. Credit cards are not
accepted.
.:: ORGANIZERS (in alphabetical order)
Luca Abeni (SSSA)
Patrick Bellasi (ARM)
Tommaso Cucinotta (SSSA)
Dietmar Eggemann (ARM)
Sudeep Holla (ARM)
Juri Lelli (ARM)
Lorenzo Pieralisi (ARM)
Morten Rasmussen (ARM)