Skip to content

Commit b6495b7

Browse files
committed
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 <[email protected]>
1 parent c1d51f6 commit b6495b7

File tree

1 file changed

+8
-1
lines changed
  • drivers/cpuidle/governors

1 file changed

+8
-1
lines changed

drivers/cpuidle/governors/teo.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,14 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
130130
} else {
131131
u64 lat_ns = drv->states[dev->last_state_idx].exit_latency_ns;
132132

133-
measured_ns = cpu_data->time_span_ns;
133+
/*
134+
* The computations below are to determine whether or not the
135+
* (saved) time till the next timer event and the measured idle
136+
* duration fall into the same "bin", so use last_residency_ns
137+
* for that instead of time_span_ns which includes the cpuidle
138+
* overhead.
139+
*/
140+
measured_ns = dev->last_residency_ns;
134141
/*
135142
* The delay between the wakeup and the first instruction
136143
* executed by the CPU is not likely to be worst-case every

0 commit comments

Comments
 (0)