Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
viulian
Old
(Last edited by viulian; 19th November 2011 at 10:29 PM.)
#1  
Recognized Developer - OP
Thanks Meter 345
Posts: 374
Join Date: Apr 2011

 
DONATE TO ME
Default [krn.modules] smartass governor for Arc stock Kernel (2.3.3 / 2.3.4)

Hello guys,

I've managed to compile the module from here: http://forum.xda-developers.com/show....php?t=1159899 updated by AnDyX for X8 which I updated for Arc. Initially the module was offered by erasmux.

It works for 2.3.3 / 2.3.4 stock kernel that is: 2.6.32.9-perf (so if you're running stock kernel, and not a modded one).

You can configure various parameters:

Code:
# pwd
pwd
/sys/devices/system/cpu/cpu0/cpufreq/smartass
# ls
ls
debug_mask
up_rate_us
down_rate_us
up_min_freq
sleep_max_freq
sleep_wakeup_freq
awake_min_freq
sample_rate_jiffies
ramp_up_step
ramp_down_step
max_cpu_load
min_cpu_load
sleep_rate_us
#
Install guide:

Copy the cpufreq_smartass.ko to the root of your SD card and then execute the following commands with the phone connected to the PC:

Code:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
cp /sdcard/cpufreq_smartass.ko /system/lib/modules
cd /system/lib/modules
insmod cpufreq_smartass.ko
echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
You can confirm that installation works either by SetCPU (it will report scaling "smartass") or by executing the following command:

Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Screenshot:



As far as I can see, when it goes to deep sleep, it stays there, if you minimally use the phone, it should last a long time. But once you turn on the phone, it will kick into high gear (1Ghz) very fast, to allow for fast response - and won't use any other intermediate frequencies.

Settings:
/*
* The minimum amount of time to spend at a frequency before we can ramp up.
*/
#define DEFAULT_UP_RATE_US 24000;
/*
* The minimum amount of time to spend at a frequency before we can ramp down.
*/
#define DEFAULT_DOWN_RATE_US 49000;
/*
* When ramping up frequency with no idle cycles jump to at least this frequency.
* Zero disables. Set a very high value to jump to policy max freqeuncy.
*/
#define DEFAULT_UP_MIN_FREQ 0
/*
* When sleep_max_freq>0 the frequency when suspended will be capped
* by this frequency. Also will wake up at max frequency of policy
* to minimize wakeup issues.
* Set sleep_max_freq=0 to disable this behavior.
*/
#define DEFAULT_SLEEP_MAX_FREQ 122880
/*
* The frequency to set when waking up from sleep.
* When sleep_max_freq=0 this will have no effect.
*/
#define DEFAULT_SLEEP_WAKEUP_FREQ 1024000
/*
* When awake_min_freq>0 the frequency when not suspended will not
* go below this frequency.
* Set awake_min_freq=0 to disable this behavior.
*/
#define DEFAULT_AWAKE_MIN_FREQ 0
/*
* Sampling rate, I highly recommend to leave it at 2.
*/
#define DEFAULT_SAMPLE_RATE_JIFFIES 2
/*
* Freqeuncy delta when ramping up.
* zero disables and causes to always jump straight to max frequency.
*/
#define DEFAULT_RAMP_UP_STEP 220000
/*
* Freqeuncy delta when ramping down.
* zero disables and will calculate ramp down according to load heuristic.
*/
#define DEFAULT_RAMP_DOWN_STEP 160000
/*
* CPU freq will be increased if measured load > max_cpu_load;
*/
#define DEFAULT_MAX_CPU_LOAD 75
/*
* CPU freq will be decreased if measured load < min_cpu_load;
*/
#define DEFAULT_MIN_CPU_LOAD 25
/*
* When screen if off behave like conservative governor;
*/
#define DEFAULT_SLEEP_RATE_US (usecs_to_jiffies(500000))


To update one of the settings, the standard echo command should be executed:
Code:
echo "80" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load
(in this example, the max_cpu_load will get the value 80, meaning that the CPU should be 80% at least, before a jump in frequency happens.

User biscoitu has a list of settings here http://forum.xda-developers.com/show...&postcount=161 but for X8 I think. They could be a starting point for X10 tuning I will also try to see which settings work best, but it will take a while.

Download:

Use it at your own risk!

cpufreq_smartass_arc_2.3.3.zip
cpufreq_smartass_arc_2.3.4.zip


Enjoy!

Special thanks to:
a) AnDyX for the source code and the workaround for the missing kernel symbols.
The Following 3 Users Say Thank You to viulian For This Useful Post: [ Click to Expand ]
 
viulian
Old
#2  
Recognized Developer - OP
Thanks Meter 345
Posts: 374
Join Date: Apr 2011

 
DONATE TO ME
I've tested this with the latest 2.3.4 firmware for Arc, and it reboots the phone. I will compile a newer version of the module ... and update the post.
The Following User Says Thank You to viulian For This Useful Post: [ Click to Expand ]
 
tRippinthehead
Old
#3  
Senior Member
Thanks Meter 32
Posts: 245
Join Date: Dec 2010
Ok thanks. Can you try to port second version (SmartassV2) of this governor?
 
viulian
Old
(Last edited by viulian; 19th November 2011 at 10:54 PM.)
#4  
Recognized Developer - OP
Thanks Meter 345
Posts: 374
Join Date: Apr 2011

 
DONATE TO ME
I've compiled the module for 2.3.4 stock kernel (please check first post in the topic and download the 2.3.4 version).

For Neo users: it will probably not work. You guys give me the contents of /proc/kallsyms file:

Code:
cat /proc/kallsyms > /sdcard/kallsyms
(and also please mention the phone model).

Quote:
Originally Posted by tRippinthehead View Post
Ok thanks. Can you try to port second version (SmartassV2) of this governor?
Please check here
The Following User Says Thank You to viulian For This Useful Post: [ Click to Expand ]
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...