Mobile/Powersaving: Difference between revisions
(→Ideas) |
|||
(14 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
== Metrics == | == Metrics == | ||
* # of wakeups/second, that prevent the CPU from sleeping. See [http://www.lesswatts.org/projects/powertop/ powertop]. Relevant in low CPU load. | * N900 - use [http://www.mauve.plus.com/bat.tar.gz this useful tool], run ././bq27220.sh -r | ||
* # of wakeups/second, that prevent the CPU from sleeping. See [http://www.lesswatts.org/projects/powertop/ powertop]. Relevant in low CPU load. See [[Mobile/Powersaving/Wakeups]] | |||
* CPU %. Relevant in high CPU load. | * CPU %. Relevant in high CPU load. | ||
* Disk usage (tools: iostat, atop). | * Disk usage (tools: iostat, atop). | ||
** Relevant config setting: browser.sessionstore.interval | ** Relevant config setting: browser.sessionstore.interval | ||
* Simulate power usage via [http://software.intel.com/en-us/articles/application-energy-toolkit/ Intel's Application Energy Toolkit]? | |||
== Ideas == | == Ideas == | ||
=== OS-level hinting === | |||
Different OSes have different application lifecycles. Depending on application states, we might want to do certain things. Information on different OSes is tracked [[Mobile/PowerManagement|here]]. | |||
=== OS-level process control === | === OS-level process control === | ||
The 'nuclear option': Use OS-level operations to make processes | The 'nuclear option': Use OS-level operations to make processes use low CPU % when they should. On Linux this can be done with SIG_STOP, SIG_CONT (see e.g. [http://cpulimit.sourceforge.net/ cpulimit]). Note that we are **not** completely freezing the process, that would be too bug-prone. | ||
'''Tracked in {{bug|568054}}''' | |||
'''Uses''': | '''Uses''': | ||
* Force plugins to use low CPU % (Flash etc.) | * Force plugins to use low CPU % (Flash etc.) | ||
* Throttle all tabs when battery is low (kind of like laptops dim their monitors on low battery). | * Throttle all tabs when battery is low (kind of like laptops dim their monitors on low battery). | ||
** User-controllable speed setting, to save power by throttling? | ** User-controllable speed setting, to save power by throttling? | ||
'''Availability''': Probably Meego. Android lacks it in the Java API (but other signals are present, so perhaps it will be added), perhaps using the NDK it is possible though? | '''Availability''': Probably Meego. Android lacks it in the Java API (but other signals are present, so perhaps it will be added), perhaps using the NDK it is possible though? | ||
Line 29: | Line 33: | ||
'''Benefits''': Straightforward, simple to implement, guarantees the best results. | '''Benefits''': Straightforward, simple to implement, guarantees the best results. | ||
'''Status''': Working proof of concept on desktop for suspending/ | '''Status''': Working proof of concept on desktop and on N900 for suspending and/or throttling the content process as desired. | ||
=== Firefox-level control === | === Firefox-level control === | ||
A more messy option: Add separate options throughout our codebase to allow things to be temporarily frozen - JavaScript, animations, plugins, etc. etc. | A more messy option: Add separate options throughout our codebase to allow things to be temporarily frozen - JavaScript, animations, plugins, etc. etc. | ||
=== Platform-specific control === | |||
* On Android, processes have a [http://developer.android.com/guide/topics/fundamentals.html#lcycles lifecycle]. We currently pause the main thread - but no others - when we get OnPause. | |||
** Should we do more in OnStop? | |||
* Need to investigate other OSes | |||
== Tests == | == Tests == | ||
Line 41: | Line 51: | ||
** [http://www.webhamster.com/ Hamster dance] | ** [http://www.webhamster.com/ Hamster dance] | ||
** [http://www.cnn.com/ CNN] (takes 100% CPU in fennec for no user-apparent reason) | ** [http://www.cnn.com/ CNN] (takes 100% CPU in fennec for no user-apparent reason) | ||
* [[N900 tests]] | |||
== Bugs == | |||
* {{bug|446418}} + dependencies - Investigate power management issues | |||
* {{bug|567339}} - Excessive wake-ups after visiting start page |
Latest revision as of 18:49, 13 September 2010
Overview
On mobile devices we want to use the least amount of power, so the device's battery will last as long as possible. Users will likely notice what browsers are better in this and prefer them.
Metrics
- N900 - use this useful tool, run ././bq27220.sh -r
- # of wakeups/second, that prevent the CPU from sleeping. See powertop. Relevant in low CPU load. See Mobile/Powersaving/Wakeups
- CPU %. Relevant in high CPU load.
- Disk usage (tools: iostat, atop).
- Relevant config setting: browser.sessionstore.interval
- Simulate power usage via Intel's Application Energy Toolkit?
Ideas
OS-level hinting
Different OSes have different application lifecycles. Depending on application states, we might want to do certain things. Information on different OSes is tracked here.
OS-level process control
The 'nuclear option': Use OS-level operations to make processes use low CPU % when they should. On Linux this can be done with SIG_STOP, SIG_CONT (see e.g. cpulimit). Note that we are **not** completely freezing the process, that would be too bug-prone.
Tracked in bug 568054
Uses:
- Force plugins to use low CPU % (Flash etc.)
- Throttle all tabs when battery is low (kind of like laptops dim their monitors on low battery).
- User-controllable speed setting, to save power by throttling?
Availability: Probably Meego. Android lacks it in the Java API (but other signals are present, so perhaps it will be added), perhaps using the NDK it is possible though?
Benefits: Straightforward, simple to implement, guarantees the best results.
Status: Working proof of concept on desktop and on N900 for suspending and/or throttling the content process as desired.
Firefox-level control
A more messy option: Add separate options throughout our codebase to allow things to be temporarily frozen - JavaScript, animations, plugins, etc. etc.
Platform-specific control
- On Android, processes have a lifecycle. We currently pause the main thread - but no others - when we get OnPause.
- Should we do more in OnStop?
- Need to investigate other OSes
Tests
- High CPU usage:
- bubblemark
- Hamster dance
- CNN (takes 100% CPU in fennec for no user-apparent reason)
Bugs
- bug 446418 + dependencies - Investigate power management issues
- bug 567339 - Excessive wake-ups after visiting start page