Introduce Lazyplug
Other hotplugging methods including mpdecision and intelli_plug focuses on how should we turn off CPU cores. They hotplugs the individual CPU cores based on the current load divided by thread capacity. Lazyplug takes a whole new approach on how we should do hotplugging based on the foundation of the other side of the coin; “Linux’s hotplugging is very inefficient.” Current hotplugging code on Linux is a total waste of CPU cycles and delays, so rather than hotplugging and hurt performance & battery life, just leaving the CPU cores on might be a better choice. This kind of approach is spreading out more and more. Samsung has been using this method for a very long time with big.LITTLE devices and recent Nexus 6 firmware also does the similar thing. Lazyplug just leaves them on, most of the time. It also tries to solve some problems with the “Always on” approach. On situations such as video playback, turning on all CPU cores is not battery friendly. So Lazyplug *does* actually turns off CPU cores, but only when idle state is long enough(to reduce the number of CPU core switchings) and when the device has its screen off(determination is done via earlysuspend or powersuspend because framebuffer API causes troubles on hotplugging CPU cores). Basic methodology : Lazyplug uses majority of the codes from intelli_plug by faux123 to determine when to turn off CPU cores. If the system has been idle for (DEF_SAMPLING_MS * DEF_IDLE_COUNT)ms, it turns off the CPU cores. And if the next poll determines 1 core isn’t enough, it fires up all CPU cores (instead of selective CPU cores; which is the traditional intelli_plug’s method). Lazyplug also takes touch-screen input events to fire up CPU cores to minimize noticeable performance degradation. There’s also a “lazy mode” for *not* aggressively turning on CPU cores on scenario such as video playback. For example, if you hook up lazyplug_enter_lazy() to the video session open function, Lazyplug won’t aggressively turn on CPU cores and tries to handle it with 1 CPU core. * TODO : * Dual-core mode : YouTube video playback is mostly single-threaded. * It usually hovers around 10% ~ 30% of total CPU usage on quad-core * device. That means 1 CPU core might not be enough to handle it, but * also turning on all CPU cores is unnecessarily wasting power. Signed-off-by:Park Ju Hyung <qkrwngud825@gmail.com> Original commit: https://github.com/halaszk/Perseus-halaszk-universal5433/commit/002a6d0be5cda680f93028e12a6ec5b4fd758dec
Loading
Please register or sign in to comment