[HTC One V] coldsorrow:
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:

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:

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:

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:

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:

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:

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:

su
echo 0 > /sys/kernel/dyn_fsync/Dyn_fsync_active

- Or run this command to re-enable the dynamic fsync feature

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:

su
echo 0 > /proc/sys/vm/dynamic_dirty_writeback

- Or run this command to re-enable the dynamic dirty page writebacks feature

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:

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

/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.

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.

[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

cat /proc/meminfo | grep KsmZeroPages

</li>