FORUMS
Remove All Ads from XDA

[Kernel] [froyo] leanKernel: minimalistic kernel, v2.6.0 sense 6/5/11

2,448 posts
Thanks Meter: 8,862
 
Post Reply Email Thread
This is a minimalistic Thunderbolt kernel based on the HTC Incredible S source (vivo-2.6.35.9), then upgraded to 2.6.35.13. Some of the code is backported from latest linux (2.6.39). See FEATURES section for more details on how awesome this is.

SENSE - ALL FROYO ROMS
1) lean: stripped down and minimalistic. undervolt/overclock/slots are now controlled by the "speedtweak.sh" script (more info below)
2) special edition: slightly less lean. Supports in-call recording, and TUN. "speedtweak.sh" script also available.
3) 184Mhz: lean version with 184Mhz enabled (but locked by default). You may experience battery drain or overheat when you unlock the slot.

SENSE KERNEL DOWNLOADS (ALL ROMS EXCEPT CM7):
1) lean, 2) special edition, 3) 184Mhz

speedtweak.sh
This script will allow you to "transform" your kernel into normal, extreme, 1.92, 1.92X and battsaver versions (ie. it allows you to control speed, voltage, and slots to a certain degree). Once you run the script, everything will be self-explanatory. To run the script:
1) Open Terminal Emulator (install it from market if you don't have it).
2) Type "su" (without quotes) and hit enter.
3) Type "speedtweak.sh" (without quotes) and hit enter.
Quote:

leanKernel kernel speed tweaker
------------------------------_
1) normal: undervolted, overclocked to 1.41Ghz
2) extreme: extremely undervolted, overclocked to 1.41Ghz
3) 1.92: undervolted, overclocked to 1.92Ghz
4) 1.92X: extremely undervolted, overclocked to 1.92Ghz
5) battsaver: extremely undervolted, not overclocked

6) Unlock 184Mhz
7) Lock 184Mhz
8) View current settings

Please type 1, 2, 3, 4, 5, 6, 7, or 8:

speedtweak.sh and SetCPU
The risk of running setcpu is that it can inadvertently override the min and the max that were set by the speedtweak script. (oh it can also override the governor setting but that's not as bad). Other than that it's pretty harmless - it can't mess with the voltage settings. So if you're going to use SetCPU, keep this in mind. One way to make this work is to use SetCPU to configure governor and min/max, and use speedtweak.sh to configure voltage settings. Or just don't use SetCPU.

FEATURES
  1. Linux Kernel v2.6.35.13. This is many revisions newer than the stock tbolt linux kernel. Majority of kernel code such as memory management, file systems, network, kernel base, etc were mostly completely re-written and are either identical or very similar to latest linux kernel (2.6.39).
  2. speedtweak.sh script to adjust clock frequencies and voltages.
  3. Completely reworked on-demand governor (backported from linux-2.6.39-rc2) for better performance and power efficiency.
  4. Heavily modified/optimized smartass code (based on erasmux's latest git).
  5. InteractiveX and ondemandX governors! Added my own suspend code to interactive and ondemand code to make the phone lock at low clock speed when screen is off. No need for sleep setcpu profile anymore.
  6. For 1.92Ghz builds, interactiveX and smartass governors were modified to minimize unnecessary spikes above 1.8Ghz to keep phone stable.
  7. My kernel tweaks directly applied to kernel and ramdisk via code changes. ie. vm, minfree, etc. No more sysctl and init.d shenanigans!
  8. No EXT2, TUN, FUSE, YAFFS/2, etc. Stripped down and lean!
  9. backported 2.6.35 wifi driver which includes low power mode! (idle wifi consumes 50% of power than stock wifi driver). Sense only.
  10. low # (5-10) of cpufreq slots for simple management and less governer transitions.
  11. Undervolted *drastically* for longer battery life.
  12. SWAP and EXT4 enabled.
  13. Increased readahead buffer.
  14. init.d enabled in ramdisk
  15. filesystem speedup in ramdisk
.. a few other small optimizations

BATTERY SAVING TIPS
1) Install one of my kernels, 2) Stay on WIFI as long as possible (ie. avoid 3g/4g as much as possible).

CHANGELOGS (SENSE)
v0.1 - initial beta release (testers are welcome!)
v0.2 - fixed quadrant/linpack scores! (apparently my own overclocking code was kinda lame - borrowed code from richardtrip for now - more changes in the future).
v0.3 - added MD back in (needed for a2sd), undervolted the crap out of it especially lowest frequency which is where your phone spends most of its time, added /tmp tmpfs support, disabled install-recovery so init.d scripts don't run twice.
v0.4 - removed YAFFS/2 (shaved off 2Kbytes), added 460800 clock speed, removed powersave governor.
v0.5 - increased readahead buffer to 1024KB (should improve I/O, especially for sdcard), created lame and 1.92Ghz versions.
v0.6 - Reworked on-demand governor, backported from linux-2.6.39-rc2, which includes massive amount of improvements and fixes.
v0.7 - Added 122880 at 550 VDD for extended battery life. Went back to my own overclock code (for the most part) without losing speed.
v0.71 - fixed a bug preventing the 1.92 version from booting. Cleaned up some overclock code and adjusted VDD a bit on some of the clock speeds. Changed file names which make better sense now.
v0.72 (extreme version only) - got rid of 123Mhz. good riddance! Undervolted some more.
v0.72 (1.92) - fudged around the VDD to stabilize it for difficult phones.
v0.8 - Implemented smartass governor (based on erasmux's latest, optimized code for my kernel), reworked conservative governor (backported from latest linux source), added 1.79Ghz slot for 1.92 version, removed EXT4 until I have a reliable way to convert filesystems, brought back LOGGER until i'm done debugging stuff, more VDD tweaks, and filesystem speedups in ramdisk.
v0.85 - reworked overclock code, tweaked VDD some more to stabilize. added audio & battery tweaks from adrynalyne per popular requests
v0.9 (4/13/11) - removed profiling for extra speed, reworked slab allocator (backported from 2.6.39-rc2), backported 2.6.35 wifi driver (low power mode!), added battsaver version, optimized the heck out of smartass for power efficiency, disabled a couple of debug stuff for smaller kernel, removed performance governor.
v0.92 (4/14/11) - fixed smartass performance (should be close to ondemand now), changed default i/o scheduler to noop and removed other i/o schedulers (even leaner!)
v1.0 (4/15/11) - introducing interactiveX governor (interactive + my own suspend code), heavily optimized smartass code (again), undervolted 1.92X a little more at the top end, removed conservative governor, made interactiveX default, went back to deadline i/o scheduler (was causing issues with 1.92 overclock).
v1.1 (4/18/11) - ondemandX governor (ondemand + my own suspend code to keep phone under 369Mhz when screen is off), modified interactiveX and smartass governors to prevent unnecessary spikes over 1.8Ghz to stabilize my 1.92 builds, extreme/1.92X/battsaver now all share the same VDDs at and below 1024Mhz, OC/UV code re-written again to smooth out transitions and reduce random reboots, and added one more slot to 1.92 builds.
v1.11 (4/19/11) - fixed smartass to suspend properly (ONLY NEED TO UPDATE IF YOU'RE USING SMARTASS).
v1.2.3 (4/27/11) - fixed 1Ghz speed, removed more unnecessary components for leaner kernel, GPU+ patch from CM.
v2.0.0 (5/5/11) - brand new kernel base (2.6.35) - mostly new code. Extreme,battsaver, and 1.92X have an extra slot at 184Mhz/650VDD for better battery life.
v2.0.1 (5/5/11) - extreme, 1.92X and battsaver only. Fixed lowest clock undervolting.
v2.1.0 (5/6/11) - 184Mhz battery draining fixed, flashlight brightness fixed, EXT4 enabled
v2.1.1 (5/8/11) - 184Mhz slot disabled by default (use the enable_lowslot.zip to re-enable it), filesystem speedup in ramdisk, full kernel version names.
v2.2.0 (5/8/11) - revamped governors to possibly improve battery life while on 3g/4g (fingers crossed), brought back readahead buffer tweak from my mecha kernels.
v2.4 (5/10/11) - combined all my kernel flavors into one, speed/voltage can be controlled by speedtweak.sh script, added vdd_levels support (code from snq- via adrenalyn's git), kernel upgraded to 2.6.35.13.
v2.4.1 (5/11/11) - enhanced speedtweak.sh to include governors and show current mode. EXT4 mounting is now enabled for EXT3 partitions. Temporarily added a 246Mhz version until I get in touch with setcpu folks.
v2.4.2 (5/11/11) - fixed 184Mhz (sorry about that)
v2.4.3 (5/11/11) - fixed speedtweak settings not sticking at reboot (sorry about that!!)
v2.4.4 (5/12/11) - made a tiny change to speedtweak script to require you to hit enter before the screen loops back. Purely aesthetics - optional upgrade.
v2.4.6 (5/12/11) - reverted to EXT3, EXT4 was killing quandrant scores. Will bring back EXT4 after more testing.
v2.5 (5/14/11) - reworked interactiveX for better performance and power efficiency, removed 184Mhz from lean version, created a separate 184Mhz version, enhanced speedtweak script (added time-in-state), enhanced filesystem mount options for speed.
v2.5.1 (5/16/11) - reverted interactiveX wake speed, added a setcpu friendly option to speedtweak.sh.
v2.6.0 (6/5/11) - in-call recording added by default, overclock code reworked, interactive/smartass governor tweaked, speedtweak.sh script enhanced.

DIRECTIONS
Uh.... flash the zip in clockworkmod. No need to wipe anything.

GOVERNORS
First, my take on the governors that are out there: http://forum.xda-developers.com/show...&postcount=617
I offer three governors: interactiveX, ondemandX, and smartass. What are they?
  • interactiveX - it's the interactive governor from CM, but I added suspend/wake logic so when the phone screen is off it runs at 246Mhz. Also, I modified its code some more to minimize unnecessary cpu spikes above 1.8Ghz if you happen to be running one of my 1.92 kernels. Most tbolts are unstable above 1.8Ghz, and it's the quick jump above 1.8Ghz that usually locks up the phone. It will hit 1.92Ghz only when it makes sense (ie. sustained high load). This is my favorite governor - perfect combination of speed and power efficiency.
  • ondemandX - ondemand governor code from latest linux source *plus* the suspend/wake logic described above, except it has the ability to ramp to 369Mhz while screen is off. No additional code was added for stabilizing above 1.8Ghz.
  • smartass - smartass code from erasmux, but I wasn't happy with its performance so I tuned it for quicker ramp up in speed. It has the same suspend/wake logic as ondemandX, and the same >1.8Ghz stabilizing mod as interactiveX.

FAQ
1) Why 1.41Ghz? - my kernel's 1.41 runs very close to stock voltage at 1Ghz, and with the other frequencies undervolted you should realize longer battery life. If you go any higher, you're going to experience poor battery life since you need to use more juice to support higher frequency. Plus most of you probably can't tell the difference between 1.4 and 1.8.
2) Why release so often? - I try to minimize # of changes to at most 2-3 per release so we can easily pinpoint any benefits or harm my code changes or tweaks made.
3) What is enable_swap.zip and why do i need it? - Flashing the zip will create a 200MB swap file (at next boot) and activate the swapfile on every boot. Completely optional. Read more about it here.

bitbucket: https://bitbucket.org/imoseyon/leank...bolt-aosp-vivo, https://bitbucket.org/imoseyon/leank...olt-sense-vivo



Donate to your favorite charity, or donate to me.
Attached Files
File Type: zip disableswap.zip - [Click for QR Code] (140.9 KB, 423 views)
File Type: zip enable_swap.zip - [Click for QR Code] (141.8 KB, 1206 views)
File Type: zip make_smartass_default.zip - [Click for QR Code] (141.6 KB, 301 views)
File Type: zip make_battsaver.zip - [Click for QR Code] (141.7 KB, 293 views)
File Type: zip make_extreme.zip - [Click for QR Code] (141.7 KB, 271 views)
File Type: zip make_interactiveX_default.zip - [Click for QR Code] (141.6 KB, 349 views)
The Following 68 Users Say Thank You to Imoseyon For This Useful Post: [ View ]
 
 
4th April 2011, 06:33 AM |#2  
Senior Member
Flag Pacoima
Thanks Meter: 44
 
More
I'll b testing tonight will report in the morning thanks!
4th April 2011, 06:42 AM |#3  
Senior Member
Flag Pittsburgh
Thanks Meter: 353
 
Donate to Me
More
Sounds amazing. Will flash ASAP!
4th April 2011, 06:45 AM |#4  
aestibar's Avatar
Member
Flag Vancouver, WA
Thanks Meter: 20
 
Donate to Me
More
i will test too!
4th April 2011, 06:50 AM |#5  
Senior Member
IL
Thanks Meter: 56
 
More
flashing now...
4th April 2011, 06:52 AM |#6  
Imoseyon's Avatar
OP Recognized Developer
Flag Mountain View, CA
Thanks Meter: 8,862
 
Donate to Me
More
Cool let me know how it goes guys. I come from the Linux server world and hope to bring some fresh approaches to the already established/mature android kernel scene.
4th April 2011, 06:53 AM |#7  
Senior Member
IL
Thanks Meter: 56
 
More
will this override your tweaks or do nothing since they're already on the phone? i've had em installed since you posted em..
4th April 2011, 06:55 AM |#8  
Member
Flag The Colonies.
Thanks Meter: 10
 
More
Just for clarification, when you say no "LOGGER", this is something separate from what is used to generate the system logs to produce a logcat right?

Sent from my ADR6400L using Tapatalk
4th April 2011, 06:59 AM |#9  
Imoseyon's Avatar
OP Recognized Developer
Flag Mountain View, CA
Thanks Meter: 8,862
 
Donate to Me
More
Quote:
Originally Posted by MYxdaUSERNAME

will this override your tweaks or do nothing since they're already on the phone? i've had em installed since you posted em..

So my tweaks zip becomes redundant, more or less. You no longer need them.
4th April 2011, 07:00 AM |#10  
Senior Member
IL
Thanks Meter: 56
 
More
cool, gonna run this for a day and report back. quadrant is way down, but the phone feels just as snappy...any chance of adding something around 400 to use as a min setting?
4th April 2011, 07:00 AM |#11  
Imoseyon's Avatar
OP Recognized Developer
Flag Mountain View, CA
Thanks Meter: 8,862
 
Donate to Me
More
Quote:
Originally Posted by ShanDestromp

Just for clarification, when you say no "LOGGER", this is something separate from what is used to generate the system logs to produce a logcat right?

Sent from my ADR6400L using Tapatalk

LOGGER = logcat. If you're an advanced user, i think dmesg might be good enough for some troubleshooting. If there's enough demand for logcat, i can release another kernel called SlightlyLessLeanKernel.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes