A custom kernel for (most) V20 variants
SwanKernel is an android kernel based on the latest Lineage OS 18.1 sources for the LG MSM8996 phones, aiming to bring those features and updates and improve them with some extra tuning, fixing and external features tailored specifically for the LG V20's performance characteristics and feature set, while trying to maximize the battery life and responsiveness of the device at the same time.
This kernel is based on Linux 3.18.140, and has become EOL with the last commit, as i don't think there's anything else that can be optimized for the V20 on this source anymore.
Which phone variants/models does this kernel support?
The kernel currently supports the following variants:
- H910/H915
- H918
- H990
- LS997
- US996
- VS995
What does this kernel intend to achieve?
The main goal here is to have a kernel that not only has extra features and improvements, but is also clean and concise, having only features that are truly needed from a kernel that will run alongside a Android 11-based ROM. One example of that is Kcal display control, a feature that is unnecessary here since most, if not all Android 11 ROMs have LiveDisplay for that exact same purpose and without the need to root. This helps the kernel have a smaller file size and lower processing overhead, as well as promote better maintainability.
This kernel does have a battery life bias, but will still scale up to maximum performance when needed. No Overclocking is done for now.
Does it have any features over stock?
Yes, a lot. The kernel is divided into two variants, here are the features both variants have over stock:
- AdrenoBoost for improved GPU performance.
- GPU and CPU/Cache Undervolt for better power efficiency on load.
- CPU governors tuned for better battery life and thermal stability without impacting performance all that much.
- Almost no unnecessary debug flags on the kernel for better kernel performance.
- Westwood TCP Congestion Algorithm set as default in order to have better network performance and consistency.
- AutoSMP CPU Hotplug to shutdown the big cores when their stronger performance isn't needed, slightly improving battery life on light loads and idle.
- Disabled CPU Boost when a finger is detected on screen, preventing unnecessary frequency boosts when no meaningful action is done other than tapping on screen and slightly scrolling around. We have Schedutil to keep it smooth anyways.
- USB Fast Charge.
- Multiple cherry-picks from different msm8996 sources with fixes and improvements to the kernel.
- Configurable wakelock blocker (boeffla) for roms that have some "unneeded" wakelocks enabled by default and/or users that know which wakelocks can be blocked for better battery life.
- Anxiety IO Scheduler enabled by default, offering a read bias and lower latency in IO operations.
- Kernel updated to Linux 3.18.140 with some extra patches from Googlesource.
- Wireguard support, improving VPN performance.
- Cryptographic functions optimizations, slightly improving the phone's performance when calculating hashes and so on.
The Extreme variant has some extra features over the Stable one, those being:
- Stronger Undervolts (i'm talking about borderline unstable undervolts here, so i really recommend that you flash the Stable one first).
- CPU Voltage Control if you need to setup a custom undervolt to keep it more stable and have no need to compile the kernel from source just to change the values... and that's assuming your phone even boots with this variant of the kernel.
- Disabled Battery BCL which eliminates the power throttling caused by the battery, just be careful when running demanding tasks while having almost no battery left.
Are there any bugs?
Right now, there's the dreaded Infrared Blaster, and it... kinda works? The IR is able to send the very first command i give to my LG TV without any problems after every reboot, but refuses to send anything else after that first command. The IR Blaster's light still works all the time though despite having some big delays between on/off states.
Download & Installation
The folders containing each kernel variant can be found here:
To install the kernel, it's the standard procedure:
- Download the kernel you want for your device
- Place it into the phone
- Boot into recovery, select it and then flash
- Wipe Dalvik Cache (optional, you only need to wipe it if you face random Force Closes, but it is a good practice anyway)
- Reboot.
- Open any app that can check the device info and look for "kernel", where it will show "... 3.18.xxx-Swan" if it installed correctly. I personally use SmartPack for that, but it requires root.
- Enjoy the experience!
Performance and Battery metrics
And now to the kernel's real world performance. But before delving in, keep in mind that my refurbished H910 is apparently a Snapdragon 821 prototype, that's why you will see higher than normal performance and clock values on cpu matters even with the LITTLE cores underclocked to 1785MHz instead of 2188MHz, the snapdragon 820 ones should not have any underclock applied and will reach the max of 1593MHz on them. I also took the liberty of testing those on the Extreme variant as BCL often interferes with the performance results and the extra undervolt doesn't increase performance in any substantial way, 5-7% at most on Geekbench.
Battery life:
Screen SOT test (Youtube looping through a massive playlist of songs with some scrolling to change between them):


Not very impressive, until you consider the battery currently powering it:

CPU/GPU Performance:
CPU performance according to Geekbench 5.4.1 (there is some minor variance of about 15-21 points in multithread):

CPU sustained performance on CPU Throttling Test(running it for 15+ minutes barely changes the curve, as it stabilizes at around 80-82 Celsius, i suppose a Snap 820 will fare better here due to the lower clocks):

GPU general performance on GFXBench 5:

No copper shim replacement or thermal pad change was made, the phone's internal structure is still the same from when i bought it.
Storage Performance:
General IO performance in Androbench 5(Not very accurate, but welp, if anyone has a more in-depth one feel free to share):

And there we go, everything i could benchmark so far. This will not be the best kernel on every front so the stock kernel on Lineage 18.1, Lighthouse's kernel or mk2000 might suit you better depending on your needs.
Battery life:
Screen SOT test (Youtube looping through a massive playlist of songs with some scrolling to change between them):


Not very impressive, until you consider the battery currently powering it:

CPU/GPU Performance:
CPU performance according to Geekbench 5.4.1 (there is some minor variance of about 15-21 points in multithread):

CPU sustained performance on CPU Throttling Test(running it for 15+ minutes barely changes the curve, as it stabilizes at around 80-82 Celsius, i suppose a Snap 820 will fare better here due to the lower clocks):

GPU general performance on GFXBench 5:

No copper shim replacement or thermal pad change was made, the phone's internal structure is still the same from when i bought it.
Storage Performance:
General IO performance in Androbench 5(Not very accurate, but welp, if anyone has a more in-depth one feel free to share):

And there we go, everything i could benchmark so far. This will not be the best kernel on every front so the stock kernel on Lineage 18.1, Lighthouse's kernel or mk2000 might suit you better depending on your needs.
Changelog
*********** Swankernel V1.09+ [Maintenance release] ***********
- CPU/Cache/GPU Voltages have basically reached the optimum point on both stable and extreme.
- Some performance commits were cherry-picked from newer kernels for other devices
- Dynamic FSync was disabled since it could cause data loss on some edge cases involving reboots.
- Improved some string routines and memory access functions, about 4% or so improvement on geekbench.
*********** Swankernel V1.09 [Last 3.18 version, i think] ***********
- Minor performance and power-saving optimizations throughout the kernel
- CPU M4M cache undervolting (not really a big difference, but nice to have anyway).
- A few cherry-picked fixes for the 3.18 msm8996 kernel tree.
- Crypto function optimizations and HW acceleration for CRC32 Enabled.
- Not actually a kernel change but: Can now be flashed on android versions lower than 11.
*********** Swankernel V1.08 ***********
- Small performance optimizations related to the voltage curves, especially in the GPU.
- PC USB Charging has been fixed and the phone can now be charged over it again.
*********** Swankernel V1.06 ***********
- Upstreamed kernel to 3.18.140 + some extra patches, with more coming later.
- Added Wireguard support for better VPN performance compared to IPSec.
- Smaller fixes to the kernel zip files, improving compatibility with some models.
- Minor performance optimizations, shouldn't be noticeable to the end user.
- Now stable enough (at least the Stable version is) to be used as a daily driver.
*********** Swankernel V1.00 ***********
Initial release. Has the features from 1 to 12 on both versions, and from 1 to 3 on the Extreme version.
Closing notes
With V1.09, the kernel can now be flashed on basically any android version and should work out-of-the-box, although i didn't test it on stock roms at all and there are no reports of it working there, so it might not work on them.
From what i could gather during the multiple Pre-Beta tests, the battery life improved considerably over the kernel shipped by default with Lighthouse V20 and even more when compared to Lineage's stock kernel.
If you have any suggestion or idea that can possibly improve the kernel, do not hesitate to share, i will try to implement it when my time allows it. If there are any problems that only happen on this kernel, submit a log and i'll try to look at it.
The kernel's source code can be found here.
And last but not least, a special thanks for those that helped me even if indirectly:
- @xxseva44
- @npjohnson
- @askermk2000
- @lybxlpsv
- @flar2
- @osm0sis
- And many, many others
Last edited: