Rework a CPU C-state selection logic a bit.
commit911afb96071041a61df2e12cdaa8916dbde80c96
authorHasso Tepper <hasso@estpak.ee>
Mon, 4 May 2009 08:45:16 +0000 (4 11:45 +0300)
committerHasso Tepper <hasso@estpak.ee>
Mon, 4 May 2009 08:50:57 +0000 (4 11:50 +0300)
tree38763ed1b46a971a8c4c86a1d187ffc17dbac3bc
parent9a9b8f25f3d9cba03eef5fb64a0df336a796167e
Rework a CPU C-state selection logic a bit.

Avoid comparing negative signed to positive unsignad values. It was
leading to a bug, when C-state does not decrease on sleep shorter then
declared transition latency. Fixing this deprecates workaround for broken
C-states on some hardware.

By the way, change state selecting logic a bit. Instead of last sleep
time use short-time average of it. Global interrupts rate in system is a
quite random value, to corellate subsequent sleeps so directly.

Obtained-from: FreeBSD
sys/dev/acpica5/acpi_cpu.c