5,597,397 Members 31,284 Now Online
XDA Developers Android and Mobile Development Forum

[KERNEL][3.0.101][LZ4][ZRAM][UKSM]Charm-Kiss (20140107,CM10 Support)

Tip us?
 
coldsorrow
Old
(Last edited by coldsorrow; 21st October 2013 at 11:27 AM.)
#1  
Senior Member - OP
Thanks Meter 128
Posts: 135
Join Date: Jul 2012
Location: Chengdu
Default [KERNEL][3.0.101][LZ4][ZRAM][UKSM]Charm-Kiss (20140107,CM10 Support)

Hi man, I present you a new kernel based on Titanium-Kiss and sync with arco's ics sources of linux 3.0.101.There are many new features.
(Because of my poor English,So I just used some describtions from K^Kernel [KERNEL][3.0.99][ICS] K^Kernel 3.0.99 v2.6 for ICS [10/10/2013])

Thanks For:
- maxwen,used his Titanium-Kiss as based
- Acro,Thanks for his sources for msm7x30 ics 3.0
- Christopher83,I learn a lot from His thread and souces.

Attension:
It's For Sense Now.Will Support CM10 in the future.
Advanced-3.0.101 is based on GoogleSouce(Here) and Acro's ICS 3.0 source (Here) and more experimental features.
Stable-3.0.16 is based on Titanium-Kiss (Here,almost htc stock sources) with stable features



The main features are the following:
  • Kernel 3.0.x sources synched with ics-3.0 repo of Arco68(Here)
  • Built with my custom Linaro 4.7.4-2013.09 toolchain optimized for Cortex-A8
  • Built with Cortex-A8 and NEON VFP optimization flags (both kernel and modules)
  • Built with -O2 optimization flag for kernel image and -O3 optimization flag for modules
  • CPU overclockable up to 2048 MHz
  • CPU frequencies undervolted (UV version)
  • CPU voltage control VDD sys interface
  • 376MB(Advanced)/356MB(Stable) of free RAM
  • Init.d support
  • Fast Charge support (default disabled)
  • Ram Console support (click for more details)
  • USB OTG support (if also implemented on rom side)
  • Increased CPU frequency during boot
  • Optimized AES and SHA1 routines for ARM cpu architecture
  • Optimized SLUB memory allocator
  • Optimized ARM RWSEM (read/write semaphore) algorithm
  • Optimized asynchronous I/O latency on solid state disks
  • Optimized string and memcopy libs
  • Filesystem dynamic read-ahead (based on disk size)
  • CIFS support
  • Fast Random generator (frandom) support (click for more details)
  • Dynamic FSync v1.2 (click for more details)
  • Dynamic dirty page writebacks (click for more details)
  • VM tweaks for performance and less battery consumption
  • Revised LowMemoryKiller parameters for better performance (click for more details)
  • Dynamic management of the minimal timer slack value during suspend/resume (click for more details)
  • LowMemoryKiller management of not killable processes (click for more details)
  • Sweep2Wake(S2W),DoubleTap2Wake(DT2W)Support for One V(Thanks to Maxwen)
  • Timer Slack From Linux 3.4 And Dynamic management of Timer Slack
  • Port LZ4 compression from 3.9 and make it work for zram and kernel Compression(More Fast than Snappy && Lzo)
  • Port zram ,zcache and zsmalloc from 3.9 and replace xvmalloc
  • Ultra KSM 0.12.2 ,more fast than KSM to free your memory.(see more here)

Available CPU governors:
- BrazilianWax
- Conservative
- Intellidemand(default)
- Interactive
- LionHeart
- OnDemand
- IntelliDemand
- Performance
- SmartAssV2
- SmartMax(From maxwen)
- Hyper
- Lulzactive

Available I/O schedulers:
- BFQ
- CFQ
- Deadline
- Noop
- ROW (default)
- Sio
- Sioplus

Dowload Link:
Click Here To MediaFire.com
The scripts of these features can also be found in the scripts folder.
Sources Link:
My Github

ChangeLog:

 

2014.01.07
1.Added CM10 Version
2.Some fix for permission error
3.more info see my github log
4.Strip the lib file to decrease the size

2013.11.02
1.Squashed update of kernel from 3.0.100 to 3.0.101
2.Fix cgroup error,Now you wont see error in logcat
3.SCHEDULER: Autogroup patch group by current user android UID instead of task ID
4.Rebuild with new source tree with acro,seems more stable and performance
5.CK3 tweaks (Credits to Con Kolivas)
6.Disable Cleancache that seems unstable now
7.Replace LZ4 with new module for zram.More performance Now
8.Only update Advanced version,the stalbe and cm10 version comes later.

2013.10.20
1.Squashed update of kernel from 3.0.99 to 3.0.100
2.Tuned Lulzactive governor for better battery saving
3.Added Hyper CPU Governor
4.Some optimizations to Hyper CPU Governor
5.Some fix about intellidemand
6.Only apply driver limits for scaling_min/max_freq writes
7.add SIOplus i/o scheduler
8.cfq, deadline, row tweaks (credits to Franco Dev Team)
9.Upstream Zram,ZSmalloc,Zcache to Linux 3.9 sources.
10.Try to enalbe cleancache and zcache.
11.Added OC version for Overclock,and normal version in my mediafire folder
(Guys you should give me some feedback.)

2013.10.18
1.Increased Pmem Value.And now everthings works well
2.Advanced Version Now have 376M Mem
3.Stable Version Now have 356M Mem just like stock and kiss does.
4.Add UKSM 0.12.2 to replace Ksm.(Disable as default)
(see more about UKSM here)

2013.10.16
1.Increased Pmem Adsp
2.Add BrazilianWax(Set to default) and Intellidemand governor
3.Add ROW I/O Sched and set to default
4.Add LZ4 Compression support
5.replace Snappy with LZ4 for zram,almost the best compression
5.Backport Timer Slack from Linux 3.4
6.Add The Dynamic management of Timer Slack
6.Backport Zcache and Zsmalloc fron Linux 3.4

2013.10.15

1.Pmem remapping again,fix hd camcoder problem
2.Add Frandom,Almost 10~20 faster than stock urandom.
3.Optimizised zram and lzo code ,update lzo to latesd version
4.Add advanced Version for 3.0.99,Stable Version for 3.0.16
5.Enable overclock to 2.0Ghz
6.Stable Version added Lagfree Governor
7.Patched up CRC32 Libraries (+Performance)
8.Some Arm feature added
9.Replace Xvmalloc with Zsmalloc for better performance

2013.10.07
1.Pmem Remapping,more mem for you guys
2.Add Dynamic Sync Control
3.Add Dynamic management of dirty page writebacks


2013.09.29
1.Add Google Snappy compression for zram (1.5~2x faster than lzo)
2.Revised LowmemeryKiller Valued
3.Build with custom Linaro 4.7.4-2013.09 toolchain optimized for Cortex-A8
4.Add LowmemeryKiller Whitelist support


XDA:DevDB Information
[KERNEL][3.0.101][LZ4][ZRAM][UKSM]Charm-Kiss For Sense (20131102) , a Kernel for the HTC One V

Contributors
coldsorrow, maxwen, Adi_Pat
Kernel Special Features: LZ4,ZRAM,3.0.101

Version Information
Status: Stable
Current Stable Version: Build #20131102
Stable Release Date: 2013-11-02

Created 2013-10-17
Last Updated 2014-01-10
The Following 44 Users Say Thank You to coldsorrow For This Useful Post: [ Click to Expand ]
 
thanhi
Old
#2  
Senior Member
Thanks Meter 19
Posts: 130
Join Date: Aug 2010
can i use this with http://forum.xda-developers.com/show....php?t=2400633 ?
 
coldsorrow
Old
(Last edited by coldsorrow; 18th October 2013 at 05:15 PM.)
#3  
Senior Member - OP
Thanks Meter 128
Posts: 135
Join Date: Jul 2012
Location: Chengdu
Special features and sysfs settings:
You can find the useful scripts in my mediafire.com.Or you can use Performance Controller App(click here for more).Th Trickster Mod which can be installed from Google Play is also works fine.


CPU voltage control VDD sys interface
This feature allows to customize the voltage assumed by each cpu scaling frequency.
It could be useful if you'd like to decrease one or more voltages for battery saving purposes (undervolting), or to increase/adjust them to prevent phone freezes (overvolting).

How to customize the voltages:
 

1) By downloading and using Trickster MOD or IncrediControl and changing the voltages table inside the SVS tab
2) By using customized init.d scripts (the custom values will be always restored after a reboot, if you don't format the system partition)
- Download one of the script named 01vdd_levels*
- If the file has been saved with .txt extension (stock browser), rename it by removing the .txt extension
- Edit the file by setting your customized voltages, where each line has this syntax
Code:
Code:
echo "cpu_freq_HZ mV" > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
cpu_freq_HZ is the cpu frequency in Hz you'd like to change
mV is the voltage you want to set

For example, the following line means that when the cpu frequency is 1516800 Hz = 1516 MHz, the voltage used will be 1175 mV
Code:
Code:
echo "1516800 1175" > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
- Copy the new file inside /etc/init.d
- Give the rwxr-xr-x permissions to the file (read, write, execution for owner, read and execution for group users, read and execution for others)
- Reboot
3) By using Terminal Emulator (note that the values you set will be lost after a reboot/shutdown)
- Open Terminal Emulator
- Run these commands
Code:
Code:
su
# Run a command for each cpu frequency voltage you'd like to change
echo "cpu_freq_HZ mV" > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
cpu_freq_HZ is the cpu frequency in Hz you'd like to change
mV is the voltage you want to set

For example, the following line means that when the cpu frequency is 1516800 Hz = 1516 MHz, the voltage used will be 1175 mV
Code:
Code:
echo "1516800 1175" > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels


Force Fast Charge
This feature allows you to force AC charging for any charger that is detected as USB (eg. PC USB ports, USB Car Chargers) and pull the full current the charger can support, in such a way as to speed up the time required for a complete battery recharge.
By enabling this feature, the USB / ADB data transfers will be disabled (security limitation to protect your data).

How to enable/disable the Force Fast Charge:
 

1) By directly editing the file /sys/kernel/fast_charge/force_fast_charge and setting 1 to enable the force charge, 0 to disable it (note that set value will be lost after a reboot/shutdown)
2) By using Terminal Emulator (note that set value will be lost after a reboot/shutdown)
- Open Terminal Emulator
- Run this command to enable the force fast charge feature
Code:
Code:
su
echo 1 > /sys/kernel/fast_charge/force_fast_charge
- Then, when you want to restore the normal status, run this command to disable the force fast charge feature
Code:
Code:
su
echo 0 > /sys/kernel/fast_charge/force_fast_charge
4) By using a customized init.d script, but I don't recommend it because you have to remember to disable the feature every time you want to connect your device to a pc for data transfering after every reboot



LowMemoryKiller
The LowMemoryKiller driver is used to kill a selected process and free the memory when it is under one of the defined thresholds.
The tuning of the driver could be achieved by means of two parameters exposed by the kernel module via sysfs interface:
 

- /sys/module/lowmemorykiller/parameters/minfree
This file includes a comma separated array of the threshold numbers for minfree memory size (in page units).
The parameter value set for Charm-Kiss is "2048,3584,19200,23040,24320,32000".
- /sys/module/lowmemorykiller/parameters/adj
This file includes the comma separated array of oomadj factors, if the corresponding minfree threshold has been reached, one of the process with an oomadj greater than this number will be killed.
The oomadj factor is a property associated to each process, its value is in a range from -17 to +15, the processes with a higher oom_adj factor will be the first to be killed when a specific minfree threshold has been reached.
And when you type your value in,the system wll auto turn it to oom_score_adj which is from 0 to 1000.
The parameter value set for Charm-Kiss is "0,176,352,588,705,1000".


Frandom - Fast Random Generator
As Eli Billauer (the creator of this module) said, Frandom is a Linux kernel random number generator, which is 10-50 times faster than what you get from Linux built-in /dev/urandom. And it uses very little (/dev/frandom) or none (/dev/erandom) of the kernel's entropy pool, so it is very useful for applications that require a handy source for lots of random data.


RAM Console
This feature is useful expecially for development and debugging purposes, when occurs kernel panic / unexpected shutdowns or reboots. Pratically, the kernel messages are also stored inside a little RAM portion and restored during reboot after a kernel panic, inside the file /proc/last_kmsg.

Dynamic FSync
This feature has been developed by Faux123 and allows to dynamically manage the synchronous writes performed on file system (FSync).
It uses asynchronous writes when the screen is on, instead of synchronous writes, to have better performance and a slightly lower battery drain, while when the screen is off the synchronous writes are re-enabled to flush all the outstanding writes and prevent possible data loss.

How to enable/disable the Dynamic FSync (default enabled):
 
1) By downloading and using Trickster MOD
2) By directly editing the file /sys/kernel/dyn_fsync/Dyn_fsync_active and setting 1 to enable the dynamic fsync, 0 to disable it (note that set value will be lost after a reboot/shutdown)
3) By using Terminal Emulator (note that set value will be lost after a reboot/shutdown)
- Open Terminal Emulator
- Run this command to disable the dynamic fsync feature
Code:
Code:
su
echo 0 > /sys/kernel/dyn_fsync/Dyn_fsync_active
- Or run this command to re-enable the dynamic fsync feature
Code:
Code:
su
echo 1 > /sys/kernel/dyn_fsync/Dyn_fsync_active


Dynamic dirty page writebacks
This feature has been developed by me and allows to dynamically manage the dirty page writebacks with two different intervals, one when the screen is on and another when the screen is off.
It is based on a commit of Francisco Franco, but instead of using hard coded values and of disabling at all the dirty page writebacks while the screen is on (possibility of data loss), I preferred to use a customizable higher dirty page writebacks interval (15 seconds) than the default one (5 seconds) while the screen is on and a customizable default interval (5 seconds) when the screen is off.
By using a higher interval we have better performance and less battery consumption, with a very low risk of data loss.

How to customize the dynamic dirty page writebacks feature (default enabled):
 
Three new procfs parameters are exposed inside /proc/sys/vm path:
- dynamic_dirty_writeback is the activation status of this feature, set 1 to enable it, set 0 to disable it and use the standard behaviour
- dirty_writeback_active_centisecs is the interval for the dirty page writebacks when the system is active (screen on), the default value is 1500 centisecs (15 seconds)
- dirty_writeback_suspend_centisecs is the interval for the dirty page writebacks when the system is suspended (screen off), the default value is 500 centisecs (5 seconds)

In my kernel builds, during boot, I set other customized values:
- an interval of 25 seconds while the screen is on
- an interval of 15 seconds when the screen is off

1) By directly editing one of the file written above inside /proc/sys/vm and setting the preferred value (note that set value will be lost after a reboot/shutdown)
2) By using Terminal Emulator (note that set value will be lost after a reboot/shutdown)
- Open Terminal Emulator
- Run this command to disable the dynamic dirty page writebacks feature
Code:
Code:
su
echo 0 > /proc/sys/vm/dynamic_dirty_writeback
- Or run this command to re-enable the dynamic dirty page writebacks feature
Code:
Code:
su
echo 1 > /proc/sys/vm/dynamic_dirty_writeback
- Run this command to set customize the two intervals (30 seconds while the screen is on, 10 seconds when the screen is off)
Code:
Code:
su
echo "2500" > /proc/sys/vm/dirty_writeback_active_centisecs
echo "500" > /proc/sys/vm/dirty_writeback_suspend_centisecs


Ultra-Kernel Samepage Merging(UKSM)
UKSM is more optimized and also working for single core systems. using this should give much better ram usage, but at the cost of more cpu usage.
After you reboot with our uksm enabled kernel, uksm works as a system daemon "uksmd". The main interfaces for uksmd are under
Code:
/sys/kernel/mm/uksm
How to use it ?
 

Uksm is smart. For most of the time, you only need to adjust cpu_governorand max_cpu_percentage for cpu consumption control.
The meaning of each file in this directory is as below:
user controllable interfaces:
run : The main control interface to stop/run.
Code:
su
echo 1 > /sys/kernel/mm/uksm/run
sleep_millisecs: how long will uksmd sleep before it wakes up and does its work.
cpu_governor: The macro governors for controlling how aggressively the uksmd uses CPU. You can do cat cpu_governor to find out the available governors and which is currently active.
Code:
[full] medium low quiet
shows that currently it works at full speed. These governors roughly stand for 90%, 50%, 20%, <1% of max CPU consumption and some pre-setting of micro-control parameters.
(NOTE: for max it means only when uksmd is working at memory areas with many many redundancy pages. For most of the time uksmd is very quiet)
max_cpu_percentage: The max CPU consumption you can further specify under some cpu governor. It's used when you are not happy with the preset values.

read-only interfaces:
<ul>
<li>full_scans: how many times uksmd sampling has covered all of your memory areas.</li>
<li>hash_strength: the current hash strength for adaptive-random-sampling hashing algorithm. The lower the faster uksmd gonna merge pages. Its range is 1 ~ 1034.</li>
<li>pages_scanned: how many pages has been scanned.</li>
<li>pages_shared: how many pages has been mapped by different page table entries, i.e. shared by different processes.</li>
<li>pages_sharing: this is roughly the number of redundant pages you have saved, with uksm.</li>
<li>sleep_times: how many times uksmd has waken up and then got sleep.</li>
<li>Since version of 0.1.1,the pages with full zeros will considered specially and seperately. You can get the information for uksmd merged zero pages by
Code:
cat /proc/meminfo | grep KsmZeroPages
</li>
Scripts Kids?Maybe
The Following 7 Users Say Thank You to coldsorrow For This Useful Post: [ Click to Expand ]
 
MameTozhio
Old
#4  
MameTozhio's Avatar
Recognized Contributor
Thanks Meter 1236
Posts: 2,193
Join Date: Apr 2013
Location: not stockholm
Wow awesome!! Can I use this as default for HTCdroid?
HTC One V (August 27th 2012 - August 3rd 2013, still own) -> LG Nexus 4 (August 3rd 2013 - January 11th 2014, still own) -> Nokia Lumia 520 (January 11th 2014 - present)
 
tonyryan
Old
#5  
tonyryan's Avatar
Senior Member
Thanks Meter 691
Posts: 165
Join Date: Aug 2012
Location: Donetsk

 
DONATE TO ME
what difference between advanced, stable, etc.?
 
coldsorrow
Old
#6  
Senior Member - OP
Thanks Meter 128
Posts: 135
Join Date: Jul 2012
Location: Chengdu
Quote:
Originally Posted by MameTozhio View Post
Wow awesome!! Can I use this as default for HTCdroid?
Yep....You can use it for any rom as default.I dont own it
Scripts Kids?Maybe
The Following 2 Users Say Thank You to coldsorrow For This Useful Post: [ Click to Expand ]
 
MameTozhio
Old
#7  
MameTozhio's Avatar
Recognized Contributor
Thanks Meter 1236
Posts: 2,193
Join Date: Apr 2013
Location: not stockholm
Quote:
Originally Posted by tonyskyfall View Post
what difference between advanced, stable, etc.?
advanced = linux 3.0.99
stable = linux 3.0.16
HTC One V (August 27th 2012 - August 3rd 2013, still own) -> LG Nexus 4 (August 3rd 2013 - January 11th 2014, still own) -> Nokia Lumia 520 (January 11th 2014 - present)
 
coldsorrow
Old
#8  
Senior Member - OP
Thanks Meter 128
Posts: 135
Join Date: Jul 2012
Location: Chengdu
Quote:
Originally Posted by tonyskyfall View Post
what difference between advanced, stable, etc.?
Advanced is based on Googlesouces 3.0.72 and Acro Souces 3.0.99 and more experimental feature.
Stable is based on Titanium-Kiss with stable feature.

Can anyone tell me how to make first post and second post for me ?
I just wanna add some feature describtions.But you guys just used it...

WTF,the damned network
Scripts Kids?Maybe
The Following User Says Thank You to coldsorrow For This Useful Post: [ Click to Expand ]
 
coldsorrow
Old
#9  
Senior Member - OP
Thanks Meter 128
Posts: 135
Join Date: Jul 2012
Location: Chengdu
Sorry Guys,my network is too bad to update.
Will update the informations in the nights.
If you wanna see more,just click http://blog.leoysen.tk/charm-kiss/
And features infromations.

I'm using it almost ten days and so fast and smooth for me.
Scripts Kids?Maybe
The Following User Says Thank You to coldsorrow For This Useful Post: [ Click to Expand ]
 
thanhi
Old
#10  
Senior Member
Thanks Meter 19
Posts: 130
Join Date: Aug 2010
Charm-Kiss-20131017-Advanced-3.0.99.img
I use this kernel with Ignorance v3 ... works well.
But something wrong with wifi, connected but not received like no internet, browser, playstore...
when i reflash TK kernel wifi is nomal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes