[Nexus 7 Original Development] _motley:
More info

last_kmsg

Please provide the dmesg output or last_kmsg if you experience any issues (random reboot or crashes) that you think are attributed to the kernel. I ask that you please test with the default/stock kernel first for your rom before you blame the issues on this kernel. Wait for the tab to reboot, or if it doesn't wait long enough so you can capture a good log. If you place this on your /sdcard, it will be easy to capture. Boot into recovery, flash this zip, and then flash a known kernel that works. Then reboot, and go grab the last_kmsg in /sdcard.

View attachment 1250388 (thanks go to CekMTL, I always keep this handy since you gave it to me!)

Voltage Control

What is voltage control?

It is simply allowing for the cpu voltage to be changed on the fly for each frequency step. CPU voltage is typically lowered (undervolting) for certain frequency steps to conserve power. For an overclocked device, some devices need more juice to be stable than others. Voltage control allows others not to pay this penalty and they can lower the voltage as they see fit for their device and usage needs.

Is undervolting safe?

If the lowered voltage values you enter are stable for the tablet, then absolutely it is safe.

What are the benefits?

Better battery life and less heat

Additional Info on voltage control

Only System Tuner is displaying the DVFS table frequency labels correctly and I recommend that you use this if you want to play with voltage control. SetCPU is showing the scaling frequencies when it displays them in the UI, some of which are for the LP core. This is not correct and is misleading, so it is best not to use it for this kernel.

Since the tools available only allow for tweaking one DVFS table (the high powered G cores), voltage control is not currently possible for the LP core. It is not needed anyhow IMO and setting it too low could result in SOD. There is more battery saving to be had with the G cores anyhow if you are into this sort of tweaking.

The frequencies shown may have two values for one frequency. This is how it came with the factory kernel as well and I have only tweaked the top end of the DVFS table. It may seem weird, but this gives us direct access to the DVFS table. I would recommend keeping it as a staircase, just like Nvidia has it even though some frequencies are listed twice.

The freqs shown in the System Tuner display will match the DVFS table for the cpu_process_id for your tablet (seen in the kernel log at startup). All tablets won't display the same frequencies. There are at least two maybe three or four variants we have found so far for the Nexus 7 with Tegra 3 SoC #7.

Also, some may not know, but the tegra3 kernel also has automatic UV using a "cold" zone in where 50mV undervolting is done automatically when the cpu is cool. Take this into consideration when playing around.

GPU OC

Valid max GPU frequency is 416 - 520 MHz. If you try higher or lower clock speeds, it will fail and remain unchanged.

Examples:

echo 484 > /sys/devices/system/cpu/cpu0/cpufreq/gpu_oc

echo 520 > /sys/devices/system/cpu/cpu0/cpufreq/gpu_oc

Performance Tweaks

These are a couple of tweaks that many are using for faster benchmarks and better battery performance. Google it and decide for yourself if you like the risk or not. I recommend that you do a full backup in recovery and regularly backup your /data partion or cloud sync if you enable these options. Will many run them daily as I now do, there is some additional risk. These can be added to scripts and automated via init.d or other apps/tools that support them.

To disable fsync for better battery and better disk i/o performance:

echo 0 > /sys/class/misc/fsynccontrol/fsync_enabled

To enable fsync for better data integrity (default)

echo 1 > /sys/class/misc/fsynccontrol/fsync_enabled

Faster disk i/o - remount /data partition with noauto_da_alloc option (google it, better battery, less data integrity)

mount -o remount,noauto_da_alloc /data /data

TCP Congestion Control Algorithms

Only one can be set at a time, so only add one of the lines to your script. Here are some examples:

echo "reno" > /proc/sys/net/ipv4/tcp_congestion_control

echo "veno" > /proc/sys/net/ipv4/tcp_congestion_control

echo "vegas" > /proc/sys/net/ipv4/tcp_congestion_control

echo "westwood" > /proc/sys/net/ipv4/tcp_congestion_control

zRAM

What is zRAM?

This is a mainline kernel feature for Compressed RAM block device support (CONFIG_ZRAM)

http://en.wikipedia.org/wiki/ZRam

Like many of the other tweaks done in the Android world, ZRAM is another one of them that is controversial, probably because people only think in terms of immediate performance they can measure easily with benchmarks etc. *Here is my take...think I will add this to the Q&A section as well.

But, will it make my device faster? Will I score higher on benchmarks?

It depends, but for normal usage, the answer is no. zRAM is most useful for those that are configuring Android to be a true multitasking workhorse. For example, if I enable zRAM, open an bunch of apps at one time, and actually start to work towards depleting the memory of the system. *For example, say I open system tuner, a browser with several tabs, a word processing app, a game, and perhaps a picture viewing app or a movie. If I don't formally close out of each one by hitting back and just begin switching between apps and the home screen, you will see zRAM start showing benefits.*

If you tweak the Android memory and swappiness settings, this can also be useful in this type of environment.

How do I know it is initialized and working?

You can type "free" from an command line and see the swap space.

Also, you can look at the disksize to see if it is initialized

cat /sys/block/zram0/disksize

To see how much it is being used in your environment, you can look at the output from:

cat /sys/block/zram0/num_writes

cat /sys/block/zram0/num_reads

So, unless you have a heavy workload as stated above, then it won't be of a lot of use for normal Android users.

How do I enable zram?

It must be enabled by a script. Some ROMs may support activating it. If you need to do it yourself you have two choices.

1) Save this to a file and run the script from terminal, Script Manager or System Tuner.

2) Or better yet, save this to a file called 90zram (or whatever you prefer) in /system/etc/init.d and automate it (The ROM's ramdisk needs to supports init.d)

#!/system/bin/sh
# auto zram activation init script with busybox search
# by show-p1984

echo "[90ZRAM]: Firing up /system/etc/init.d/90zram";

if [ ! -e /sys/block/zram0/disksize ] ; then
echo "[90ZRAM]: ERROR unable to find /sys/block/zram0/disksize";
echo "[90ZRAM]: Is this a ZRAM kernel?";
echo "[90ZRAM]: ZRAM NOT ACTIVATED. (404)";
else
#find busybox in /system
bblocation=$(find /system/ -name 'busybox')
if [ -n "$bblocation" ] && [ -e "$bblocation" ] ; then
echo "[90ZRAM]: busybox found in:" $bblocation;
echo "[90ZRAM]: Setting ZRAM disksize.";
echo $((100*1024*1024)) > /sys/block/zram0/disksize

echo "[90ZRAM]: Starting ZRAM...";
bblocation=${bblocation%/*}
cd $bblocation
./busybox mkswap /dev/block/zram0
./busybox swapon /dev/block/zram0

echo "[90ZRAM]: ZRAM activated.";
else
echo "[90ZRAM]: ERROR! busybox not found!";
echo "[90ZRAM]: Is busybox installed? Symlinks set?";
echo "[90ZRAM]: ZRAM NOT ACTIVATED. (404)";
fi
fi