WSL2-Linux-Kernel/drivers/cpuidle/governors
Rafael J. Wysocki 814b8797f9 cpuidle: menu: Avoid overflows when computing variance
The variance computation in get_typical_interval() may overflow if
the square of the value of diff exceeds the maximum for the int64_t
data type value which basically is the case when it is of the order
of UINT_MAX.

However, data points so far in the future don't matter for idle
state selection anyway, so change the initial threshold value in
get_typical_interval() to INT_MAX which will cause more "outlying"
data points to be discarded without affecting the selection result.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-03-07 10:54:22 +01:00
..
Makefile cpuidle: New timer events oriented governor for tickless systems 2019-01-16 23:07:30 +01:00
ladder.c cpuidle: Remove unnecessary wrapper cpuidle_get_last_residency() 2018-09-18 09:24:44 +02:00
menu.c cpuidle: menu: Avoid overflows when computing variance 2019-03-07 10:54:22 +01:00
teo.c cpuidle: New timer events oriented governor for tickless systems 2019-01-16 23:07:30 +01:00