diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-11-12 12:51:16 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-11-14 00:31:17 +0300 |
commit | b6495b7f004d01b9ecf9ed5fd31368241d3c5589 (patch) | |
tree | 5208fe669518fd05a4b761561e617902d4066e73 /drivers/cpuidle/governors | |
parent | c1d51f684c72b5eb2aecbbd47be3a2977a2dc903 (diff) | |
download | linux-b6495b7f004d01b9ecf9ed5fd31368241d3c5589.tar.xz |
cpuidle: teo: Exclude cpuidle overhead from computations
One purpose of the computations in teo_update() is to determine
whether or not the (saved) time till the next timer event and the
measured idle duration fall into the same "bin", so avoid using
values that include the cpuidle overhead to obtain the latter.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle/governors')
-rw-r--r-- | drivers/cpuidle/governors/teo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c index ecbcfaefb0cd..b33418f5df70 100644 --- a/drivers/cpuidle/governors/teo.c +++ b/drivers/cpuidle/governors/teo.c @@ -130,7 +130,14 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) } else { u64 lat_ns = drv->states[dev->last_state_idx].exit_latency_ns; - measured_ns = cpu_data->time_span_ns; + /* + * The computations below are to determine whether or not the + * (saved) time till the next timer event and the measured idle + * duration fall into the same "bin", so use last_residency_ns + * for that instead of time_span_ns which includes the cpuidle + * overhead. + */ + measured_ns = dev->last_residency_ns; /* * The delay between the wakeup and the first instruction * executed by the CPU is not likely to be worst-case every |