There are a few reports out there saying that this will work on the new Gingerbread including version 4.5.588 (newest leak)
Read, make a backup, and enjoy
Listen up everyone! Since the release of Liberty 1.0, JRummy16 also released a new app in the market called Sysctl Config, which gave users an interface to manually edit and tweak the sysctl.conf file. Alongside this, Liberty made it easier to configure the sysctl.conf file using the integrated menu option under Liberty Settings without the use of the app. So what we are going to do, is explore what sysctl is how we can benefit from tweaking these settings.
Please take special note! That any ROM can utilize these sysctl.conf tweaks, not just Liberty, and rooted stock as well.
(You must be rooted and have busybox installed for this to work on stock)
So what is the purpose of this thread? And what is Sysctl.conf all about?
First of all, we are going to explore what sysctl.conf is.
Second of all, we are going to explore what sysctl.conf does, and what it can do for your phone.
Lastly, we are going to explore how sysctl.conf works and what kind of benefit is has on the Android OS.
Now, before we get started, we need to clear something up! The tweaks and modifications we will discuss in this thread, WILL NOT IN ANYWAY INFLUENCE BENCHMARK SCORES SUCH AS QUADRANT! Benchmark apps are meant to measure hardware performance only and are in no way affected by these tweaks and modifications, but make no mistake! You will notice at least a slight increase in Android's performance and a possible increase in battery life as well.
Another thing that everyone needs to know is that the Android OS is a Linux based operating system, so there will be a lot of references to Linux, just so you are not confused.
So lets get started shall we?!?!
Ok, so first of all, let’s explore what sysctl.conf is.
The sysctl.conf is a configuration file for "sysctl" which is an interface for dynamically changing kernel parameters in the Linux OS. The configuration file contains the following elements, vm.min_free_kbytes, vm.dirty_ratio, vm.dirty_backgroud_ratio, vm.vfs_cache_pressure, vm.oom_kill_allocating_task. There are many other elements within the file, but we will be primarily focusing on these specifically (the vm prefix stands for virtual memory). The sysctl.conf file should be located in /etc (/system/etc) by default. To enable it you need your ROM to execute "sysctl -p" somewhere during the boot process (or shortly afterward). We will also be discussing how to enable it if it is not already done so. You can also run sysctl -p manually to enable it any time after the OS is started.
Now, let’s get down to what sysctl.conf does and how it works.
Min Free KBytes (vm.min_free_kbytes) - This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Default is 2048kb.
Dirty Ratio (vm.dirty_ratio) and Dirty Background Ratio (vm.dirty_background_ratio) control how often the kernel writes data to "disk" (in our case the internal microSD system card, not the removable microSD card). When your apps write data to disk, Linux actually doesn't write the data out to the disk right away, it actually writes the stuff to system memory and the kernel handles when and how the data is actually going to be flushed to the disk. These values represent a percentage, the higher the percentage, the longer it waits to flush, the lower the percentage, the more often flushes will occur. Now remember, we are dealing with solid state storage, not the traditional disk platter and spindle. So we are actually able to delay flushes a little longer with solid state versus a traditional hard drive disk.
VFS Cache Pressure (vm.vfs_cache_pressure) -Now here is where it gets interesting! File system cache (dentry/inode) is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increas the performance of the system without sacrificing performance at the application level. The default value is 100, as a percentage, and what you want to do is lower the value to tell the kernel to favor the file system cache and not drop them aggressively.
Oom Allocating Task (vm.oom_kill_allocating_task) (enable or disable, generally in Linux this value is either a "1" or a "0," representing as on or off.) -This enables or disables killing the OOM-triggering task in out-of-memory (oom) situations. If this is set to zero, or disabled, the OOM killer will scan through the entire task list and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to non-zero, or enabled, the OOM killer simply kills the task that triggered the out-of-memory condition. This avoids the expensive task list scan, which can take mass amounts of time and "hang" or freeze the system.
This information has been pulled from the following sites:
http://www.imoseyon.com/2011/05/dxd2-tweaks-new-version-man-its-been.html (newest)
imoseyon: Sysctl tweaking for faster, longer lasting Android (deprecated)
imoseyon: sysctl (and minfree) tweaks revisited (deprecated)
/proc/sys/vm | LinuxInsight (deprecated)
How to edit the values manually, follow these steps (in Liberty ROM and others set up in a similar manner):
1) First enable sysctl from Liberty settings, if you are on Liberty
2) Run Root Explorer
3) Modify /data/liberty/init.d.conf to make sure that sysctl is enabled ("sysctl = 1")
4) Go to /system/etc/, and mount it r/w
5) Modify sysctl.conf by long pressing the sysctl.conf file and selecting "Open in Text Editor." When finished, save the file and exit
6) Run Terminal Emulator
7) Type "sysctl -p" (output should confirm whether you've done step 4&5 correctly)
(Soon to come, how to enable if your ROM does not support sysctl, which will require much more tweaking.)
If you want to check to see if your changes take hold after reboots, run this in Terminal Emulator:
sysctl -a| grep vm
This command will give you all the sysctl values, scroll down to find the ones you edited and verify that they are the same values you changed them to.
Now, if you are not on Liberty, to check to see if your ROM supports sysctl, use Root Explorer (app found in the Market) to navigate to the following directory:
/etc/
In this directory should be a file named "sysctl.conf." If it is not there, use the search function to search for "sysctl."
To edit this file, make sure system is r/w, then long press on the file and choose "Open in Text Editor." Now you can edit these values to your liking to see what works best and what doesn't. Root Explorer will back up the file each time you make changes, but only backs up the most current changed file, so always make sure you know what your default values where to begin with.
After you had made your changes, reboot your phone, then open up terminal emulator and type in "sysctl -a| grep vm" to see if your changes too hold.
************************************************** ***********************************************
Now, if you want the easy way out, our good friend Marius (imoseyon) has been great, and created a flash-able .zip that does all of the work for you!
The .zip can be found here, at Marius' blog titled "imoseyon."
When you flash the .zip file, in Bootstrap Recovery, the following will take effect, and please note, any settings you may have altered, will be overwritten!
Now, this mod is pretty universal, but as always, make a backup. Some ROM's such as "rubiX" do not really benefit from this mod, I have tested this, and the way "rubiX" is codded, the stock "rubiX" ROM is fast enough on its own, so rubiX users, give it a try if you must, but make a back up and keep an eye on your phone on how it performs. Here is what drod2169 had to say, with much respect to Marius:
Applying the .zip will do the following:
1. Install BusyBox 1.18.0 (in an alternate location)
2. Enables cron, which is a Linux time-base job scheduler
3. Tweaks certain kernel elements (vm, minfree, etc.)
4. Tweaks build.prop (on some ROMs)
5. Flushes system caches once a day (1AM PT)
6. Enables new governor
So Marius had a chance to create one zip to rule them all. No more maintaining four different versions. The new zip contains a script that runs when you flash it the first time to determine what needs to be enabled and makes the necessary changes regardless of which ROM you're on.
Here is the change log for the universal .zip:
What to expect - hopefully faster, more stable, and longer lasting TB/DX/D2.
How to check if the mods are in effect: 1) Launch Terminal Emulator, 2) Type "bash /data/imoseyon/checkimosey.sh", without the quotes and hit enter.
How to remove my mods: remove /etc/init.d/99imoseyon and reboot.
(Keep in mind that this is a work in progress and your mileage WILL vary.)
More details
DownloadsChange LogsA small side note - I have a slightly crippled version for D1 users. Currently it works only on D1 ROMs that support init.d. thanks for testing, Jason! Download
- v6.2.1 - fixed a bug in check script.
- v6.2 - added swap support (if your kernel supports swap, ie thunderbolt). Run "sh /data/imoseyon/swap.sh create" to enable.Blog post on this.
- v6.1.4 - made enable script more robust for more ROMs. No need to flash if yours is already working.
- v6.1.3 - fixed more enable bugs for some roms. It's not easy making a zip for all ROMs for 3 devices folks!
- v6.1 - added /tmp tmpfs support for thunderbolt
- v6.0.5 - fixed more minor bugs, and tweaked cache_pressure slightly in an attempt to reduce/eliminate occasional sluggishness.
- v6.0.4 - fixed a bug for stock ROMs without busybox, created /tmp if it doesn't exist.
- v6.0.3 - fixed an unsilly bug for DX/DX
- v6.0.2 - fixed another silly bug which prevented crond from starting up on some ROMs.
- v6.0.1 - fixed a silly bug which prevented my mods from being enabled on ROMs that don't have init.d enabled.
- v6.0
- Tweaked scripts to work on thunderbolt.
- Tweaked minfree some more (note this is still a work in progress).
- Separated sysctl settings to a separate file (/data/imoseyon/sysctl.conf) so they are easily customizable.
- Abandoned interactive mode - it didn't really provide much value for me. So I'm doing ondemand only for now. May look at conservative next.
Version 7.1 is available:
v7.1 (download)
To verify that all the tweaks are in place:CHANGELOGS
- Open Terminal Emulator
- su
- checktweak.sh
v7.1NOTE: the latest version has been tested on Gingerbread only. Should work fine on Froyo but hasn't been tested. Also, if you're running ZombieStomped there's no need to flash.
- Latest busybox compiled by yours truly.
- Modified enable scripts to work on GB ROMs.
- Easier to run check script (see above).
- SD card speed boost.
Please make sure you create a backup before flashing anything!
After you flash the .zip, you can run the following command in Terminal to make sure it was applied successfully:
pgrep -f crond
If you get a value on the following line, the .zip has been applied successfully, don't worry about what number you, everyone may end up with a different number.
If you are really feeling adventurous and are down for a good read, and really want to get to know the Android OS even better, please follow Marius' blog, as it is a great read!
************************************************** ***********************************************
Disclaimer: I and neither are droidxforums.com or any of the other members posting in the thread are responsible for any harm YOU may cause to your device. Enjoy
************************************************** ***********************************************



42Likes
LinkBack URL
About LinkBacks
Read, make a backup, and enjoy 






Reply With Quote
