[LG Spirit Guides, News, & Discussion] Tomo123:
LG H440N 4G LTE kernel performance tweaks

FINAL VERSION

any other tweaks I find useful will be posted in the "init.d" section

​

Changelog:

27. December 2015 - added FINAL values. Everyone should use these. "They are nice!" - says Borat.

28. December 2015 - added a changelog. Heh!

29. December 2015 - added a super secret, secret testing zone. I dare you to find it. Note that it's well hidden!

30. December 2015 - new tcp tweaks in init.d section, screenshot how it should look like, Recently tweaks.

31. December 2015 - added a link to a web site with an excellent article on battery care. Added Kernel Adiutor tips by jonathansmith.

1. January 2016 - Added 7+ hours SOT settings in the testing zone. Happy New Year!

3. January 2016 - Since I achieved what I aimed for, I am taking a break from this thread. It will stay open, so feel free to keep on discussing.

18. January 2016 - Testing settings became default settings, with a few changes.

29. January 2016 - Low Memory Killer & swappiness value updated.

BATTERY CARE - a must read for everyone!

Disclaimer:

I am not to be held responsible if anything goes wrong. Simple as that. You do these mods of your own free will.

Warning:

Please, do not report issues or complain about lousy battery times/performance, if you've used any of those pre-made scripts that promise godly battery or performance - they often cause more trouble than they're worth, and are mostly snake oil. And often, you cannot easily undo those changes. If you run a lot of background apps ( for example, five different messengers that cause wakelocks or increased battery usage ), then this guide is not for you. Do not report issues if you've modded your phone with any audio scripts ( like v4a ), xposed, or anything like that! Do not report if you did any permanent system mods, period! These kernel are for CLEAN & STOCK phones, that are rooted ONLY. To summarize, I will not bother replying if you did anything to your phone besides the tweaks I recommend.

Nothing done here is permanent. Everything can be returned to stock in a matter of minutes, if you prefer so, just by uninstalling Kernel Adiutor, unfreezing the bloatware and power cycling the phone.

And hugs to all that pushed the "Thanks!" button. Hell, hugs for everyone!!!

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●

BEFORE WE START...

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●​

Must be done before modifying CPU values:

Open your hidden system menu by dialing 277634#*#, go down to Power, find items "High temperature property" and "Thermal mitigation daemon", and set them like this:

High Temp Prop OFF

Disabled

Thermal Mitigation

Disabled

After that, turn phone off, wait 15-20 seconds and turn back on.. The screen will not dim in hot conditions anymore. Benchmarks are higher, games run smoother. And we can tweak our CPUs.

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●

KERNEL ADIUTOR SETTINGS

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●​

Apply on boot time is to be decided by the user. Although Kernel Adiutor waits for boot complete, I noticed ( on few occasions ) that it takes more time to apply the settings properly. Why? Who knows. Depends on the number of apps you have running on boot, version of the firmware or how lazy it is on boot... Safest setting is 40 seconds, but 20 should cause no issues and is preferred. 10 can be a problem.

CPU:

CPU Maximum Frequency: 1209

CPU Minimum Frequency: 800

CPU Governor: interactive

*note: Minimum frequency is set to default 800, since Snapdragon 410 draws the same voltage on 200, 400, 533 and 800. That's the reason I set the frequency back to 800 idle. No need to go lower for absolutely no gain in battery life or performance.

CPU Governor Tunables subsection:

above_hispeed_delay: 20000 1094400:40000

go_hispeed_load: 80

hispeed_freq: 998400

min_sample_time: 40000

timer_slack: -1

DEFAULT ( 7+h SOT ) - target_loads: 1 800000:75 998400:80 1094400:85

PERFORMANCE ( smoother, few hours less SOT ) - target_loads: 1 800000:75 998400:80 1094400:80 1152000:85

timer_rate: 20000

max_freq_hysteresis: 40000

*note: Reason for system lags is found in the cheaper and slower memory LG has used for H440N ( my guess is, to cut cost ). You can test that yourself by running various I/O benchmark tools and noting speeds of random and sequential reads/writes. I did not manage to make that better in any way by tweaking the I/O schedulers, be it deadline, cfq or row - even testing some examples from Franco's Dev Team. Seems that it's best to leave it on cfq and cut overhead with the flashtweaks init.d script found later mentioned in this post.

Frequency changes happen VERY fast. So fast that CPU widgets or passive frequency readers have a lousy time keeping up. Only values you can trust are found in Kernel Adiutor's Frequency Table.

Those values found above are the best possible values for H440N's CPU for performance & battery saving, and I stand by them. If anyone else cares to try and do some tweaking to improve on those, by all means, please do so. If in the future I decide to add new CPU values, they will be strictly performance based, hence no battery saving.

Reason for the CPU frequency sticking to 1209600 is caused by the LG Home launcher. It contains a system call where, if you open up your apps drawer, it immediately ramps up the frequency to the max for almost 8 seconds or until you close the app drawer! That sucks, and is a lazy way for LG to provide smooth app drawer opening/swiping/closing! Bad LG, bad!!!

Two ways to solve that:

1. Spend less time listing through your apps drawer, since the frequency drops as soon as you stop swiping through it, or...

2. Freeze LG Home and use another launcher ( like Nova or Apex ), if you don't mind losing Double Tap to Wake, or work around that problem with launchers that support double tap gesture and link that gesture with a screen off app like this. Do not freeze any LG Home system apps, besides Easy Home. No need. System will automatically kill the unneeded launcher. Just follow my frozen bloatware list. Nothing more, nothing less.

Low Memory Killer values ( top to bottom ):

48

60

72

84

96

120

Virtual Memory:

vfs cache pressure: 100

swappiness: 80

Build prop Editor

dalvik.vm.heapsize: 174m

dalvik.vm.heapminfree: 512k

dalvik.vm.heapstartsize: 8m

dalvik.vm.heapgrowthlimit: 128m

dalvik.vm.heaptargetutilization: 0.75

dalvik.vm.heapmaxfree: 8m

*note: Dalvik tweaks are based upon Intel's recommended Dalvik tweaks for Lollipop phones with 1 GB RAM and xhdpi displays.

Init.d

1. Turn on "Emulate Init.d" and click that big "+" to create a new script.

2. Name the new script: flashtweaks

Contents of the "flashtweaks" script are:

#!/system/bin/sh
echo 0 > /sys/block/mmcblk0/queue/nomerges;
echo 2 > /sys/block/mmcblk0/queue/rq_affinity;
echo 512 > /sys/block/mmcblk0/queue/nr_requests;
echo 0 > /sys/block/mmcblk0/queue/iostats;
echo 0 > /sys/block/mmcblk0/queue/add_random;
echo 0 > /sys/block/mmcblk1/queue/nomerges;
echo 2 > /sys/block/mmcblk1/queue/rq_affinity;
echo 512 > /sys/block/mmcblk1/queue/nr_requests;
echo 0 > /sys/block/mmcblk1/queue/iostats;
echo 0 > /sys/block/mmcblk1/queue/add_random;

2. Name the new script: tcptweaks

Contents of the "tcptweaks" script are:

#!/system/bin/sh
#more reasonable tcp tweaks
echo 1 > /proc/sys/net/ipv4/tcp_low_latency;
echo 0 > /proc/sys/net/ipv4/tcp_timestamps;
echo 900 > /proc/sys/net/ipv4/tcp_keepalive_time;
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo 156 > /proc/sys/net/ipv4/tcp_keepalive_intvl;

Example of properly added scripts. I just named them differently:

Ignore the "99SuperSUDaemon" script unless you know what it is. It's not needed for our tweaks, and if you don't have it, it's perfectly fine.

Here are some screenshots on clearing / checking Kernel Adiutor's Frequency Table, by our fellow XDA member jonathansmith:

How to clear timers?

Check correct frequency usage.

Now, since you've finished with Kernel Adiutor, power cycle the phone. You're almost done. All that's left are:

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●

OTHER SETTINGS

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●​

In Developer options, set animation scale values to OFF.

In Settings / Display / Brightness enable Night Brightness. Who needs anything over 0% brightness from midnight to six in the morning?

Visit Play Store and install these apps:

Recently by Chainfire

Trimmer (fstrim)

Recently! settings ( preferred ):

Age limit: No limit

Entry limit: 12

Apply on boot: Yes

Freeload: Checked ( yeah, we're cheapskates )

EVERYTHING ELSE DISABLED / UNCHECKED.

Recently! settings ( much faster version ):

Age limit: Running apps only

Entry limit: Running apps only

Apply on boot: Yes

Freeload: Checked ( yeah, we're cheapskates )

EVERYTHING ELSE DISABLED / UNCHECKED.

Do a "Clear all" in recent apps list after a reboot. It will make things faster. Believe me.

As for Trimmer (fstrim), run that every week or so, on "/data", "/cache" and "/system". No need to run it daily.

Apps frozen with Titanium Backup ( freeze bloatware, do not delete it - you'll thank me later ):

Chrome

Drive

E-mail

EasyHome

Gmail ( I am using Aqua Mail. )

Google Play Books

Google Play Games

Google Play Movies

Google Play Music

Google Play Newsstand

Google Search

Google+

Hangouts

HTML viewer ( do not disable if using stock browser or Chrome )

Internet ( I am using this version of Opera. It's the best one.

LG Keyboard ( disable only if already using another keyboard. I am using Smart Keyboard. )

LG Keyboard Black Theme ( disable only if already using another keyboard. I am using Smart Keyboard. )

LG MLT ( disable LG MLT in the hidden service menu before freezing it! Menu code is 277634#*# )

Live Wallpaper

Music ( both widget and app - I am using PlayerPro. )

Trusted Face

Weather

Weather Theme

WeatherPlatform

Do not touch anything else! Don't say I did not warn you.

If you prefer blocking ads on web sites, like I do... then download AdAway from XDA forum, and enjoy ad-free surfing.

That's it. Have fun, and enjoy your buttery smooth phone. One of this year's best-buy smartphones. Too bad it doesn't get the attention it deserves. Really, an unsung hero if there ever was one.

Although there are a lot of other CPU tweaking values throughout the thread, these values are the standard ones you should use. Other ones are experiments, or just plain testing values.

H440N is compatible with DriveDroid - in case you want to boot an operating system or a Linux distro off of it.

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●

SUPER SECRET, SECRET TESTING ZONE

●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●

by WellHidden™​

THESE SETTINGS BECAME THE DEFAULT SETINGS. SEE ABOVE.

With the latest test settings I achieved 7+ hours SOT. And yes, it can be done! You got the proof below.

Everything else besides these TESTING values below stays the same as in FINAL values ( dalvik, init.d, etc. ).

CPU:

CPU Maximum Frequency: 1209

CPU Minimum Frequency: 400

CPU Governor: interactive

CPU Governor Tunables subsection:

above_hispeed_delay: 20000 1094400:40000 1152000:20000

go_hispeed_load: 82

hispeed_freq: 998400

min_sample_time: 40000

timer_slack: -1

target_loads: 72 998400:82 1094400:85 1152000:86 1209600:90

timer_rate: 20000

max_freq_hysteresis: 40000

Virtual Memory:

Swappiness: 60 ( I recommend 100, but go back to 60 if you feel the memory gain is not worth a slight performance drop. )

Vellamo 3.2 scores: