android_kernel_sony_sdm845/kernel/sched
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Juri Lelli e7fd5b1876 UPSTREAM: cpufreq: schedutil: use now as reference when aggregating shared policy requests
Currently, sugov_next_freq_shared() uses last_freq_update_time as a
reference to decide when to start considering CPU contributions as
stale.

However, since last_freq_update_time is set by the last CPU that issued
a frequency transition, this might cause problems in certain cases. In
practice, the detection of stale utilization values fails whenever the
CPU with such values was the last to update the policy. For example (and
please note again that the SCHED_CPUFREQ_RT flag is not the problem
here, but only the detection of after how much time that flag has to be
considered stale), suppose a policy with 2 CPUs:

               CPU0                |               CPU1
                                   |
                                   |     RT task scheduled
                                   |     SCHED_CPUFREQ_RT is set
                                   |     CPU1->last_update = now
                                   |     freq transition to max
                                   |     last_freq_update_time = now
                                   |

                        more than TICK_NSEC nsecs

                                   |
     a small CFS wakes up          |
     CPU0->last_update = now1      |
     delta_ns(CPU0) < TICK_NSEC*   |
     CPU0's util is considered     |
     delta_ns(CPU1) =              |
      last_freq_update_time -      |
      CPU1->last_update = 0        |
      < TICK_NSEC                  |
     CPU1 is still considered      |
     CPU1->SCHED_CPUFREQ_RT is set |
     we stay at max (until CPU1    |
     exits from idle)              |

* delta_ns is actually negative as now1 > last_freq_update_time

While last_freq_update_time is a sensible reference for rate limiting,
it doesn't seem to be useful for working around stale CPU states.

Fix the problem by always considering now (time) as the reference for
deciding when CPUs have stale contributions.

Bug: 109836581
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit d86ab9cff8b936aadde444d0e263a8db5ff0349b)
2018-06-22 15:45:45 +00:00
..
auto_group.c sched/autogroup: Fix 64-bit kernel nice level adjustment 2016-11-24 05:45:02 +01:00
auto_group.h sched, timer: Convert usages of ACCESS_ONCE() in the scheduler to READ_ONCE()/WRITE_ONCE() 2015-05-08 12:11:32 +02:00
clock.c sched/clock: Make local_clock()/cpu_clock() inline 2016-04-13 12:25:22 +02:00
completion.c
core.c This is the 4.9.94 stable release 2018-04-14 15:40:56 +02:00
cpuacct.c sched/cpuacct: Introduce cpuacct.usage_all to show all CPU stats together 2016-07-09 13:56:15 +02:00
cpuacct.h sched/cpuacct: Simplify the cpuacct code 2016-03-21 11:00:28 +01:00
cpudeadline.c sched/deadline: Split cpudl_set() into cpudl_set() and cpudl_clear() 2016-09-05 13:29:43 +02:00
cpudeadline.h sched/deadline: Split cpudl_set() into cpudl_set() and cpudl_clear() 2016-09-05 13:29:43 +02:00
cpufreq.c cpufreq / sched: Pass flags to cpufreq_update_util() 2016-08-16 22:14:55 +02:00
cpufreq_schedutil.c UPSTREAM: cpufreq: schedutil: use now as reference when aggregating shared policy requests 2018-06-22 15:45:45 +00:00
cpupri.c sched/core: Use tsk_cpus_allowed() instead of accessing ->cpus_allowed 2016-05-12 09:55:35 +02:00
cpupri.h
cputime.c ANDROID: cpufreq: track per-task time in state 2018-04-03 11:15:30 -07:00
deadline.c This is the 4.9.94 stable release 2018-04-14 15:40:56 +02:00
debug.c ANDROID: sched/fair: Add eas (& cas) specific rq, sd and task stats 2017-08-03 15:30:31 -07:00
energy.c ANDROID: sched: Support for extracting EAS energy costs from DT 2017-01-31 10:46:14 -08:00
fair.c ANDROID: sched/fair: cosmetics 2018-06-07 13:44:47 +00:00
features.h Merge remote-tracking branch 'android-4.9' into 'android-4.9-eas-dev' 2018-02-22 18:04:18 +00:00
idle.c ANDROID: sched, cpuidle: Track cpuidle state index in the scheduler 2017-01-31 10:46:19 -08:00
idle_task.c sched/core: Rewrite and improve select_idle_siblings() 2016-09-30 11:03:09 +02:00
loadavg.c sched/loadavg: Avoid loadavg spikes caused by delayed NO_HZ accounting 2017-07-05 14:40:28 +02:00
Makefile cpufreq: Drop schedfreq governor 2017-11-07 10:31:04 +05:30
rt.c This is the 4.9.104 stable release 2018-05-30 13:19:56 +02:00
sched.h ANDROID: sched/walt: Fix compilation issue for x86_64 2018-05-31 17:15:04 +00:00
stats.c ANDROID: schedstats/eas: guard properly to avoid breaking non-smp schedstats users 2017-08-03 15:30:41 -07:00
stats.h sched/debug: Rename 'schedstat_val()' -> 'schedstat_val_or_zero()' 2016-09-05 13:29:46 +02:00
stop_task.c ANDROID: sched: Introduce Window Assisted Load Tracking (WALT) 2017-01-31 10:46:58 -08:00
swait.c wait.[ch]: Introduce the simple waitqueue (swait) implementation 2016-02-25 11:27:16 +01:00
tune.c ANDROID: sched/tune: fix boost_group spin_lock re-initialization 2018-06-08 10:01:57 +00:00
tune.h ANDROID: sched/tune: Introducing a new schedtune attribute prefer_idle 2017-01-31 10:47:04 -08:00
wait.c mm: remove per-zone hashtable of bitlock waitqueues 2016-10-27 09:27:57 -07:00
walt.c ANDROID: sched/walt: Fix compilation issue for x86_64 2018-05-31 17:15:04 +00:00
walt.h ANDROID: sched/walt: Fix compilation issue for x86_64 2018-05-31 17:15:04 +00:00