Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
cpufreq: add smartassV2 governor
Browse files Browse the repository at this point in the history
Ported to Huawei U8150 Froyo by Alan Orth <alan.orth@gmail.com>
  • Loading branch information
erasmux authored and alanorth committed Sep 2, 2011
1 parent 19bf763 commit 47904d4
Show file tree
Hide file tree
Showing 5 changed files with 921 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Documentation/cpu-freq/governors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Contents:
2.4 Ondemand
2.5 Conservative
2.6 Interactive
2.7 SmartassV2

3. The Governor Interface in the CPUfreq Core

Expand Down Expand Up @@ -206,6 +207,40 @@ more accurately determine the cpu workload and the best speed for that
workload. The default is 50ms.


2.7 SmartassV2
---------------

The CPUfreq governor "smartassV2", like other governors, aims to balance
performance vs battery life by using low frequencies when load is low and
ramping the frequency when necessary, fast enough to ensure responsiveness.

The implementation of the governor is roughtly based on the idea of interactive.
The idle loop is used to track when the CPU has idle cycles. The idle loop will
set a relatively high rate timer to sample the load when appropriate, the timer
will measure the load since it was set and schedule a work queue task to do the
actual frequency change when necessary.

The most important tunable is the "ideal" frequency: this governor will aim
for this frequency, in the sense that it will ramp towards this frequency much
more aggresively than beyond it - both when ramping up from below this frequency
and when ramping down from above this frequency. Still, note, that when load is
low enough the governor should choose the lowest available frequency regardless
of the ideal frequency and similarly when load is consistently high enough the
highest available frequency will be used.

Smartass also tracks the state of the screen, and when screen is off (a.k.a
sleep or suspended in the terms of this governor) a different ideal frequency
is used. This is the only difference between the screen on and screen off
states. Proper tuning of the awake_ideal_freq and sleep_ideal_freq should
allow both high responsiveness when screen is on and utilizing the low
frequency range when load is low, especially when screen is off.

Finally, smartass is a highly customizable governor with almost everything
tweakable through the sysfs. For a detailed explaination of each tunable,
please see the inline comments at the begging of the code (smartass2.c).



3. The Governor Interface in the CPUfreq Core
=============================================

Expand Down
14 changes: 14 additions & 0 deletions drivers/cpufreq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ config CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
governor. If unsure have a look at the help section of the
driver. Fallback governor will be the performance governor.

config CPU_FREQ_DEFAULT_GOV_SMARTASS2
bool "smartass2"
select CPU_FREQ_GOV_SMARTASS2
help
Use the CPUFreq governor 'smartassV2' as default.

config CPU_FREQ_DEFAULT_GOV_INTERACTIVE
bool "interactive"
select CPU_FREQ_GOV_INTERACTIVE
Expand Down Expand Up @@ -206,4 +212,12 @@ config CPU_FREQ_GOV_CONSERVATIVE

If in doubt, say N.

config CPU_FREQ_GOV_SMARTASS2
tristate "'smartassV2' cpufreq governor"
depends on CPU_FREQ
help
'smartassV2' - a "smart" optimized governor for the hero!

If in doubt, say N.

endif # CPU_FREQ
1 change: 1 addition & 0 deletions drivers/cpufreq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o
obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o
obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
obj-$(CONFIG_CPU_FREQ_GOV_SMARTASS2) += cpufreq_smartass2.o
obj-$(CONFIG_CPU_FREQ_GOV_INTERACTIVE) += cpufreq_interactive.o

# CPUfreq cross-arch helpers
Expand Down
Loading

0 comments on commit 47904d4

Please # to comment.