2011년 11월 29일 화요일

Lulzactive Governor v2

Lulzactive Governor v2

Author: Tegrak

Based on "interactive" governor
Inspired by erasmux's "smartass" governor (included in Flykernel)

lulzactive control app
https://market.android.com/details?id=com.tegrak.lulzactive

lulzactive governor source
https://github.com/tegrak/lulz-kernel_gt-i9100/tree/master/kernel/drivers/cpufreq

cpu work load >= [inc_cpu_load]%
cpu frequency changes from (Lx) to (Lx - pump_up_step)
up sampling time = 24000us (from smartass governor)
eg )
(L0)1200 - (L1)1000 - (L2)800 - (L3)500 - (L4)200
inc_cpu_load=60%, pump_up_step=1
cpu_load = 60%, current frequency = (L2)800 >> frequency = (L1)1000
cpu_load = 60%, current frequency = (L1)1000 >> frequency = (L0)1200

(L0)1200 - (L1)1000 - (L2)800 - (L3)500 - (L4)200
inc_cpu_load=50%, pump_up_step=2
cpu_load = 50%, current frequency = (L2)800 >> frequency = (L0)1200
cpu_load = 50%, current frequency = (L4)200>> frequency = (L2)800

cpu work load < [inc_cpu_load]%
cpu frequency keeps the current value or changes from (Lx) to (Lx + pump_down_step)
down sampling time = 49000us (from smartass governor)
eg )
(L0)1200 - (L1)1000 - (L2)800 - (L3)500 - (L4)200
inc_cpu_load=60%, pump_down_step=1
cpu_load = 59%, current frequency = (L2)800 >> frequency = (L3)500
cpu_load = 23%, current frequency = (L1)1000 >> frequency = (L2)800

screen off
cpu frequency is locked at scaling min freqeuncy.
default min freq of Galaxy S II is 200MHz.
you don't need to use "screen off" profile of SetCPU.
eg )
(L0)1200 - (L1)1000 - (L2)800 - (L3)500 - (L4)200
screen_off_min_step=3
(L4)200 ~ (L3)500

screen_off_min_step=1
(L4)200 ~ (L1)1000

Values
Following values are in /sys/devices/system/cpu/cpufreq/lulzactive/

inc_cpu_load: 0~100%, default is 60%
pump_up_step: 0 ~ (frequency_table_size - 2), default is 1
pump_down_step: 0 ~ (frequency_table_size - 2), default is 1
screen_off_min_step: 0 ~ (frequency_table_size - 1), default is (frequency_table_size - 2)
up_sample_time: 10,000 ~ 50,000μs, default is 24,000μs
down_sample_time: 10,000 ~ 100,000μs, default is 49,000μs

debugging
1 = print screen on/off message
2 = print governor start/stop message
4 = print frequency changing
7 = print all above (bitwise or, 1|2|4 = 7, default 1|2 = 3)
echo "7" > /sys/devices/system/cpu/cpufreq/lulzactive/debug_mode
cat /proc/kmsg | busybox grep "lulzactive"

2011년 11월 7일 월요일

2nd Core

SAMSUNG Galaxy S II and SAMSUNG Galaxy Note Only!
NEEDS Custom Kernel Support!

You can set the CPU cores as dynamic hotplug mode, single core mode or fully dual core mode.
This provides easy and simple way to use.

Download
https://market.android.com/details?id=com.tegrak.secondcore

Kernel source patch
hotplug-v1.patch.zip

Features
*Set on boot
Change mode what you selected automatically on boot time.
Menu > Settings

Modes
*Dynamic Hotplug Mode
Default. Recently, mobile multicore CPUs turn off extra core(s) to save battery life when system is not busy and only use 1 core.
They turn on extra core(s) when system is busy. so system use all cores again.

*Single Core Mode
Use 1 core always. A extra core is shut down. It makes battery life longer but performance is decreased.

*Dual Core Mode
Use 2 cores always. Performance is increased but battery life is shorter than others.

*Available kernels
(Galaxy S II) Lulz Kernel Build 15 and over
http://forum.xda-developers.com/showthread.php?t=1118918
(Galaxy S II) Siyah Kernel v2.2 and over
http://forum.xda-developers.com/showthread.php?t=1263838
(Galaxy Note) FM Kernel based on 2.6.35.14 [Beta]
http://forum.xda-developers.com/showthread.php?t=1342807

*Benchmark
Tested with Lulz Kernel Build 15, lulzactive, no OC

AnTuTu
Single Core Mode 3963
Dynamic Hotplug and Dual Core Mode 5754

Smartbench 2011
Dynamic Hotplug Mode 3920/2201
Single Core Mode 2202/2373
Dual Core Mode 4204/2188

*Apply with shell script
Dynamic hotplug mode
echo "on" > /sys/devices/virtual/misc/second_core/hotplug_on
Single core mode
echo "off" > /sys/devices/virtual/misc/second_core/hotplug_on
echo "off" > /sys/devices/virtual/misc/second_core/second_core_on
Dual core mode
echo "off" > /sys/devices/virtual/misc/second_core/hotplug_on
echo "on" > /sys/devices/virtual/misc/second_core/second_core_on

This is very interesting stuff on the quad core. I hope to meet quad core phones soon. :D