Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,872 Members 53,001 Now Online
XDA Developers Android and Mobile Development Forum

[krn.module] smartass governor for X10 GB (updated, configurable!)

Tip us?
 
viulian
Old
(Last edited by viulian; 10th August 2011 at 11:24 PM.)
#1  
Recognized Developer - OP
Thanks Meter 371
Posts: 394
Join Date: Apr 2011

 
DONATE TO ME
Default [krn.module] smartass governor for X10 GB (updated, configurable!)

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 X10. Initially the module was offered by erasmux.

It works for 2.3.3 kernel that is: 2.6.29-00054-g5f01537.

You can configure various parameters:

Code:
Select 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:
Select Code
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /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:
Select Code
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Results:

Below are my 17 hours run:



I was running this governor today and I managed to get 47% of battery in 17 hours (listening to music 2 hours, with screen on at 0% brightness, reading the news in the metro 10-15 minutes, and 4 email accounts syncing every 15 minutes). During the night (6 hours), it only lost 2% of the battery.

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 (998Mhz) 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 245760
/*
* The frequency to set when waking up from sleep.
* When sleep_max_freq=0 this will have no effect.
*/
#define DEFAULT_SLEEP_WAKEUP_FREQ 998400
/*
* 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:
Select 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.ko

Enjoy!

Special thanks to:
a) wolf which gave me hope with X10
b) all guys that made flashing X10 a reality
c) AnDyX for the source code and the workaround for the missing kernel symbols.
The Following 14 Users Say Thank You to viulian For This Useful Post: [ Click to Expand ]
 
festa20
Old
#2  
Senior Member
Thanks Meter 835
Posts: 1,685
Join Date: Jan 2011
Location: Barnsley
Awesome dude!!! Will have a try when I get home

Regards

Sent from my X10i using XDA Premium App


Want to Get Notified for Incoming SMS And Call with Camera FlashLight try this FlashBlink
 
kinglargo
Old
#3  
kinglargo's Avatar
Senior Member
Thanks Meter 101
Posts: 444
Join Date: Jan 2011
Location: Brussels
dude! I want to test it, how do I install it (i mean step by step for a noob like me)
Nexus 4
Waiting for KitKat
Google+
Live long and prosper!
 
aZuZu
Old
#4  
aZuZu's Avatar
Recognized Developer
Thanks Meter 923
Posts: 625
Join Date: Jan 2011
Location: Zagreb
so smartass is not so smart for now... will wait till smartass iq get higher... but nice work dude... btw don't be smartass and give to smartass some more iq soon... thanks!
Bug report for all my applications.
My ROM: X10 Mini: SE Stock 2.1 C0
My ROM: X10: SE Stock 2.3.3 - Rooted.
aZuZu Small Tools 4 SE

FreeXperia Team

Damn I wonder... People with WildFire... How they feel when you say to them "DON'T BE A BUZZ KILLER!"
What goes on four legs in the morning, on two legs at noon, and on three legs in the evening? w** is that?
 
viulian
Old
(Last edited by viulian; 10th August 2011 at 10:19 PM.)
#5  
Recognized Developer - OP
Thanks Meter 371
Posts: 394
Join Date: Apr 2011

 
DONATE TO ME
Thanks for support guys!

Later edit: I've modified first post to include the installation steps.
 
anantshri
Old
#6  
Senior Member
Thanks Meter 316
Posts: 678
Join Date: Feb 2011
Location: Bangalore

 
DONATE TO ME
Quote:
Originally Posted by viulian View Post
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
better to use
HTML Code:
mount -o remount rw /system
or
busybox mount -o remount rw /system
lot better and removes the need to selecting mtd block corrrectly coz that differs sometimes.
 
anantshri
Old
#7  
Senior Member
Thanks Meter 316
Posts: 678
Join Date: Feb 2011
Location: Bangalore

 
DONATE TO ME
Default automatic enabling of smartass

type this in your install-recovery.sh

Code:
Select Code
insmod /system/lib/modules/smartass.ko
echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
This should make it your setting as needed on every reboot
 
chiefy009
Old
#8  
chiefy009's Avatar
Senior Member
Thanks Meter 778
Posts: 4,048
Join Date: Oct 2010
Can this be made into a zip to.flash ?

Sent from my X10i using XDA Premium App
Xperia T
Running: Stock

IF I HELP PLEASE USE THE THANKS BUTTON

Previous -- iPhone 4s, x10i, Nokia 3210, SL55, Nokia 7110, Motorola Rzor, Blackberry Torch, LG Shine, LG Chocolate, Blackberry Curve, Samsung Galaxy S, Sony Ray STi18, Google Nexus S, Sony Arc S, Sony Xperia S, Samsung S2, Xperia T, Windows HTC 8X
 
viulian
Old
#9  
Recognized Developer - OP
Thanks Meter 371
Posts: 394
Join Date: Apr 2011

 
DONATE TO ME
I'm sorry, I don't have experience in creating .zips to be flashed ... anyway - is faster to copy manually and you don't need to reboot the phone or anything.

Once I finish it (to get it to be configurable over sysfs) then I will investigate this possibility of flashing.
 
chiefy009
Old
#10  
chiefy009's Avatar
Senior Member
Thanks Meter 778
Posts: 4,048
Join Date: Oct 2010
Cant I do it through root explorer?

Sent from my X10i using XDA Premium App
Xperia T
Running: Stock

IF I HELP PLEASE USE THE THANKS BUTTON

Previous -- iPhone 4s, x10i, Nokia 3210, SL55, Nokia 7110, Motorola Rzor, Blackberry Torch, LG Shine, LG Chocolate, Blackberry Curve, Samsung Galaxy S, Sony Ray STi18, Google Nexus S, Sony Arc S, Sony Xperia S, Samsung S2, Xperia T, Windows HTC 8X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes