[GOVERNOR][2.6.39.4] Hotplug for Nvidia Tegra

What kind of issues are you experiencing ?

  • None, working just fine.

    Votes: 12 41.4%
  • Random Reboots

    Votes: 9 31.0%
  • Sleep of Death

    Votes: 5 17.2%
  • Other ... (please tell me)

    Votes: 3 10.3%

  • Total voters
    29

RaymanFX

Inactive Recognized Developer
Jan 8, 2011
1,122
16,501
0
25
Hannover


Hello again xda, today I want to present something tiny, but nontheless important (in my view) for our old TF101 ...

The first working HOTPLUG governor for this device!

Q: What the hell is 'hotplug' ?

Hotplug Governor:
The “hotplug” governor scales CPU frequency based on load, similar to
“ondemand”. It scales up to the highest frequency when “up_threshold”
is crossed and scales down one frequency at a time when “down_threshold”
is crossed. Unlike those governors, target frequencies are determined
by directly accessing the CPUfreq frequency table, instead of taking
some percentage of maximum available frequency.

The key difference in the “hotplug” governor is that it will disable
auxillary CPUs when the system is very idle, and enable them again once
the system becomes busy. This is achieved by averaging load over
multiple sampling periods; if CPUs were online or offlined based on a
single sampling period then thrashing will occur.
As you can see, hotplug is able to deliver you the fastest experience and the most fps in game (kernel independant), but it also allows for completely switching off one core to save battery life. In my testings, that worked very well. I also found out, that with this governor, my TF is deep-sleeping like a baby. No governor around here (not even smartassv2 ... could deliver me this performance while maintaining a decent battery life).


Tested on EOS 4.2.1 with EOS4 kernel

But try out yourself:

NOTE: This works on any 2.X kernel available (my Harmony series, ELiTE series, KatKernel series, or any other kernel except my divemaster)

Code:
1) Download a terminal emulator (if you don't have one already)
2) Download the .ko module from [URL="https://dl.dropbox.com/u/31119007/xda/hotplug-tegra-2/cpufreq_hotplug.ko"]here[/URL]
3) Remember the path you saved the module to (or preferably move it into /system/lib/modules)
4) su
5) insmod path-to-module/cpufreq_hotplug.ko
6) Switch to 'hotplug' governor with your favourite tool.
If you were too lazy to read my instructions, this is for you ..

DOWNLOAD

As always, have fun, share, and report back!

 
Last edited:

pops106

Senior Member
Aug 29, 2008
501
264
83
I have followed the instructions, do I have to run it every reboot or just this one off?

Nothing really happened when I ran it but I guess it just loads the module.

Cheers buddy
 

pops106

Senior Member
Aug 29, 2008
501
264
83
I have followed the instructions, do I have to run it every reboot or just this one off?

Nothing really happened when I ran it but I guess it just loads the module.

Cheers buddy
Ahaha figured it out, it adds the govenor so we can then change it.

Cheers

---------- Post added at 08:41 PM ---------- Previous post was at 08:36 PM ----------

Ahaha figured it out, it adds the govenor so we can then change it.

Cheers
wouldn't wake up after putting it to sleep, had to hold power button till it rebooted then it is gone from the options.

Soz

Running eos3 and kat69

Cheers
 

clouse2013

Senior Member
Mar 12, 2011
184
24
0
Columbus
Good work! I was trying to do this same thing the cpusleeper app but couldnt get it to work. Definitely giving this a go.

Edit: installed fine but wont survive a reboot. Any fix for e this?

Sent from my Transformer TF101 using xda premium
 
Last edited:

morphuex

Senior Member
Feb 24, 2012
160
152
0
sounds very promising i'll try it out and report if I get any RR's.

Getting error insmod: Can't open 'path-to-module/cpufreq_hotplug.ko'

Cd to my download folder which is where it is, am I doing something wrong?
 
Last edited:

turtlemask

Member
Jan 15, 2007
14
4
23
In here you may find how to make permanent the governor insmod.
Long story short is "add a script in /system/etc/init.d , it can be something like 91modules. . Add execution permission and it can contain the same code as before. Reboot and it should load your module at boot (be sure that the path to your module is right).
Also, you can do that in one line as root in a terminal. First, be sure that your /system is mounted as rw, not ro. If you don't know how to do that, as root, in a terminal, execute:

Code:
mount -o remount,rw /system
Then:

Code:
echo -e \#\!/system/bin/sh'\n'insmod [B]/path/to/module[/B]/cpufreq_hotplug.ko > /system/etc/init.d/91modules | chmod +x /system/etc/init.d/91modules
"
It should load automatically next time you reboot.
I created the 91modules file and done the editing and file permission in ES File Manager, but the above instructions should work flawlessly.

Don't thank me for this. Thank MapleSyrup
 
Last edited:

RaymanFX

Inactive Recognized Developer
Jan 8, 2011
1,122
16,501
0
25
Hannover
RaymaFX, you always amaze me!:victory:
Posts like this are keeping my work up and my releases coming.
People like you are the reason I am putting this much effort in this kinda old device :) .


For those who experience SOD/RR with hotplug and can confirm it's not related to anything else, please gimme a dsmg/ksmg (I recommend using 'Lumberjack' from the playstore (made by Chris Trotman, EOS founder).
*NO* logcat, that isn't any useful for me in this case ..

I do now have 2 days uptime with hotplug governor, not a single SOD/RR, pretty much usage (wifi on all the time, a little Riptide GP, web browsing, most of the time playing music) and still got 20% left with EOS4 kernel while achieving full performance while needed. This thing is deep-sleeping just perfectly.
 
Last edited:

creison

Senior Member
Dec 31, 2011
271
33
0
Rio de Janeiro
I have placed the hotplug in the system this morning and my battery life still 99% im using it with dock and dono m8 but if theres any problem but seems my tf101 dont consume energy at all im starting to get scarry lol

Sent from my Transformer TF101 using xda app-developers app
 

clouse2013

Senior Member
Mar 12, 2011
184
24
0
Columbus
In here you may find how to make permanent the governor insmod.
Long story short is "add a script in /system/etc/init.d , it can be something like 91modules. . Add execution permission and it can contain the same code as before. Reboot and it should load your module at boot (be sure that the path to your module is right).
Also, you can do that in one line as root in a terminal. First, be sure that your /system is mounted as rw, not ro. If you don't know how to do that, as root, in a terminal, execute:

Code:
mount -o remount,rw /system
Then:

Code:
echo -e \#\!/system/bin/sh'\n'insmod [B]/path/to/module[/B]/cpufreq_hotplug.ko > /system/etc/init.d/91modules | chmod +x /system/etc/init.d/91modules
"
It should load automatically next time you reboot.
I created the 91modules file and done the editing and file permission in ES File Manager, but the above instructions should work flawlessly.

Don't thank me for this. Thank MapleSyrup
I typed all this in and it wont survive uve a reboot. I placed the module in /system/lib/modules and typed that. When i see the | is that a new line or all one line?

Sent from my Transformer TF101 using xda premium
 

turtlemask

Member
Jan 15, 2007
14
4
23
You can make that code in 2 commands, 1st is all before the | and 2nd the command after the |.
In order to work your final 91modules should look like

Code:
#!/system/bin/sh
insmod /system/lib/modules/cpufreq_hotplug.ko
In order to test if it's working you cat try to run it from the terminal (it may need "su" before)

Code:
./system/etc/init.d/91modules
If it's not complaining about not being executable, you may test to see if it's loaded with "lsmod".
If it's loaded it surely will survive the reboot.
I hope that helps you.
 

clouse2013

Senior Member
Mar 12, 2011
184
24
0
Columbus
Looks like it created the 91modules file in init.d but when i try to set permissions using chmod +x it says bad mode. Maybe thats why it isnt working, wrong permissions.

Sent from my Transformer TF101 using xda premium
 

turtlemask

Member
Jan 15, 2007
14
4
23
Indeed the chmod +x command doesn't work.
You may use ES file explorer to set file permissions but also you need to allow it superuser access, mount /system as writable and "up to root" and mark execute and write to the user. At the end the file should have the following permissions: rwx r-- r--