Difference between revisions of "Application:Govnah"

From WebOS Internals
Jump to navigation Jump to search
m (→‎Purpose: Adding things that have been here forever.)
m (Fixed Current Version release typo from 2010 to 2011.)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Application]]
 
[[Category:Application]]
This page is currently available in two languages:
+
This page is currently available in these languages:
 
:[[Image:Australia.png]] [[Image:USA.png]] [[Application:Govnah]]
 
:[[Image:Australia.png]] [[Image:USA.png]] [[Application:Govnah]]
 
:[[Image:Germany.png]] [[Application:Govnah-DE]]
 
:[[Image:Germany.png]] [[Application:Govnah-DE]]
 
:[[Image:France.png]] [[Application:Govnah-FR]]
 
:[[Image:France.png]] [[Application:Govnah-FR]]
  
 +
<div style='position: relative;'>
 
{{application
 
{{application
 
|name=Govnah
 
|name=Govnah
 
|type=webOS
 
|type=webOS
|version=Version: 0.7.5 <br />(2010-10-22)
+
|version=Version: 1.0.0 <br />(2011-08-07)
 
|tag=Utilities
 
|tag=Utilities
 
|screenshot=GovnahHome4Life-0.6.1.png
 
|screenshot=GovnahHome4Life-0.6.1.png
|description=}}
+
|description=<div style='position: absolute; bottom: 0; right: 0; padding-right: 28px; padding-bottom: 16px'>{{GovnahDonation}}</div>
 +
}}
 +
</div>
  
 
<BR>
 
<BR>
=Summary=
+
==Summary==
 
[[image:Icon_WebOSInternals_Govnah.png|frameless|left]]
 
[[image:Icon_WebOSInternals_Govnah.png|frameless|left]]
 
Advanced webOS kernels provide mechanisms to control various operating parameters on the device such as clock speed.  These kernels expose one or more "governors" which can control those parameters. An example of such a kernel is the [[Application:UberKernel|UberKernel]].  This application is available through [[Preware]].
 
Advanced webOS kernels provide mechanisms to control various operating parameters on the device such as clock speed.  These kernels expose one or more "governors" which can control those parameters. An example of such a kernel is the [[Application:UberKernel|UberKernel]].  This application is available through [[Preware]].
Line 22: Line 25:
 
Govnah's UI provides access to:
 
Govnah's UI provides access to:
 
:* A real-time graph of CPU speed, CPU temperature, memory usage and system load  
 
:* A real-time graph of CPU speed, CPU temperature, memory usage and system load  
:* A mechanism for setting the parameters of the "governors" exposed by the kernel.
+
:* A mechanism for setting the parameters of the governors exposed by the various Linux kernels.
:* Ability to reduce/raise the amount of power parts of the device uses.
+
:* Ability to reduce/raise the amount of power parts of the device uses to reduce battery consumption.
:* Temperature range which lowers CPU frequency to cool down the device.
+
:* Temperature range which lowers/resets CPU frequency to cool down the device under heavy load.
 
:* Ability to slow down the CPU when battery is low.
 
:* Ability to slow down the CPU when battery is low.
 
:* The amount of swap that can be compressed (compcache).
 
:* The amount of swap that can be compressed (compcache).
:* The IO schedulers.
+
:* The enabled Linux IO schedulers.
:* The TCP Congestion algorithms.
+
:* The enabled Linux TCP Congestion algorithms.
  
===Real World Examples===
+
<BR>
 
 
The Uber-Kernel exposes a governor called ''on-demand''.  The on-demand governor increases and decreases clock speed based on the percentage of CPU usage.
 
 
 
The ''on-demand'' governor exposes the following parameters which can be set by Govnah:
 
:* scaling_max_freq - Set the maximum frequency your CPU is allowed to scale to.
 
:* scaling_min_freq - Same as scaling_max_freq but setting a minimum value.
 
:* sampling_rate - How often you want the kernel to look at the CPU usage (in microseconds) Typically this is set to values of 10000 or more.
 
:* up_threshold - This defines what the average CPU usage percentage increase between samplings for the kernel to decide to increase the CPU frequency.
 
:* ignore_nice_load - If '0' (its default), all processes are counted towards the 'cpu utilization' value. When set to '1', the processes that are run with a 'nice' value will not count (and thus be ignored) in the overall usage calculation.
 
:* powersave_bias - This modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. The bias is in tenths of a percent (0 to 1000).  A setting of 100 will result in a 10% smaller increase in CPU speed for a given usage than a setting of 0 would result in. 
 
  
 +
==Installation==
 +
The following guide assumes a Palm Pre/Pre+/Pre2/Veer/TouchPad is currently running Palm's stock kernel with no over-clocking patches.
  
Each "Governor" in the kernel tells ''Govnah'' what parameters it has that may be set and may also say what the limits of those parameters are.
+
#On Preware's home screen, type "Govnah" and hit enter.
 
+
#Select "Govnah" and "Install".
 +
#If you have not yet installed a replacement "Kernel", on Preware's home screen, type "uber" and hit enter.
 +
#Select "[[Application:UberKernel|UberKernel]]" and "Install".
 +
#Restart your phone as prompted.
  
===Current Governors===
 
  
Current governors available in the Uber-Kernel and supported by Govnah include:  
+
Note:
:* On-demand - described above, increases clock speed in response to increases in CPU load.  
+
See the [http://www.webos-internals.org/wiki/Application:UberKernel the UberKernel page] for further information on its abilities and use.
:* Conservative - The opposite of on-demand conservative decreases CPU clock speed in response to decreases in CPU load.  
 
:* Userspace - sets the CPU speed to a defined rate as chosen by LunaSysMgr
 
:* powersave - sets the CPU speed to the min frequency value
 
:* performance - sets the CPU speed to the max frequency value
 
:* screenstate - runs at a higher speed when the screen is on and at 500MHz when the screen is off
 
  
 
<BR>
 
<BR>
  
=Installation=
+
==Brief Usage==
The following guide assumes a Palm Pre/Pre+ that has the original 1.4.1.1 kernel and no over-clocking patches.
 
 
 
#On Preware's home screen, type "Gov" and hit enter.
 
#Select "Govnah" and "Install"
 
#If you have not yet installed a "Kernel", on Preware's home screen, type "uber" and hit enter.
 
#Select "[[Application:UberKernel|UberKernel (Palm Pre/Pre+)]]" and "Install"
 
#Restart your phone as promted
 
 
 
<BR>
 
=Brief Usage=
 
 
===Where To Start===
 
===Where To Start===
 
{| Width="61%" VAlign="top"
 
{| Width="61%" VAlign="top"
Line 119: Line 101:
 
<BR>
 
<BR>
  
=Governors In-Depth=
+
==Troubleshooting/FAQs==
* Generic items (needed for all)
+
==="Unknown" Profile===
** scaling_max_freq - Set the maximum frequency your CPU(s) are allowed to scale to. Look at the output from scaling_available_frequencies
+
*With webOS 2.1, HP as implemented a 10M compcache natively.  This causes a problem with Govnah's abilty to assign your compcache value before the webOS's upstart scripts does which will cacue Govnah to display "Unknown" as a profile name.  To remedy:
** scaling_min_freq - Same as scaling_max_freq but setting a value that will not allow the CPU(s) to go below.
+
#Save your profile with the stock 10M compcache.
 +
#You need to edit /etc/event.d/compcache to reflect your setting.
 +
:*The number is your target size in K. For a 14M compcache: 14 * 1024 = 14336.
 +
:*Reboot your phone.
  
* ondemand
 
** sampling_rate - This is measured in microseconds (one millionth of a second). This is how often you want the kernel to look at the CPU usage and to make decisions on what to do about the frequency. Typically this is set to values of around '10000' or more. If you wanted to set the sampling rate to 1 second you would set it to 1000000 like in the following example.
 
** sampling_rate_(min|max) - This is minimum and maximum sampling rates available that you may set 'sampling_rate' to. I believe in microseconds also.
 
** sampling_down_factor: this parameter controls the rate that the CPU makes a decision on when to decrease the frequency. When set to its default value of '5' it means that at 1/5 the sampling_rate the kernel makes a decision to lower the frequency. Five "lower rate" decisions have to be made in a row before the CPU frequency is actually lower. If set to '1' then the frequency decreases as quickly as it increases, if set to '2' it decreases at half the rate of the increase.
 
** up_threshold - This defines what the average CPU usage between the samplings of 'sampling_rate' needs to be for the kernel to make a decision on whether or not it should increase the frequency. For example when it is set to its default value of '80' it means that between the checking intervals the CPU needs to be on average more than 80% in use to then decide that the CPU frequency needs to be increased.
 
** ignore_nice_load - This parameter takes a value of '0' or '1'. When set to '0' (its default), all processes are counted towards the 'cpu utilization' value. When set to '1', the processes that are run with a 'nice' value will not count (and thus be ignored) in the overall usage calculation.
 
** powersave_bias - This modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. By default, (powersave_bias  = 0), the ondemand governor selects the minimum processor frequency that can still complete a workload with minimal idle time. Doing so should result in the highest performance to power efficiency ratio. In some cases, you might prefer a greater emphasis on power efficiency than performance. In this case, set the powersave_bias parameter to a value between 1 and 1000 to reduce the target frequency by one-thousandth of that value. For example, set powersave_bias to 100 for a one-tenth reduction in target frequency. In this case, if the governor chooses a target frequency of 2 GHz (with powersave_bias  = 100), the governor instead will request 1.8GHz – a one-tenth reduction. If 1.8 GHz is an exact match with an available hardware frequency (listed in the scaling_available_freq parameter), the processor is set to this frequency. If 1.8 GHz is not available, the processor fluctuates between the closest available upper and lower frequencies for an average frequency of 1.8 GHz. (from IBM web page). The original author of the ondemand powersave_bias code explains it as "For example, If ondemand requests 2.0GHz based on utilization, and powersave_bias=100, this code will knock 10% off the target and seek a target of 1.8GHz instead of 2.0GHz until the next sampling. If 1.8 is an exact match with an hardware frequency we use it, otherwise we average our time between the frequency next higher than 1.8 and next lower than 1.8" (from http://osdir.com/ml/kernel.cpufreq/2006-07/msg00114.html ) - the key word appears to be "average". The author also warns "In practice, users will not be able to detect a difference between 0.1% increments, but 1.0% increments turned out to be too large. Also, the max value of 1000 (100%) would simply peg the system in its deepest power saving P-state, unless the processor really has a hardware P-state at 0Hz".
 
  
* conservative
+
<BR>
** freq_step - This describes what percentage steps the CPU freq should be increased and decreased smoothly by. By default the CPU frequency will increase in 5% chunks of your maximum CPU frequency. You can change this value to anywhere between 0 and 100 where '0' will effectively lock your CPU at a speed regardless of its load whilst '100' will, in theory, make it behave identically to the "ondemand" governor.
 
** down_threshold - This is same as the 'up_threshold' found for the "ondemand" governor but for the opposite direction. For example when set to its default value of '20' it means that if the CPU usage needs to be below 20% between samples to have the frequency decreased.
 
** sampling_rate - same as ondemand.
 
** sampling_rate_(min|max) - same as ondemand.
 
** up_threshold - same as ondemand.
 
** ignore_nice_load - same as ondemand.
 
  
* userspace
+
==Governors In-Depth==
** scaling_setspeed - one of the values from scaling_available_frequencies
+
===Real World Examples===
** NB - when userspace is selected LunaSysMgr will change the frequency as it feels.
 
  
* powersave
+
The Uber-Kernel exposes a governor called ''on-demand''.  The on-demand governor increases and decreases clock speed based on the percentage of CPU usage.
** Nothing special
 
  
* performance
+
The ''on-demand'' governor exposes the following parameters which can be set by Govnah:
** Nothing special
+
:* scaling_max_freq - Set the maximum frequency your CPU is allowed to scale to.
 +
:* scaling_min_freq - Same as scaling_max_freq but setting a minimum value.
 +
:* sampling_rate - How often you want the kernel to look at the CPU usage (in microseconds) Typically this is set to values of 10000 or more.
 +
:* up_threshold - This defines what the average CPU usage percentage increase between samplings for the kernel to decide to increase the CPU frequency.
 +
:* ignore_nice_load - If '0' (its default), all processes are counted towards the 'cpu utilization' value. When set to '1', the processes that are run with a 'nice' value will not count (and thus be ignored) in the overall usage calculation.
 +
:* powersave_bias - This modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. The bias is in tenths of a percent (0 to 1000).  A setting of 100 will result in a 10% smaller increase in CPU speed for a given usage than a setting of 0 would result in. 
  
* screenstate
 
** Nothing special
 
  
 +
Each "Governor" in the kernel tells ''Govnah'' what parameters it has that may be set and may also say what the limits of those parameters are. 
  
=Developer Notes=
+
<BR>
 +
 
 +
===Standard Linux Governors===
 +
====Generic Items (all)====
 +
* <u>scaling_max_freq</u>: Set the maximum frequency your CPU(s) are allowed to scale to. Look at the output from scaling_available_frequencies
 +
* <u>scaling_min_freq</u>: Same as scaling_max_freq but setting a value that will not allow the CPU(s) to go below.
 +
 
 +
====ondemand====
 +
* <u>sampling_rate</u>: This is measured in microseconds (one millionth of a second). This is how often you want the kernel to look at the CPU usage and to make decisions on what to do about the frequency. Typically this is set to values of around '10000' or more. If you wanted to set the sampling rate to 1 second you would set it to 1000000 like in the following example.
 +
* <u>sampling_rate_(min|max)</u>: This is minimum and maximum sampling rates available that you may set 'sampling_rate' to. I believe in microseconds also.
 +
* <u>sampling_down_factor</u>: this parameter controls the rate that the CPU makes a decision on when to decrease the frequency. When set to its default value of '5' it means that at 1/5 the sampling_rate the kernel makes a decision to lower the frequency. Five "lower rate" decisions have to be made in a row before the CPU frequency is actually lower. If set to '1' then the frequency decreases as quickly as it increases, if set to '2' it decreases at half the rate of the increase.
 +
* <u>up_threshold</u>: This defines what the average CPU usage between the samplings of 'sampling_rate' needs to be for the kernel to make a decision on whether or not it should increase the frequency. For example when it is set to its default value of '80' it means that between the checking intervals the CPU needs to be on average more than 80% in use to then decide that the CPU frequency needs to be increased.
 +
* <u>ignore_nice_load</u>: This parameter takes a value of '0' or '1'. When set to '0' (its default), all processes are counted towards the 'cpu utilization' value. When set to '1', the processes that are run with a 'nice' value will not count (and thus be ignored) in the overall usage calculation.
 +
* <u>powersave_bias</u>: This modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. By default, (powersave_bias  = 0), the ondemand governor selects the minimum processor frequency that can still complete a workload with minimal idle time. Doing so should result in the highest performance to power efficiency ratio. In some cases, you might prefer a greater emphasis on power efficiency than performance. In this case, set the powersave_bias parameter to a value between 1 and 1000 to reduce the target frequency by one-thousandth of that value. For example, set powersave_bias to 100 for a one-tenth reduction in target frequency. In this case, if the governor chooses a target frequency of 2 GHz (with powersave_bias  = 100), the governor instead will request 1.8GHz – a one-tenth reduction. If 1.8 GHz is an exact match with an available hardware frequency (listed in the scaling_available_freq parameter), the processor is set to this frequency. If 1.8 GHz is not available, the processor fluctuates between the closest available upper and lower frequencies for an average frequency of 1.8 GHz. (from IBM web page). The original author of the ondemand powersave_bias code explains it as "For example, If ondemand requests 2.0GHz based on utilization, and powersave_bias=100, this code will knock 10% off the target and seek a target of 1.8GHz instead of 2.0GHz until the next sampling. If 1.8 is an exact match with an hardware frequency we use it, otherwise we average our time between the frequency next higher than 1.8 and next lower than 1.8" (from http://osdir.com/ml/kernel.cpufreq/2006-07/msg00114.html ) - the key word appears to be "average". The author also warns "In practice, users will not be able to detect a difference between 0.1% increments, but 1.0% increments turned out to be too large. Also, the max value of 1000 (100%) would simply peg the system in its deepest power saving P-state, unless the processor really has a hardware P-state at 0Hz".
 +
 
 +
====conservative====
 +
* <u>freq_step</u>: This describes what percentage steps the CPU freq should be increased and decreased smoothly by. By default the CPU frequency will increase in 5% chunks of your maximum CPU frequency. You can change this value to anywhere between 0 and 100 where '0' will effectively lock your CPU at a speed regardless of its load whilst '100' will, in theory, make it behave identically to the "ondemand" governor.
 +
* <u>down_threshold</u>: This is same as the 'up_threshold' found for the "ondemand" governor but for the opposite direction. For example when set to its default value of '20' it means that if the CPU usage needs to be below 20% between samples to have the frequency decreased.
 +
* <u>sampling_rate</u>: same as ondemand.
 +
* <u>sampling_rate_(min|max)</u>: same as ondemand.
 +
* <u>up_threshold</u>: same as ondemand.
 +
* <u>ignore_nice_load</u>: same as ondemand.
 +
 
 +
====userspace====
 +
* <u>scaling_setspeed</u>: one of the values from scaling_available_frequencies
 +
* <u>NB</u>: when userspace is selected LunaSysMgr will change the frequency as it feels.
 +
 
 +
====powersave====
 +
* Nothing special
 +
 
 +
====performance====
 +
* Nothing special
 +
 
 +
====screenstate====
 +
* Nothing special
 +
 
 +
 
 +
==Developer Notes==
 
===Relaunching for Cross-App Integration===
 
===Relaunching for Cross-App Integration===
 
There are 2 different launch params. One to get a list of profiles returned to your app, and one to apply a profile to the phone. This was implemented in v0.3.1.
 
There are 2 different launch params. One to get a list of profiles returned to your app, and one to apply a profile to the phone. This was implemented in v0.3.1.
  
 
===Profile List===
 
===Profile List===
The code below is how you would launch govnah and tell it to return a list of profiles to your app:
+
The code below is how you would launch Govnah and tell it to return a list of profiles to your app:
 
<pre><nowiki>
 
<pre><nowiki>
 
this.controller.serviceRequest
 
this.controller.serviceRequest
Line 201: Line 212:
  
 
===Profile Apply===
 
===Profile Apply===
The code below is how you use the list of profiles you received in the prior relaunch to have govnah apply a profile.
+
The code below is how you use the list of profiles you received in the prior relaunch to have Govnah apply a profile.
 
<pre><nowiki>
 
<pre><nowiki>
 
this.controller.serviceRequest
 
this.controller.serviceRequest
Line 220: Line 231:
 
);
 
);
 
</nowiki></pre>
 
</nowiki></pre>
Replace 'profileid' parameters value with the profile id you wish govnah to apply. Note that 'profilename' is also an accepted parameter. This launch will not relaunch your app, it will simply apply if the profileid/name you requested actually exists. (And will just ignore your request if it doesn't.)
+
Replace 'profileid' parameters value with the profile id you wish Govnah to apply. Note that 'profilename' is also an accepted parameter. This launch will not relaunch your app, it will simply apply if the profileid/name you requested actually exists. (And will just ignore your request if it doesn't.)
 +
 
 +
 
 +
== Resources ==
 +
 
 +
===== Support Development =====
 +
<blockquote>
 +
{{GovnahDonation}}
 +
<br />
 +
</blockquote>
 +
 
 +
===== Official Forum =====
 +
<blockquote>
 +
* [http://forums.precentral.net/webos-internals/244701-govnah.html Official PreCentral Forum Thread]
 +
</blockquote>
 +
 
 +
===== Bug Reporting =====
 +
<blockquote>
 +
* [http://redmine.webos-internals.org/projects/govnah Official Bug Reporting Site]
 +
:''Registration on the site is required to submit bug reports.''
 +
</blockquote>
  
 +
===== Feature Requests =====
 +
<blockquote>
 +
* [http://redmine.webos-internals.org/projects/govnah Official Feature Requests Site]
 +
:''Registration on the site is required to submit feature requests.''
 +
</blockquote>
  
  

Latest revision as of 21:40, 7 August 2011

This page is currently available in these languages:

Australia.png USA.png Application:Govnah
Germany.png Application:Govnah-DE
France.png Application:Govnah-FR
GovnahHome4Life-0.6.1.png


Summary

Icon WebOSInternals Govnah.png

Advanced webOS kernels provide mechanisms to control various operating parameters on the device such as clock speed. These kernels expose one or more "governors" which can control those parameters. An example of such a kernel is the UberKernel. This application is available through Preware.


Purpose

Govnah's UI provides access to:

  • A real-time graph of CPU speed, CPU temperature, memory usage and system load
  • A mechanism for setting the parameters of the governors exposed by the various Linux kernels.
  • Ability to reduce/raise the amount of power parts of the device uses to reduce battery consumption.
  • Temperature range which lowers/resets CPU frequency to cool down the device under heavy load.
  • Ability to slow down the CPU when battery is low.
  • The amount of swap that can be compressed (compcache).
  • The enabled Linux IO schedulers.
  • The enabled Linux TCP Congestion algorithms.


Installation

The following guide assumes a Palm Pre/Pre+/Pre2/Veer/TouchPad is currently running Palm's stock kernel with no over-clocking patches.

  1. On Preware's home screen, type "Govnah" and hit enter.
  2. Select "Govnah" and "Install".
  3. If you have not yet installed a replacement "Kernel", on Preware's home screen, type "uber" and hit enter.
  4. Select "UberKernel" and "Install".
  5. Restart your phone as prompted.


Note:
See the the UberKernel page for further information on its abilities and use.


Brief Usage

Where To Start

GovnahTapProfile-0.6.1.png
To begin accessing the power of Govnah's control over the Linux Kernel, tap the "Profile" row at the top of the main screen.


Profiles

GovnahTapAdvanced-0.6.1.png
Here is the list of stored Govnah Profiles. Profiles are a simple way for you store various settings that you wish to be applied at boot-time. You have the ability to store several different profiles for testing the best settings for your usage. Tap "Advanced Settings" at the top to access the individual settings that get stored in the profiles.


Advanced Settings

GovnahAdvSettings2-0.6.1.png
This is the list of configurable items. They are explained in more depth below. You are strongly encouraged to read about what these settings mean and do. Not all of them are beneficial to you or your battery. Most of the defaults are a happy medium between the two. The main one to change is "CPU Frequency". Tap that now.


CPU Frequency

GovnahCPUFreq-0.6.1.png
The first time you boot your Pre/Pixi after installing Govnah and UberKernel, it will be running at 600MHz. This is where you ramp it up to 800MHz. Select "800Mhz" in the "Set Speed" section and tap "Apply Settings". Your phone will immediately be running at 800Mhz. Gesture Swipe left return to the "Advanced Settings" screen.


Compressed Swap (compcache)

GovnahCompSwap-0.6.1.png
Compressed swap (compcache) is simply an amount of RAM (memory) that is reserved for compressing data loaded into RAM when the amount of RAM needed exceeds the space available. In a nut shell this provides more RAM space for application data to be loaded in RAM. The trade off is slightly reduced performance of the RAM for the data that is being compressed and uncompressed. But is faster than if the data were in a swap space on the internal storage drive (memory). To use this feature you must first set the amount of space that will be reserved and then toggle compcache enabled to on. Then click apply to make the settings active. If you desire to change the amount of space reserved once it has been active you must turn compcache enabled to off and click apply. Then change the amount of space reserved, turn compcache enabled to on, and click apply to make the new setting active.


Saving your Profile

GovnahPalm4Life-0.6.1.png
After leaving the step above, you will have ended up back at the "Advanced Settings" screen where the button "Save Current Profile" is at the bottom. This is where you can make your Pre/Pixi set to boot with your faster speed. Set the name you want here and tap "Save As New Profile". Gesture swipe left to return to the "Profiles" screen.


Profile Management

GovnahMegaProfiles2-0.6.1.png
As you can clearly see, you can save many different profiles for testing various settings to find what best suits you and your usage patterns to find that "sweet spot" between speed and battery savings. Only you can find this. People can help suggest what works for them, but no two devices are exactly the same.


Troubleshooting/FAQs

"Unknown" Profile

  • With webOS 2.1, HP as implemented a 10M compcache natively. This causes a problem with Govnah's abilty to assign your compcache value before the webOS's upstart scripts does which will cacue Govnah to display "Unknown" as a profile name. To remedy:
  1. Save your profile with the stock 10M compcache.
  2. You need to edit /etc/event.d/compcache to reflect your setting.
  • The number is your target size in K. For a 14M compcache: 14 * 1024 = 14336.
  • Reboot your phone.



Governors In-Depth

Real World Examples

The Uber-Kernel exposes a governor called on-demand. The on-demand governor increases and decreases clock speed based on the percentage of CPU usage.

The on-demand governor exposes the following parameters which can be set by Govnah:

  • scaling_max_freq - Set the maximum frequency your CPU is allowed to scale to.
  • scaling_min_freq - Same as scaling_max_freq but setting a minimum value.
  • sampling_rate - How often you want the kernel to look at the CPU usage (in microseconds) Typically this is set to values of 10000 or more.
  • up_threshold - This defines what the average CPU usage percentage increase between samplings for the kernel to decide to increase the CPU frequency.
  • ignore_nice_load - If '0' (its default), all processes are counted towards the 'cpu utilization' value. When set to '1', the processes that are run with a 'nice' value will not count (and thus be ignored) in the overall usage calculation.
  • powersave_bias - This modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. The bias is in tenths of a percent (0 to 1000). A setting of 100 will result in a 10% smaller increase in CPU speed for a given usage than a setting of 0 would result in.


Each "Governor" in the kernel tells Govnah what parameters it has that may be set and may also say what the limits of those parameters are.


Standard Linux Governors

Generic Items (all)

  • scaling_max_freq: Set the maximum frequency your CPU(s) are allowed to scale to. Look at the output from scaling_available_frequencies
  • scaling_min_freq: Same as scaling_max_freq but setting a value that will not allow the CPU(s) to go below.

ondemand

  • sampling_rate: This is measured in microseconds (one millionth of a second). This is how often you want the kernel to look at the CPU usage and to make decisions on what to do about the frequency. Typically this is set to values of around '10000' or more. If you wanted to set the sampling rate to 1 second you would set it to 1000000 like in the following example.
  • sampling_rate_(min|max): This is minimum and maximum sampling rates available that you may set 'sampling_rate' to. I believe in microseconds also.
  • sampling_down_factor: this parameter controls the rate that the CPU makes a decision on when to decrease the frequency. When set to its default value of '5' it means that at 1/5 the sampling_rate the kernel makes a decision to lower the frequency. Five "lower rate" decisions have to be made in a row before the CPU frequency is actually lower. If set to '1' then the frequency decreases as quickly as it increases, if set to '2' it decreases at half the rate of the increase.
  • up_threshold: This defines what the average CPU usage between the samplings of 'sampling_rate' needs to be for the kernel to make a decision on whether or not it should increase the frequency. For example when it is set to its default value of '80' it means that between the checking intervals the CPU needs to be on average more than 80% in use to then decide that the CPU frequency needs to be increased.
  • ignore_nice_load: This parameter takes a value of '0' or '1'. When set to '0' (its default), all processes are counted towards the 'cpu utilization' value. When set to '1', the processes that are run with a 'nice' value will not count (and thus be ignored) in the overall usage calculation.
  • powersave_bias: This modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. By default, (powersave_bias = 0), the ondemand governor selects the minimum processor frequency that can still complete a workload with minimal idle time. Doing so should result in the highest performance to power efficiency ratio. In some cases, you might prefer a greater emphasis on power efficiency than performance. In this case, set the powersave_bias parameter to a value between 1 and 1000 to reduce the target frequency by one-thousandth of that value. For example, set powersave_bias to 100 for a one-tenth reduction in target frequency. In this case, if the governor chooses a target frequency of 2 GHz (with powersave_bias = 100), the governor instead will request 1.8GHz – a one-tenth reduction. If 1.8 GHz is an exact match with an available hardware frequency (listed in the scaling_available_freq parameter), the processor is set to this frequency. If 1.8 GHz is not available, the processor fluctuates between the closest available upper and lower frequencies for an average frequency of 1.8 GHz. (from IBM web page). The original author of the ondemand powersave_bias code explains it as "For example, If ondemand requests 2.0GHz based on utilization, and powersave_bias=100, this code will knock 10% off the target and seek a target of 1.8GHz instead of 2.0GHz until the next sampling. If 1.8 is an exact match with an hardware frequency we use it, otherwise we average our time between the frequency next higher than 1.8 and next lower than 1.8" (from http://osdir.com/ml/kernel.cpufreq/2006-07/msg00114.html ) - the key word appears to be "average". The author also warns "In practice, users will not be able to detect a difference between 0.1% increments, but 1.0% increments turned out to be too large. Also, the max value of 1000 (100%) would simply peg the system in its deepest power saving P-state, unless the processor really has a hardware P-state at 0Hz".

conservative

  • freq_step: This describes what percentage steps the CPU freq should be increased and decreased smoothly by. By default the CPU frequency will increase in 5% chunks of your maximum CPU frequency. You can change this value to anywhere between 0 and 100 where '0' will effectively lock your CPU at a speed regardless of its load whilst '100' will, in theory, make it behave identically to the "ondemand" governor.
  • down_threshold: This is same as the 'up_threshold' found for the "ondemand" governor but for the opposite direction. For example when set to its default value of '20' it means that if the CPU usage needs to be below 20% between samples to have the frequency decreased.
  • sampling_rate: same as ondemand.
  • sampling_rate_(min|max): same as ondemand.
  • up_threshold: same as ondemand.
  • ignore_nice_load: same as ondemand.

userspace

  • scaling_setspeed: one of the values from scaling_available_frequencies
  • NB: when userspace is selected LunaSysMgr will change the frequency as it feels.

powersave

  • Nothing special

performance

  • Nothing special

screenstate

  • Nothing special


Developer Notes

Relaunching for Cross-App Integration

There are 2 different launch params. One to get a list of profiles returned to your app, and one to apply a profile to the phone. This was implemented in v0.3.1.

Profile List

The code below is how you would launch Govnah and tell it to return a list of profiles to your app:

this.controller.serviceRequest
(
	'palm://com.palm.applicationManager',
	{
		method: 'launch',
		parameters:
		{
			id: 'org.webosinternals.govnah',
			params:
			{
				type: 'get-profiles',
				returnid: 'app.to.relaunch'
			}
		}
	}
);

You need to replace the returnid parameters value 'app.to.relaunch' with your apps id.

The object below will be sent to your app-assistants handleLaunch function. (But with real data obviously.)

{
	type: 'govnah-profiles',
	profiles:
	[
		{
			id: 1,
			name: 'Palm Default'
		},
		{
			id: 8,
			name: 'Awesome Profile!'
		},
		{...}
	]
}


Profile Apply

The code below is how you use the list of profiles you received in the prior relaunch to have Govnah apply a profile.

this.controller.serviceRequest
(
	'palm://com.palm.applicationManager',
	{
		method: 'launch',
		parameters:
		{
			id: 'org.webosinternals.govnah',
			params:
			{
				type: 'set-profile',
				profileid: 1
			}
		}
	}
);

Replace 'profileid' parameters value with the profile id you wish Govnah to apply. Note that 'profilename' is also an accepted parameter. This launch will not relaunch your app, it will simply apply if the profileid/name you requested actually exists. (And will just ignore your request if it doesn't.)


Resources

Support Development

Btn donateCC LG.gif

Official Forum
Bug Reporting
Registration on the site is required to submit bug reports.
Feature Requests
Registration on the site is required to submit feature requests.


Links