[G3 Android Development] Emu:
I want to share my new settings. I'm trying to get the smoothest UI while also being able to do video recording in 4K. Note this is not one size fits all and dependent on your OS, and additional hardware like your microSD performance. Without further ado here it is.

Phone: LG D851

OS: Dirty Unicorns 10.4

MicroSD card: Samsung Pro+ 32 GB

Filesystem: etx4 for system data and cache

Like always, I only post the things I changed. Everything else just leave as is if you want to go by this guide. :)

[B]CPU[/B]
Use at least 2 cores.

CPU governor: Pegasusq

CPU Governor Tunables:
down_differential 5
freq_for_responsiveness 1728000
freq_step 10

Multicore Power Saving: Disabled

Schedule workqueues on awake CPUs: Disabled
[I]
CPU Boost[/I]
Interval 800 ms
Sync Threshold: 960 MHz
Input Interval 700 ms
Input Boost Frequency: 1497 MHz

[B]CPU Hotplug[/B]
[I]
Bricked Hotplug[/I]
Minimum CPU Online: 1
Maximum CPU Online: 2
Max Cores Screen Off: 1
Down Lock Duration: 900 ms
Start delay: 0 ms
Delay: 10
[I]Time Thresholds
[/I]For CPU0, CPU1, CPU2, CPU3
This amount of time must have passed for CPU to be hotplugged: Set all to 0 ms, Unplugged: make sure all are set to 190 ms.

[B]Thermal[/B]
Leave as is

[B]Power and Battery[/B]
USB Fast Charge: Enabled
(Don't mess with Krait C states)

[B]I/O Scheduler
[/B][I]Internal Storage[/I]
Scheduler: tripndroid
Read ahead: 512 kB

[I]External Storage[/I]
Scheduler: sio
[I]Scheduler Tunable
[/I]async_read_expire 3600
async_write_expire 3600
fifo_batch 64
sync_read_expire 500
sync_write_expire 1500
writes_starved 0
Read ahead: 2176 kB

Additional things:

1. Save as a profile, reboot so that fast charging works again. I noticed you can avoid a lot of lag if you avoid going into Kernel Adiutor Mod and constantly change things like me lol. Set it to apply on boot and forget about it. Also!! Go to battery optimization in your AOSP ROM and set Kernel Adiutor Mod to "Not optimized". Otherwise Doze kills KA and goes back to Interactive while you're sleeping and your battery is draining again. What's worse, it also kills USB fast charge so next time you plug in your phone, it charges slowly or not at all until you reboot it. grr... I also don't use Greenify because of the same reason. Even when I put KA to the exceptions I would find that it killed it after leaving the phone off for 2+ hours.

2. I know Pegasus has its own built in hotplug and this would cause conflicts with the Bricked Hotplug. But, the truth is, PegasusQ alone does not run smooth. If you enable another hotplug, it will override conflicting settings. Great news! It was for that reason why I set the time thresholds to enable Bricked Hotplug to 0 ms. Bricked immediately takes over and you will not see any of the weird conflicts. You can run the whole setting with more than 2 cores enabled, but I tried it and I don't see any performance improvements. But, again a lot of people here are so much smarter than me and maybe you know how to change the settings to really take advantage of this. I tried other hotplugs including hotplug disabled and no combination gave me a consistently smooth experience except for this.

3. Battery life and info about Pegasus, sio and tripndroid: The same as Alucard which is ok. 3 hours and 45 min. The frequency table will show that the phone does not go into deep sleep. But, trust me, when the phone is turned off, it drains less battery than any setup I have ever had. PegasusQ is an amazing governor based on ondemand. But it's ondemand done right assigning each task a fair time budget. Governor doesn't scale CPU but tells the CPU driver to do so. Smooth scaling is also done by CPU driver, not by governor. The result is that all animations get full attention until they finish avoiding the lag at the end you always see. Tripndroid is by far the fastest I/O scheduler when it comes to UI. It just responds and it responds quickly without question. But it comes at the cost of read speed. But that is no problem because it makes up for it by helping to increase the RAM speed! 3300 MB/s is normal under tripndroid. For comparison, the other I/O schedulers gave me 1200-2500 MB/s. SIO for external SD because it is designed to eliminate overhead. Remember when I said that tripndroid sacrifices read speed for external SD? Well SIO makes up for it without sacrificing the UI speed of tripndroid. It is important to keep this combination.

tripndroid for both = Fast UI, bad read and write speed

zen for both = high benchmarks but UI laggg!

tripndroid internal, zen external = very good

row, noop, deadline, cfq, bfq, all the older IO schedulers = are you kidding me

fiops = slow and lag

Again I'm not an expert at all. I just do by a lot of trial and error and I found that these settings worked for me. The biggest drawback is the on screen time. I wish I knew more about voltage so that I can extend my battery life. If anyone has suggestions of how much one can safely undervolt the CPU, I would greatly appreciate it. :)

Edit: Seems like -95 mV global offset undervolt is all I can get out of it max. Lower and it will crash and reboot when it goes to deep sleep. Anything below that is unstable. I notice a performance drop. It's not as smooth. But that might simply be because I turn on another parameter in Kernel Adiutor which creates even more overhead causing things to be slower. I will test the battery life over the next days to see if I get more on screen time out of -95 mV offset.

Edit 2: Definitely do NOT use Intellithermal with these settings. It will overheat while charging and just reboot.

Edit 3: Recently experienced high instability after coming out of Doze and deep sleep. After 5 minutes the phone would just freeze and reboot. I am looking in to this and it might either be due to me undervolting, changing Krait C settings or Thermal settings. Leave those untouched, that seems to fix that for now. :)

Edit 4: Final update from me to give my blessings to these settings. Have used this phone under these settings for a week now with no crashing or random reboots, no slowdowns or lags in all well designed UIs. The smoothest UI experience I have ever had. And when you turn the screen off there is no battery drain like Alucard. Very happy with the results. Please try it. :D