Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
kholk
Old
(Last edited by kholk; 21st February 2011 at 12:17 AM.)
#1  
Recognized Developer - OP
Thanks Meter 3113
Posts: 2,137
Join Date: May 2007
Location: Salerno

 
DONATE TO ME
Default [TWEAK] Kernel tuning script -- UPDATED!

Hi all,
since I've said goodbye to my Milestone, in these days, prior to selling it, my good behavior said to me "okay, no customkernel, you can't help with RSA...so Milestone owners are ****ed...ouh, no, wait!"
...and then prior to selling it I've tested some things and I've found that sysctl is working!

Since sysctl is working and I'm on Linux from about 10 years, I've been played with our kernel in Milestone and tested some parameters.. and I've had a speedup in my daily operations: browse the net with Dolphin Browser HD, play some games, sync email, make calls, sms etc... and I've found that my Milestone is way more responsive and feels smoother!

Sysctls tested on the great CyanogenMod port by nadlabak.

So, well, here's the script. Feel free to execute it at boot (if you execute it at boot, your phone will boot slightly faster) and/or to integrate in your custom nandroid ROMs

Code:
#!/system/bin/sh
sysctl -p
#
#Disable normalized sleeper
#
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
#
#  Memory management
#
echo 2048 > /proc/sys/kernel/msgmni
echo 64000 > /proc/sys/kernel/msgmax
echo 268435456 > /proc/sys/kernel/shmmax
echo "500 512000 64 2048" > /proc/sys/kernel/sem
sysctl -w net.core.wmem_max=524288
sysctl -w net.core.rmem_max=524288
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_rmem='6144 87380 524288'
sysctl -w net.ipv4.tcp_wmem='6144 87380 524288'
sysctl -w kernel.sched_latency_ns=600000
sysctl -w kernel.sched_min_granularity_ns=400000
sysctl -w kernel.sched_wakeup_granularity_ns=400000
EDIT: UPDATE N.3

This script makes the Linux kernel to take a little more RAM, so I don't recommend to use it in HTC Sense builds, since Sense is already crashing because of heavy RAM usage, but with CM and LauncherPro, with a lot of progs open in background I've never went out of RAM!

NOTE: Make sure that you've got echo and sysctl in /system/xbin/ otherwise this won't have any effect!


Even if I'm returning to HTC I'm sad for my old Milestone, I like its shell so much...it's a really beautiful device!

Hoping for the best for u, Milestone users
-kholk
 
Al936
Old
#2  
Senior Member
Thanks Meter 62
Posts: 162
Join Date: Mar 2007
Very interesting. Could you please advice what I need to do to execute the script at boot?
 
89luca89
Old
(Last edited by 89luca89; 3rd October 2010 at 08:15 PM.)
#3  
89luca89's Avatar
Recognized Developer
Thanks Meter 1380
Posts: 1,186
Join Date: Apr 2010
Location: Terracina (LT)

 
DONATE TO ME
Quote:
Originally Posted by kholk View Post
I've found that sysctl is working!

Code:
#!/system/bin/sh
/system/xbin/echo 2048 > /proc/sys/kernel/msgmni
/system/xbin/echo 64000 > /proc/sys/kernel/msgmax
/system/xbin/echo 268435456 > /proc/sys/kernel/shmmax
/system/xbin/echo 500 512000 64 2048 > /proc/sys/kernel/sem
/system/xbin/sysctl -w net.core.wmem_max=524288
/system/xbin/sysctl -w net.core.rmem_max=524288
/system/xbin/sysctl -w net.ipv4.tcp_tw_recycle=1
/system/xbin/sysctl -w net.ipv4.tcp_rmem='6144 87380 524288'
/system/xbin/sysctl -w net.ipv4.tcp_wmem='6144 87380 524288'
Hoping for the best for u, Milestone users
-kholk
ciao kholk

Want to know if you put a sysctl binary in xbin?
Cause your script suppose to have sysctl in xbin right?
Can you make a download of it? Or is a symlink from busybox?

Grazie per questa drittona per il pietrone

EDIT: okok resolved, had to --install busybox -s xD
NO PROBLEM now testing!!
If you like my work, you can buy me a coffe if you want


>>> THE GingerMOD (AOSPized XXKG&) for SGS2!
>>> THE FroyoMOD (AOSP) For Milestone<<<
>>> ROM:EclairMOD v0.3b For Milestone <<<
>>>Androidiani OpenRecovery by ME & Azhad For Milestone!<<<

Samsung Galaxy S2 i9100, Rom TheGingerMOD
Motorola Milestone, Rom TheFroyoMOD, 1,1ghz LV

Nokia n97mini IoEsisto v8 CFW
Nokia e51 hacked
Nokia n800 Maemo/Android 1.6
 
kholk
Old
#4  
Recognized Developer - OP
Thanks Meter 3113
Posts: 2,137
Join Date: May 2007
Location: Salerno

 
DONATE TO ME
This script is supposing that you've got echo and sysctl in /system/xbin/
If you haven't got echo and sysctl in /system/xbin/ this script won't have any effect.
 
Braidonh
Old
#5  
Braidonh's Avatar
Senior Member
Thanks Meter 38
Posts: 133
Join Date: Jul 2010
Location: Edmonton
And how would i go about obtaining those?

Sent from my Milestone using XDA App
Phone - Samsung Galaxy S II
ROM - Dual Boot CyanogenMOD nightlies / ParanoidAndroid 2.54
Modem - UGKG2
Kernel - Siyah 5.01
RIP - Motorola Milestone

Read, Search, Read, Think, Search again, then Read, THEN POST.
Think developers owe you something? Get. Off. My. Website.

KERNEL SAUCE OUT
 
kholk
Old
#6  
Recognized Developer - OP
Thanks Meter 3113
Posts: 2,137
Join Date: May 2007
Location: Salerno

 
DONATE TO ME
Install busybox and with it you should have installed those.
 
xslntx
Old
(Last edited by xslntx; 4th October 2010 at 12:51 AM.)
#7  
Member
Thanks Meter 8
Posts: 69
Join Date: Jan 2010
Location: Mississauga
I didn't think sysctl would work on this kernel. Since it does, here's some more optimizations that I know work for Eclair and earlier:

Code:
/system/xbin/sysctl -w kernel.sched_latency_ns=600000
/system/xbin/sysctl -w kernel.sched_min_granularity_ns=400000
/system/xbin/sysctl -w kernel.sched_features=24188
The default latencies were a little ridiculous. And the CFS features disabled here are pointless, even on desktops.

That said, thanks for pointing out that it works! Much appreciated. Best of luck with your HTC device.
 
kabaldan
Old
#8  
kabaldan's Avatar
Recognized Developer
Thanks Meter 2508
Posts: 990
Join Date: Dec 2009
Location: Prague

 
DONATE TO ME
Very nice, thanks kholk!
Thanks xslntx!
http://android.doshaska.net
^ a coffee, wine or beer is welcome
>>Copyright Slavery<<
 
kholk
Old
#9  
Recognized Developer - OP
Thanks Meter 3113
Posts: 2,137
Join Date: May 2007
Location: Salerno

 
DONATE TO ME
Script updated.

-- Absolute path not needed.
-- Added scheduler tuning for granularity latencies
-- Normalized sleeper disabled.
 
89luca89
Old
#10  
89luca89's Avatar
Recognized Developer
Thanks Meter 1380
Posts: 1,186
Join Date: Apr 2010
Location: Terracina (LT)

 
DONATE TO ME
Testing it with great results (in combination with xlsntx parameters)
graphic performance are improved, usage is clearly improved,
in opposition to that bench are lower, I mean, I donot understan:
In Quadrant, I have nearly 3\4 fps MORE than normal in EACH test (except for the planet one) -wich is nealrly the performance a droid2 has...- and have a result like 20\25 point lower...dunno...another dimostration that benchs aren't much reliable...
If you like my work, you can buy me a coffe if you want


>>> THE GingerMOD (AOSPized XXKG&) for SGS2!
>>> THE FroyoMOD (AOSP) For Milestone<<<
>>> ROM:EclairMOD v0.3b For Milestone <<<
>>>Androidiani OpenRecovery by ME & Azhad For Milestone!<<<

Samsung Galaxy S2 i9100, Rom TheGingerMOD
Motorola Milestone, Rom TheFroyoMOD, 1,1ghz LV

Nokia n97mini IoEsisto v8 CFW
Nokia e51 hacked
Nokia n800 Maemo/Android 1.6

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Learn to Edit Graphics for your Development Work

The importance of good and appropriate graphics for your development work is undeniable. Be … more

Tasker Alternative: AutomateIt, Automates Your Device Tasks – XDA Developer TV

XDA Developer TV Producer Kevin wants to help make your … more

Preventing App Piracy: Join the Discussion

The topic of piracy is always a touchy subject, but I feel that the grass roots style of Android … more

Jolla Sailfish OS Flagship Device Makes First Appearance

Given the amount of coverage that Android receives around here, you could almost be … more