# {TShed Tweaks} Currently being reworked, bear with me.



## theMichael (Aug 26, 2011)

The below tweaks are a mash of Liquid's 3.2 rom tweaks, Thundershed's built in tweaks and my own personal testing/tweaking.

They are intended for Thundershed roms (any version) and from my own experience I can say they make it fly!!!

It is highly recommended that in order to add these tweaks you use the app Root Explorer. For just $3.99, it is an app you will use time and time again.

*NOTE: *These tweaks are for advanced users who are comfortable using init.d, sysctl.conf and the build.prop
_________________________________________________________________________

*Part I: Sysfs*

*Filepath:* etc -> init.d

*Instructions:*

Navigate to the filepath, create a "new file" and rename it to "02sysfs."

Give this file the same permissions as the other files in the folder.

Open the file and copy/paste the below:

#!/system/bin/sh
# mvp edits[/size]
# filesystem tweaks
for k in $(busybox mount | cut -d " " -f3)
do
sync
 busybox mount -o remount,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,nobh $k
done
# memory management
echo "2048,4096,8192,16384,20992,25600" > /sys/module/lowmemorykiller/parameters/minfree
# normalized sleeper
mount -t debugfs none /sys/kernel/debug
echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features
# scheduler tweaks
for i in /sys/block/*
do
 echo "0" > $i/queue/rotational
 echo "1024" > $i/queue/nr_requests
 echo "1" > $i/queue/iosched/fifo_batch
 echo "noop" > $i/queue/scheduler
 echo "2" > $i/queue/read_ahead_kb
done
# default sdboost
for i in /sys/devices/virtual/bdi/*
do
 echo "2" > $i/read_ahead_kb
done
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "2" > /sys/devices/virtual/bdi/default/read_ahead_kb
# redraw tweak
echo "ro.HOME_APP_ADJ=1" > /data/local.prop
_________________________________________________________________________

*Part II: Sysctl.conf*

*Filepath: *etc -> sysctl.conf

*Instructions:*
Find the sysctl.conf file and copy/paste the following:

```
<br />
vm.swappiness = 0<br />
vm.min_free_kbytes = 8192<br />
vm.dirty_ratio = 90<br />
vm.dirty_background_ratio = 70<br />
vm.dirty_writeback_centisecs = 6000<br />
vm.dirty_expire_centisecs = 3000<br />
vm.panic_on_oom = 0<br />
vm.oom_kill_allocating_task = 1<br />
vm.vfs_cache_pressure = 25<br />
fs.file-max = 65536<br />
fs.lease-break-time = 20<br />
kernel.panic_on_oops = 1<br />
kernel.panic = 0<br />
kernel.msgmni = 2048<br />
kernel.msgmax = 64000<br />
kernel.shmmni = 4096<br />
kernel.shmall = 2097152<br />
kernel.shmmax = 268435456<br />
kernel.sem = 500 512000 64 2048<br />
kernel.sched_compat_yield = 1<br />
kernel.threads-max = 5000<br />
kernel.sched_latency_ns = 18000000<br />
kernel.sched_min_granularity_ns = 1500000<br />
kernel.sched_wakeup_granularity_ns = 3000000<br />
kernel.sched_shares_ratelimit = 256000<br />
kernel.sched_features = 24189<br />
```
_________________________________________________________________________

*Part III: Build Prop*

*Filepath:* system -> build.prop

*Instructions:*
Open up the build.prop file and edit the existing:

[background=rgb(251, 248, 244)]dalvik.vm.heapsize=48m[/background]
[background=rgb(251, 248, 244)]to[/background]
[background=rgb(251, 248, 244)]dalvik.vm.heapsize=64m[/background]
*[background=rgb(251, 248, 244)]&[/background]*
dalvik.vm.dexopt-flags=m=y
[background=rgb(251, 248, 244)]to[/background]
[background=rgb(251, 248, 244)]dalvik.vm.dexopt-flags=m=v,o=y[/background]

[background=rgb(251, 248, 244)]Then, [/background]scroll all the way to the bottom, add another line and copy/paste the below:



```
<br />
# MVP additions<br />
windowsmgr.max_events_per_sec=120<br />
persist.sys.ui.hw=1<br />
debug.performance.tuning=1<br />
video.accelerate.hw=1<br />
ro.max.fling_velocity=12000<br />
ro.min.fling_velocity=8000<br />
ro.media.dec.jpeg.memcap=8000000<br />
ro.media.enc.hprof.vid.bps=8000000<br />
ro.media.enc.jpeg.quality=100<br />
ro.kernel.android.checkjni=0<br />
ro.kernel.checkjni=0<br />
ro.config.nocheckin=1<br />
ro.lge.proximity.delay=25<br />
mot.proximity.delay=25<br />
ro.ril.disable.power.collapse=1<br />
pm.sleep_mode=1<br />
ro.ril.hsxpa=2<br />
ro.ril.gprsclass=10<br />
ro.ril.hep=1<br />
ro.ril.enable.dtm=1<br />
ro.ril.hsdpa.category=10<br />
ro.ril.enable.a53=1<br />
ro.ril.enable.3g.prefix=1<br />
ro.ril.htcmaskw1.bitmask=4294967295<br />
ro.ril.htcmaskw1=14449<br />
ro.ril.hsupa.category=5<br />
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960<br />
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960<br />
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960<br />
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960<br />
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960<br />
media.stagefright.enable-player=true<br />
media.stagefright.enable-meta=true<br />
media.stagefright.enable-scan=true<br />
media.stagefright.enable-http=true<br />
```
_________________________________________________________________________

*Part IV: ***Special Compache Section*** (OPTIONAL, only for kernels that support swap)*

For whatever reason imoseyon's zram script doesn't always stick after reboot on sheds rom.

Because of this I have opted to use compcache which will pretty much do the exact same thing.

*Instructions:*
settings -> TShed settings -> Performance -> compache -> enable 10% (more than enough)

Now you have to change some of the values found in Part I and Part II above:

For # memory management in Part I change:
echo "[background=rgb(245, 245, 245)]2048,4096,8192,16384,20992,25600"[/background] > /sys/module/lowmemorykiller/parameters/minfree
to
echo "[background=rgb(245, 245, 245)]512,1024,20480,20480,20480,25600"[/background] > /sys/module/lowmemorykiller/parameters/minfree

In Part II change the following:
vm.swappiness = 0
to
vm.swappiness = 10
*&*
vm.vfs_cache_pressure = 25
to
vm.vfs_cache_pressure = 5
_________________________________________________________________________________________________________

*Bonus:*

If you are running interactiveX governor on any kernel, add the below line anywhere in Part I:


```
<br />
# scheduler tweaks<br />
echo 80000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time<br />
```
_________________________________________________________________________________________________________

When done, restart and now your shed rom should be all pimped out and super smooth.

Let me know if you have any additions you think I should explore or any tweaks.


----------



## papaavi (Jul 11, 2011)

Cool. Thanks.

Sent from my ADR6400L using Tapatalk 2


----------



## ramos (Sep 9, 2011)

thanks for all this. 
should we disregard the tweaks you made earlier or is this injunction with?


----------



## theMichael (Aug 26, 2011)

just updated a little in all sections, copy and paste over what you previously had.


----------



## ramos (Sep 9, 2011)

thanks


----------



## KPFury (Oct 17, 2011)

I created the 02sys file within init.d folder, but i can't seem to paste anything into it, even when opened using Text Editor... the way I usually paste is hold down on a spot on the screen, and the "paste" option pops up. Nothing comes up in Root Explorer to paste for some reason... Is there another way to do this? thx!


----------



## theMichael (Aug 26, 2011)

KPFury said:


> I created the 02sys file within init.d folder, but i can't seem to paste anything into it, even when opened using Text Editor... the way I usually paste is hold down on a spot on the screen, and the "paste" option pops up. Nothing comes up in Root Explorer to paste for some reason... Is there another way to do this? thx!


you have to push on the upper left most corner of the text screen. its stupid and may take a few tries but on an empty screen it will only register the very first spot lol.


----------



## KPFury (Oct 17, 2011)

Cool thx. What do I do with the *.bak files that were created?


----------



## theMichael (Aug 26, 2011)

KPFury said:


> Cool thx. What do I do with the *.bak files that were created?


There backups, you can delete them if you don't think u will need them but letting them hang wont hurt anything.
- theMichael


----------



## ramos (Sep 9, 2011)

I noticed that the commands in the 02sysfs files weren't working. like noop and sdcard tweaks. so I compared them to the first set you put out in the thunder shed thread. I noticed that you forgot some "" after the echo command. I put them in and it worked. slight overlook?


----------



## johndoe86x (Jul 25, 2011)

Thanks for this! Been crack-flashing lately, just may jump back on T-Shed to try these out. Quick question though, will these still work if I don't use Workshed's kernel but use IMO's 6.1 instead?


----------



## theMichael (Aug 26, 2011)

ramos said:


> I noticed that the commands in the 02sysfs files weren't working. like noop and sdcard tweaks. so I compared them to the first set you put out in the thunder shed thread. I noticed that you forgot some "" after the echo command. I put them in and it worked. slight overlook?


should work either way, working for me without quotes, weird.


----------



## theMichael (Aug 26, 2011)

johndoe86x said:


> Thanks for this! Been crack-flashing lately, just may jump back on T-Shed to try these out. Quick question though, will these still work if I don't use Workshed's kernel but use IMO's 6.1 instead?


i made it so the tweaks were not kernel depended, use imos kernel with them.


----------



## dvgb173 (Jun 8, 2011)

theMichael said:


> you have to push on the upper left most corner of the text screen. its stupid and may take a few tries but on an empty screen it will only register the very first spot lol.


<facepalm!> 
I never knew that! That explains all the problems I've had editing files on the phone!
SFS!
Thanks!
Doug B.


----------



## Selbowdaeskimo (Jul 29, 2011)

Thanks theMichael. Seeing great results immediately after reboot!


----------



## bukowski (Sep 2, 2011)

just a quick question regarding these tweaks, part iv specifically.

i'm running imo's kernel and i've already enabled zram. if i also enable compcache, should i disable zram?


----------



## theMichael (Aug 26, 2011)

bukowski said:


> just a quick question regarding these tweaks, part iv specifically.
> 
> i'm running imo's kernel and i've already enabled zram. if i also enable compcache, should i disable zram?


if zram is sticking for you, you dont need to enable compcache.
for some people zram doesnt stick after reboot with sheds rom.
to see if its sticking for you open up terminal and type "su" and then "free" of the bottom row called swap is all zeros then zram didnt stick and you should enable compcache instead.


----------



## bukowski (Sep 2, 2011)

ah, gotcha. thanks for the info. turns out zram wasn't sticking.

these tweaks are fantastic, btw. my phone is smooth as silk. kudos!


----------



## ryanstfl (Aug 4, 2011)

I noticed an increase in speed for page loads, other than that not really... but thank you so much anyway.


----------



## bukowski (Sep 2, 2011)

another newbie question...

if i flash imo's 6.2.0 kernel (currently running 6.1.0) and re-run his speedtweak script, will that overwrite any of these tweaks?


----------



## theMichael (Aug 26, 2011)

bukowski said:


> another newbie question...
> 
> if i flash imo's 6.2.0 kernel (currently running 6.1.0) and re-run his speedtweak script, will that overwrite any of these tweaks?


Nope, your good to go.

- theMichael


----------



## bukowski (Sep 2, 2011)

boy, am i out of it (and/or stupid) today. was about to flash 6.2.0 and then went, "DUH! thundershed is an aosp rom and 6.2.0 is a gb kernel..."

facepalm doesn't even begin to describe it.


----------



## theMichael (Aug 26, 2011)

bukowski said:


> boy, am i out of it (and/or stupid) today. was about to flash 6.2.0 and then went, "DUH! thundershed is an aosp rom and 6.2.0 is a gb kernel..."
> 
> facepalm doesn't even begin to describe it.


cut yourself some slack, i didnt catch that either lol.


----------



## dvgb173 (Jun 8, 2011)

Ok. I'll say it.
Thundershed is gb.
Did you mean 6.2.0 is a sense kernel? Yes it is. 
Doug B.


----------



## ramos (Sep 9, 2011)

now there is a asop 6.2. woot


----------



## SubwayJrd (Aug 17, 2011)

theMichael said:


> I noticed that the commands in the 02sysfs files weren't working. like noop and sdcard tweaks. so I compared them to the first set you put out in the thunder shed thread. I noticed that you forgot some "" after the echo command. I put them in and it worked. slight overlook?


I had this same problem (02sysfs tweaks not taking) as indicated by running cat in Android Terminal emulator on the directories that SHOULD have been accepting the tweaks. I fixed it by creating the 02sysfs file in linux, *manually* typing the first line #!/system/bin/sh, then pulling that file to my windows box and adding the rest of the tweaks. All the tweaks I've tested so far look like they've taken.

I've had this problem before when creating a file that uses /system/bin/sh. Something about Linux not liking that first line (or the file itself?) being made by windows (I was using Notepad++)


----------



## bukowski (Sep 2, 2011)

dvgb173 said:


> Ok. I'll say it.
> Thundershed is gb.
> Did you mean 6.2.0 is a sense kernel? Yes it is.
> Doug B.


haha, yeah that's what i meant to say. told you i was out of it yesterday!


----------



## SubwayJrd (Aug 17, 2011)

bukowski said:


> haha, yeah that's what i meant to say. told you i was out of it yesterday!


Funnily enough, Imoseyon dropped a 6.2.0 AOSP kernel today.
http://rootzwiki.com/topic/1258-kernel-aosp-leankernel-minimalistic-kernel-v620-51412/


----------



## ramos (Sep 9, 2011)

so are waiting new scripts to match the new version of IMO?


----------



## theMichael (Aug 26, 2011)

basically the same. just change deadline to sio in 02sysfs under io scheduler.


----------



## bukowski (Sep 2, 2011)

Sorry to be a continual pain, but I don't see deadline anywhere in 02sysfs.

Am I just blind?

Edit: I'm guessing you meant change noop to sio?


----------



## ramos (Sep 9, 2011)

theMichael said:


> basically the same. just change deadline to sio in 02sysfs under io scheduler.


figured that part. thanks dude


----------



## SubwayJrd (Aug 17, 2011)

theMichael said:


> basically the same. just change deadline to sio in 02sysfs under io scheduler.


Sio is the default, so you can actually strip that line out of 02sysfs

Sent from my ADR6400L using RootzWiki


----------



## theMichael (Aug 26, 2011)

SubwayJrd said:


> Sio is the default, so you can actually strip that line out of 02sysfs
> 
> Sent from my ADR6400L using RootzWiki


also true.


----------



## bukowski (Sep 2, 2011)

this is about my fifteenth newbie question in this thread...

i don't think the tweaks in my 02sysfs are initializing. it's my understanding that this script will be run at startup after a reboot. however, when i go into some of the files that have values echo'd to them, i'm not seeing the values. for example:


```
<br />
# normalized sleeper<br />
mount -t debugfs none /sys/kernel/debug<br />
echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features<br />
```
when i view /sys/kernel/debug/shed_features i see:


```
<br />
GENTLE_FAIR_SLEEPERS START_DEBIT<br />
WAKEUP_PREEMPT AFFINE_WAKEUPS<br />
NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY<br />
NO_ARCH_POWER NO_HRTICK NO_DOUBLE_TICK<br />
LB_BIAS LB_SHARES_UPDATE ASYM_EFF_LOAD<br />
OWNER_SPIN NONIRQ_POWER<br />
```
note that there is no NO_NORMALIZED_SLEEPER. this happens with other echo'd values as well, but not all of them.

i followed the instructions exactly. using root explorer, i created 02sysfs. i then changed permissions to r-xr-xr-x (same as other files in the directory). and then i copy/pasted straight from the thread.


----------



## bukowski (Sep 2, 2011)

SubwayJrd said:


> I had this same problem (02sysfs tweaks not taking) as indicated by running cat in Android Terminal emulator on the directories that SHOULD have been accepting the tweaks. I fixed it by creating the 02sysfs file in linux, *manually* typing the first line #!/system/bin/sh, then pulling that file to my windows box and adding the rest of the tweaks. All the tweaks I've tested so far look like they've taken.
> 
> I've had this problem before when creating a file that uses /system/bin/sh. Something about Linux not liking that first line (or the file itself?) being made by windows (I was using Notepad++)


hmmm... i think this may be my problem. i don't have a linux box with which to create the file, though. i suppose i could install a distro in virtualbox, but i'm feeling lazy at the moment.

subway (or anyone feeling kind for that matter), would you mind creating the entire 02sysfs file in linux, and then posting the file for download? i only need 02sysfs. sysctl.conf and build.prop don't seem to have a problem. i think it's just like subway said though for 02sysfs. windows is screwing up the #!/system/bin/sh header somehow.

*edit:* btw, i've tried doing this both ways, to no avail. first time i created the files in windows, then copied to sdcard, then used root explorer to move to proper directories and set permissions. second time i created the files right on my phone (using root explorer) and copy/pasted. still no dice. so i'm hoping if someone running linux does as i asked above, maybe the third time will be the charm.


----------



## SubwayJrd (Aug 17, 2011)

bukowski said:


> hmmm... i think this may be my problem. i don't have a linux box with which to create the file, though. i suppose i could install a distro in virtualbox, but i'm feeling lazy at the moment.
> 
> subway (or anyone feeling kind for that matter), would you mind creating the entire 02sysfs file in linux, and then posting the file for download? i only need 02sysfs. sysctl.conf and build.prop don't seem to have a problem. i think it's just like subway said though for 02sysfs. windows is screwing up the #!/system/bin/sh header somehow.
> 
> *edit:* btw, i've tried doing this both ways, to no avail. first time i created the files in windows, then copied to sdcard, then used root explorer to move to proper directories and set permissions. second time i created the files right on my phone (using root explorer) and copy/pasted. still no dice. so i'm hoping if someone running linux does as i asked above, maybe the third time will be the charm.


Here is the 02sysfs I created: http://dl.dropbox.com/u/32630748/Liquid%20Tweaks%20for%20ThunderShed/02sysfs

Also, make sure you are setting permissions right for the different files. They get finicky if you don't.


----------



## DeReaper (Nov 23, 2011)

is there no way to create a flashable zip that will set up all the files to the proper location and set permissions?


----------



## ramos (Sep 9, 2011)

DeReaper said:


> is there no way to create a flashable zip that will set up all the files to the proper location and set permissions?


damn dude. do some work yourself. thaws people that write this stuff is doing it at their free time. won't kill ya do a little something


----------



## DeReaper (Nov 23, 2011)

work 12 hours a day 6 days a week excuse me for wanting something super easy sorry I asked


----------



## theMichael (Aug 26, 2011)

i can work on a zip. dont know how but i bet i could figure it out quick.

scripts are a little messed up right now in the OP, ignore them until further notice.


----------

