• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Cyanogenmod-Tweaked Kernel

This is a kernel tweaked off of the CM Iproj Kernel. A lot of the code will be directly borrowed from the repos of Windkernel, Showp1984, and Faux123

This is a custom kernel, so don't report issues it may cause as issues with roms. Always run the kernel included with those roms when reporting issues.

This kernel will replace/remove/rename a few things on /system so make sure you have a backup.
  • /system/etc/init.qcom.post_boot.sh - stop mpdecision and thermald, just in case they're running somehow
  • vold.fstab - only mount the external sdcard to clean up some logcat spam
  • /system/lib/modules - deletes all modules and replaces them with the ones for this kernel


Features:
  • Overclocked to max out at 1.83ghz
  • GPU overclocked to max at 300mhz
  • Added the governors: badass, smartassv2, and intellidemand
  • Added the I/O schedulers: row, sio, and vr
  • Added kernel based MSM Mpdecision from Showp1984
  • Added 3 stage kernel based MSM thermald from Showp1984
  • Added Dynamic fsync from one of faux123's repos
  • Boosted the default Lowmemory minfrees
  • Sysfs Tunable CPU voltage table
  • Lowered the LCD screen max current (may make the screen a bit dimmer)
  • Enabled more tcp congestion methods.(may or may not do much)
  • Lots of miscellaneous fixes, check the commit history for details.


I recommend using either Trickstermod or Kernel Tuner to tweak kernel settings. They both have their fine points. I personally prefer Kernel Tuner.


Latest Version: V43

Previous Versions

Source: github


Showp1984 Explains some of the tunables for msm_mpdecision and msm_thermald on his rom page here. AS well as a bit about the badass governor.

Using Kernel Tuner now as well! Didn't realize we had one half of the dual core off. I turned mine on.

Hey I noticed under the info/CPU tab that mpdecision shows off.

Shouldn't that be on?

Do you mind posting your Kernel Tuner settings here?

Thanks Yoinx
 
Using Kernel Tuner now as well! Didn't realize we had one half of the dual core off. I turned mine on.

Hey I noticed under the info/CPU tab that mpdecision shows off.

Shouldn't that be on?

Do you mind posting your Kernel Tuner settings here?

Thanks Yoinx

Your second core will end up showing as offline sometimes on that main screen.. That's not abnormal. The MSM Mpdecision settings (defaults) will only turn on the second core if you're using 35% of the the first core, and turn it back off after it hits 15% use.

What do you mean that it shows as off? From the main screen you should have a "MP-Decision" Button that will take you to a screen with a bunch of tunables. The only thing on there that should be an on/off value is the Single Core - Screen Off tunable.

I could post my settings, but largely I just use the defaults. CPU capped at 1.5ghz, using badass if I want battery life. Sometimes Intellidemand... But I'm not 100% convinced that Intellidemand is working as intended.

GPU isn't tunable in Kernel Tuner, but it is in Trickstermod. I leave my capped at 300mhz.

I've played back and forth with the voltages. But typically end back up at the defaults. It's entirely possible to turn the lower frequencies down more to save battery, especially while in standby and such... I just haven't put that much work into it.


The main reason I linked the apps was because now there are a good few tunables and rather than tell people how to tweak the settings via the sysfs tunables, it was easier to just tell people apps that work for them ;)


Also, I had disabled triple frame buffering in the last few builds. Thought it was throwing errors in logcat (indicating that it was actually working). I'll be re-enabling that in future builds.

For now though, here's one that has it re-enabled. Pretty sure that it's supposed to make things a bit more buttery. I'm don't ever really catch such things, but it may.
 
Your second core will end up showing as offline sometimes on that main screen.. That's not abnormal. The MSM Mpdecision settings (defaults) will only turn on the second core if you're using 35% of the the first core, and turn it back off after it hits 15% use.

What do you mean that it shows as off? From the main screen you should have a "MP-Decision" Button that will take you to a screen with a bunch of tunables. The only thing on there that should be an on/off value is the Single Core - Screen Off tunable.

I could post my settings, but largely I just use the defaults. CPU capped at 1.5ghz, using badass if I want battery life. Sometimes Intellidemand... But I'm not 100% convinced that Intellidemand is working as intended.

GPU isn't tunable in Kernel Tuner, but it is in Trickstermod. I leave my capped at 300mhz.

I've played back and forth with the voltages. But typically end back up at the defaults. It's entirely possible to turn the lower frequencies down more to save battery, especially while in standby and such... I just haven't put that much work into it.


The main reason I linked the apps was because now there are a good few tunables and rather than tell people how to tweak the settings via the sysfs tunables, it was easier to just tell people apps that work for them ;)


Also, I had disabled triple frame buffering in the last few builds. Thought it was throwing errors in logcat (indicating that it was actually working). I'll be re-enabling that in future builds.

For now though, here's one that has it re-enabled. Pretty sure that it's supposed to make things a bit more buttery. I'm don't ever really catch such things, but it may.

Here:
 

Attachments

  • 1371743446831.jpg
    1371743446831.jpg
    59.5 KB · Views: 96
Still using v42. Anyone notice badass governor maxes CPU at 918mhz? I ran a CPU and GPU intensive game and log shows CPU never went above 918 even though I have max at 1512. SmartassV2 seems to lock freq at max also with this version. Any one else notice this or could it just be my device?
 
Still using v42. Anyone notice badass governor maxes CPU at 918mhz? I ran a CPU and GPU intensive game and log shows CPU never went above 918 even though I have max at 1512. SmartassV2 seems to lock freq at max also with this version. Any one else notice this or could it just be my device?

It could be the governors I'll have to look into it more. Did they behave correctly before for you?

Sent from my VS920 4G using Tapatalk 2
 
It could be the governors I'll have to look into it more. Did they behave correctly before for you?

Sent from my VS920 4G using Tapatalk 2

I didn't really notice until I flashed 42. They may have, they may have not.
 
Still using v42. Anyone notice badass governor maxes CPU at 918mhz? I ran a CPU and GPU intensive game and log shows CPU never went above 918 even though I have max at 1512. SmartassV2 seems to lock freq at max also with this version. Any one else notice this or could it just be my device?

Is the display under performance while choosing the governor on the cpu accurate?
 
Still using v42. Anyone notice badass governor maxes CPU at 918mhz? I ran a CPU and GPU intensive game and log shows CPU never went above 918 even though I have max at 1512. SmartassV2 seems to lock freq at max also with this version. Any one else notice this or could it just be my device?

I just double checked. My source for badass and intellidemand is the same windkernel.

Are you sure you get how the governors work?

Here's Showp1984's explanation from the link I added to the OP

Well good question. With ICS I decided to rework my gb badass which never got released because it was always pushed aside. To break down what it is:

Badass removes all of this "fast peaking" to the max frequency. On a typical system the cpu won't go above 918Mhz and therefore stay cool and will use less power. To trigger a frequency increase, the system must run a bit @ 918Mhz with high load, then the frequency is bumped to 1188Mhz. If that is still not enough the governor gives you full throttle. (this transition should not take longer than 1-2 seconds, depending on the load your system is experiencing)
Badass will also take the gpu load into consideration. If the gpu is moderately busy it will bypass the above check and clock the cpu with 1188Mhz. If the gpu is crushed under load, badass will lift the restrictions to the cpu.

The main screen on kernel tuner does seem to sit at 918 for a sec before dropping... I think that's an issue with the app's refresh rate... not the governor. But yeah... badass will cap at 918 for a bit before throttling up. It's a staged stepping governor.


*edit*
yeah, just checked while playing a game. badass scales up fine.
 
I just double checked. My source for badass and intellidemand is the same windkernel.

Are you sure you get how the governors work?

Here's Showp1984's explanation from the link I added to the OP



The main screen on kernel tuner does seem to sit at 918 for a sec before dropping... I think that's an issue with the app's refresh rate... not the governor. But yeah... badass will cap at 918 for a bit before throttling up. It's a staged stepping governor.


*edit*
yeah, just checked while playing a game. badass scales up fine.

BBS shows all freq above 918 unused. I tried it out with FF6 game (high processing demand) will post screens soon of BBS.

Edit: SS is of running badass in deep sleep for a good while then wake up to test freq jump. Had game on for a min or two.


Edit2: this screen shot is of me using smartass for a good few minutes with screen off phone idle. Never left 1512 until it went to deep sleep
 
No idea man. Mine is scaling here even according to bbs.

Sent from my VS920 4G using Tapatalk 2

I'll try a newer version and clear caches. Hopefully it was just a bad DL or flash.

Edit: flashed v43 still have same freq issues on CM RC5. Could be ROM, v6 charger or pdroid causing the issue if I am the only one getting it.

Changed governor settings for on demand to the screenshot below. If anyone has the same issue with badass as I did, these settings will get it similar to badass, just not as conservative


 
Yeah, I'm not 100% sure.

You're saying the following right?

Badass - Caps at 918mhz, never steps above this.

SmartassV2 - Stays at max freq (like performance)


Just wanted to clarify before testing. I may not get around to it until this weekend though.


*Edit*

Maybe I was mistaken... Mine is most definitely not scaling in badass. (there's not much more cpu utilization I could've done to make it scale... had to reboot to make the phone usable again >.> )
 
Yeah, I'm not 100% sure.

You're saying the following right?

Badass - Caps at 918mhz, never steps above this.

SmartassV2 - Stays at max freq (like performance)


Just wanted to clarify before testing. I may not get around to it until this weekend though.


*Edit*

Maybe I was mistaken... Mine is most definitely not scaling in badass. (there's not much more cpu utilization I could've done to make it scale... had to reboot to make the phone usable again >.> )

Exactly that. I am wondering if it is my v6/pdroid combo patch, the ROM, or my phone. But those two governors aren't working as intended either way
 
Exactly that. I am wondering if it is my v6/pdroid combo patch, the ROM, or my phone. But those two governors aren't working as intended either way

So, I don't use usb mass storage much. Went to use it today... Didn't work. I get a permission error on my lun file. I restored the normal vold.fstab... worked fine again. I'm not sure if the one I changed and included in this zip is the cause, or if it's something wonky with my phone.

Has this zip broken anyone else's usb mass storage connection?
 
So, I don't use usb mass storage much. Went to use it today... Didn't work. I get a permission error on my lun file. I restored the normal vold.fstab... worked fine again. I'm not sure if the one I changed and included in this zip is the cause, or if it's something wonky with my phone.

Has this zip broken anyone else's usb mass storage connection?
I can confirm its borked
 
i tired a few versions of PAC with V43. lots of force closes on everything. even underclocking everything for me FC's.
 
So, I don't use usb mass storage much. Went to use it today... Didn't work. I get a permission error on my lun file. I restored the normal vold.fstab... worked fine again. I'm not sure if the one I changed and included in this zip is the cause, or if it's something wonky with my phone.

Has this zip broken anyone else's usb mass storage connection?

I wonder if this is tied to that random SD card issue I've had... its only happened 3 times - first two I did a nandroid restore but on the third I shut down and then turned the phone back on a couple times and it decided the SD card was fine. (Could be a failing card tho too)

Next time it happens I'll see if a logcat will shed any light.
 
I wonder if this is tied to that random SD card issue I've had... its only happened 3 times - first two I did a nandroid restore but on the third I shut down and then turned the phone back on a couple times and it decided the SD card was fine. (Could be a failing card tho too)

Next time it happens I'll see if a logcat will shed any light.

Yeah, if it's the stock card... I've heard those weren't that great after awhile. I use a different card myself.


Btw, just an update... sorry it's taken so long to get anything new pushed out. The badass and intellidemand governors definitely werent working as intended, I haven't managed to fix those yet though.

Here's where I'm at right now:
I've added lagfree, going to see if that works right.
I removed some of the V6 supercharger type stuff that I had tried to baked in, and instead I'm doing the tweaking through an init.d script.
I've enabled 2 50meg zram disks that I setup as compressed swap (using snappy) and tuned swappiness to 100.
Disabled some of the slab debugging info, hoped that would free up some ram.

Basically, the idea here is to move all cached stuff that has to be loaded but typically just sits in ram forever into the compressed ramdisk swap so that it doesn't take up as much space.

So far, that seems to be working
Code:
             total         used         free       shared      buffers
Mem:        764020       522024       241996            0        19396
-/+ buffers:             502628       261392
Swap:       102392        78368        24024

Once I run this for awhile I'll post it up. Maybe later tonight, maybe tomorrow. With this kernel and the associated init.d scripts, there should be no need to run V6 or anything like that as it would conflict with the init.d tweaks.
 
Will it have the time machine built into the init.d scripts?

BTW: After a few clean installs, I found that reducing the number of apps I had loaded helped tremendously. IDK, maybe one of the ones I axed was causing the problem.
 
Yeah it will.

I'm hitting a few snags with this right now though. I was getting a lot of hardlocks with the swap/tweaks. Not really sure why. Don't really want to put a new version out in the while that I know has issues.

I'm not entirely sure if it's because I was trying to setup 2 ramdisks as swap, maybe the ram bus can't handle it. *shrug* I started trying to pull in some fixes but I can't figure out what linux version the mm bits are from... and they aren't matching up to what I'm finding with modifications.

*edit*
Alright, so it looks like it REALLY didn't like how I was trying to implement SLQB . That kept making my phone not boot >.>
 
New version (v44) up.

I removed the badass and intellidemand govs. They tie into the gpu to detect how busy it is... and I can't get that working.

I enabled zram, did some tweaking. Disabled memory allocation debugging... Who needs it anyway.

I recommend using this with my enhanced init.d zip, link added to this OP for the latest version. It'll create a swap in the zram disk. as well as apply some tweaks. Also added /system/etc/resolv.conf which should use google as the dns resolver. @stackrat, yes this zip still keeps the time machine bit carry the date/time to recovery (with a compatible recovery).

Hopefully this works decently for folks.


Alright, so I just noticed that my phone is resetting my swappiness setting after I change it in my init.d script. Should be fixable by just adding "sleep 15" above the tweaks to make it pause for 15 secs before setting them.

Not sure if this is just my phone, or if another app is trying to overwrite it. I think it's one of the tweaking apps though. Lemme know if anyone else experiences this. You can check swappiness by "cat /proc/sys/vm/swappiness"
 
Oh, also let me know if anyone's having issues with anything being killed by the lowmemkiller. This kernel has a hack in it that should covert the oom_adj values to oom_score_adj values without hacking the framework like most things do (v6 for instance does this). I'm not sure how effective it is, and if it's not I'm thinking of making a script based solution.

I may end up doing this anyway, as I know that if nothing else... my launcher isn't set to never be killed. I don't like that.

Basically, the way that I'm looking at doing this is by doing putting the process names (from ps) into an array, looping through them with 'ps | grep name' into a variable, grabbing the second token then setting /proc/{pid}/oom_adj and /proc/{pid}/oom_score_adj to negative values. This should ensure that android never tries to kill them off to free up memory.

This would namely be for things like the launcher, phone app ( I use go personally), lockscreen stuff (like widget locker) etc. The main catch is that you would need to manually get the names and edit the file. Personally, that's not a huge deal to me.

Obviously the lower the value the less likely things are to get killed off. I'm seeing some of the critical system processes with values in the -900's.

Lemme know if anyone has any interest in this. It might get cumbersome, and it may really be a bit un-needed since There's a LOT of free ram now. Mostly, if people are seeing things like the launcher getting killed off temporarily.


Sorry, I know that this isn't really *kernel* related specifically... but seemed like a good place to ask.
 
Back
Top Bottom