[LG L Fino ROMs, Kernels, Recoveries, & Other Devel] christpp:
experimental update

Hi,

I have been working on some complicated additions/modifications to this ROM lately. Unfortunately, I haven't had much time to test them on my device before publishing, and I will be away from my building PC for the next days. That is why I publish this update as experimental. If it appears to work well, I will make it a standard update and will update first post and changelog.

If you are into helping me out testing this update, you can grab the zip files from the links at the end of the post. I have been using it for 2 days without any issues.

Here is what changed:

Use a realtime thread for displaying the system UI. This is just a build.prop edit (it is a feature of Android Nougat), and It helps with increasing FPS on non-OpenGL Apps. I have made some tests and it turns out that FPS really increase on the Fino. It does not always hit the target of 60 FPS, but results are a lot better than before. By scheduling the display thread as RR, time between it asks for execution and being executed is minimized, which reduces latency.

Scheduler changes to improve execution of RR (realtime tasks). RR tasks will not be scheduled on a CPU which currently handles interrupts, so they will be executed as soon as possible. With recent changes, RR tasks include GPU kernel driver functions, MMC functions, the Android's Display thread mentioned above and encryption related functions.

Backport some code from 4.x kernel, so dm-crypt supports multiprocessor execution. This change was done by me and by hand, so there is a chance for kernel errors. So far, no issues though. This work helped me identify where the Adoptable Storage reduced speed was coming from. When a card is adopted, every read or write to the storage has to go through the kernel's encryption mechanism, which is inside dm-crypt (/drivers/md/dm-crypt.c). Code executed in there is quite heavy and needs much processor power. Until recently, dm-crypt was able to use only one CPU at a time. Changes in previous release and in this experimental update enable it to use all 4 cores. Still, it struggles to keep up to the task. Recent ARM64 devices have some sort of hardware acceleration support for encryption, which our ARMv7 cores are lacking. So, results will not get better than what we have. With my additions, Adoptable storage is able to achieve a read speed of 21MB/s and a write speed of 9MB/s, where the same SD card formatted as fat32 achieves 25MB/s and 11MB/s respectively. I can get Telegram on Adoptable Storage to start up at around 2 seconds with this change, however WhatsApp still struggles. Results seems to be App specific.

Interrupt balancing. I have done some (small at this point) work to get some interrupts off the first CPU. By default, the interrupt handler puts all interrupts on CPU0. This might increase latencies, when interrupts happen often. This is some early work, more are coming in next releases.

Fix some references to HZ in GPU drivers. I have changed the scheduler tick frequency some time before, and it appears to work well. However, some code in the kernel was (badly!) designed having in mind that HZ value was locked at 100. This change was taken directly from Android Upstream code.

Media Codec XMLs are changed so google codecs are used for mp3 playback, to fix the known distorted sound issue spotted some time ago.

Note:

To get full results of all the changes, I recommend disabling intelliplug, so all 4 cores are up 100% of time. It does not cause much battery drain for me (I was considering of disabling it in this build). To do that, open a Terminal, become root and execute the following:

echo 0 > /sys/kernel/intelli_plug/intelli_plug_active

Also, dm-crypt needs some changes too. I have added some lines in init.rc but it turns out they do not work, so they will be coming corrected later. For now, do the following in a terminal (as root):

echo 8 > /sys/class/block/dm-0/queue/max_sectors_kb

This will make requests for read/write smaller, but able to be distributed to more CPUs. All above changes won't survive a reboot!

Lastly, about Oreo: Things are on hold again. I am waiting for support for camera HAL 1 to arrive in LineageOS, and then build it. I do not want to build a semi-working ROM, when Android Nougat is not yet considered outdated.

DOWNLOAD LINKS:

l70pn:

https://mega.nz/#!FlgWGSwL!TIsoH-qNn2pS3n-kD8I4bZJCbARGAkrOzpxmWMl-xbM

l70pds:

https://mega.nz/#!UhQnwIAI!-VuApYCQc-P_xsWaiCM9wJV9oBUK-k66IhubCcwcRaU