]> git.baikalelectronics.ru Git - kernel.git/commit
intel_pstate: Do not clear utilization update hooks on policy changes
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Jun 2016 21:47:15 +0000 (23:47 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Jun 2016 21:47:15 +0000 (23:47 +0200)
commit33ab6fa4f5f836dbd6cee0b071c5fea24d8c67f2
treea27fca471605ace51d24ee8a50619c9523e37250
parentdf5a8a9ace16d9351a8a97dd598e0b53b307b766
intel_pstate: Do not clear utilization update hooks on policy changes

intel_pstate_set_policy() is invoked by the cpufreq core during
driver initialization, on changes of policy attributes (minimim and
maximum frequency, for example) via sysfs and via CPU notifications
from the platform firmware.  On some platforms the latter may occur
relatively often.

Commit 4ada474ec15f (intel_pstate: Do not set utilization update hook
too early) made intel_pstate_set_policy() clear the CPU's utilization
update hook before updating the policy attributes for it (and set the
hook again after doind that), but that involves invoking
synchronize_sched() and adds overhead to the CPU notifications
mentioned above and to the sched-RCU handling in general.

That extra overhead is arguably not necessary, because updating
policy attributes when the CPU's utilization update hook is active
should not lead to any adverse effects, so drop the clearing of
the hook from intel_pstate_set_policy() and make it check if
the hook has been set already when attempting to set it.

Fixes: 4ada474ec15f (intel_pstate: Do not set utilization update hook too early)
Reported-by: Jisheng Zhang <jszhang@marvell.com>
Tested-by: Jisheng Zhang <jszhang@marvell.com>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c