mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-02 07:13:31 +01:00
cpuidle: teo: Simplify handling of total events count
Instead of computing the total events count from scratch every time, decay it and add a PULSE value to it in teo_update(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Christian Loehle <[email protected]> Tested-by: Aboorva Devarajan <[email protected]> Tested-by: Christian Loehle <[email protected]> Link: https://patch.msgid.link/[email protected]
This commit is contained in:
1 parent
13ed5c4a6d
commit
ddcfa79646
1 file changed
+1
-4
@@ -189,8 +189,6 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
cpu_data->total = 0;
|
||||
|
||||
/*
|
||||
* Decay the "hits" and "intercepts" metrics for all of the bins and
|
||||
* find the bins that the sleep length and the measured idle duration
|
||||
@@ -202,8 +200,6 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
bin->hits -= bin->hits >> DECAY_SHIFT;
|
||||
bin->intercepts -= bin->intercepts >> DECAY_SHIFT;
|
||||
|
||||
cpu_data->total += bin->hits + bin->intercepts;
|
||||
|
||||
target_residency_ns = drv->states[i].target_residency_ns;
|
||||
|
||||
if (target_residency_ns <= cpu_data->sleep_length_ns) {
|
||||
@@ -228,6 +224,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
cpu_data->tick_intercepts += PULSE;
|
||||
}
|
||||
|
||||
cpu_data->total -= cpu_data->total >> DECAY_SHIFT;
|
||||
cpu_data->total += PULSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user