cpufreq: interactive: Fix race when canceling timer at min freq
authorPeter Boonstoppel <pboonstoppel@nvidia.com>
Wed, 27 Mar 2013 17:29:34 +0000 (10:29 -0700)
committerMrutyunjay Sawant <msawant@nvidia.com>
Fri, 29 Mar 2013 08:04:40 +0000 (01:04 -0700)
commit8d4d538b03e50f98cd2871d7bd97f869f95f2549
tree0a4400d3882aaba8edaf1db5dac628f614372ae4
parente7aebb422442da581331b1c0edc42ccc44952742
cpufreq: interactive: Fix race when canceling timer at min freq

When target_freq reaches policy->min the governor calls del_timer()
upon entry to idle. However, it is possible for the timer handler to
still be running at this time, in which case it could rearm itself
such that the timer stays pending.

If we exit from idle before the next timer fires, the timer handler
will find idle_exit_time == 0 and will exit without rearming, from
this point on frequency will be stuck at the current level until we
enter idle again. This sometimes causes frequency to get stuck at
minimum, with cpu load at 100%, causing serious performance problems.

This patch replaces the del_timer() with del_timer_sync().

Bug: 1173466

(Issue no longer exists in upstream interactive governor)

Change-Id: Ic61194f2afb4ac041e18c7556e6ed4aee9c90303
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/213638
Reviewed-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-by: Yong Goo Yi <yyi@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
drivers/cpufreq/cpufreq_interactive.c