[Google Pixel 3 XL ROMs, Kernels, Recoveries, & Oth] Freak07:
Update to 1.5.1

Hey guys and girls,

this is just a minor update to 4.9.137. It just dropped when I was asleep.

I decided to use the last release post again in case anyone is new to the party. So the features and changes don´t get buried in the thread to soon!

Also as already stated I tested the keep root feature again and it worked fine for me multiple times.

You just have to download the new kernel.zip and flash it either in TWRP, EXKM or FKM and reboot afterwards. Do not flash the stock boot.img before. This will make you lose root!

If it isn´t working for you. Please post a recovery log while flashing it via TWRP. Describe the exact steps you did. Please tell me the magisk version you´re on. And which kernel you were on before, if you come from stock another custom kernel etc. Try to be as precise as possible please!

Here´s a short description of the changes:

1. Lowmemorykiller (LMK) daemon

Disable the userspace lowmemorykiller and enable Kernel LMK instead!

Enable OOM_REAPER for the Kernel LMK additionally! Additional for OOM_REAPER info can be found here.

We don´t want to run out of available RAM. That´s why we need a daemon that frees up RAM. But we also don´t want this to be too aggressive, as it´s otherwise causing excessive app redraws when trying to load the app from RAM.

Disable the overly aggressive userspace lowmemorykiller and enable the kernel lowmemorykiller instead! To counter possible system hangs/stalls, because not enough memory is freed, enable the OOM_REAPER by default!

2. ZRAM

Usually I tend to disable ZRAM on phones, because ZRAM uses CPU cycles to virtually enlarge the RAM of a device.

Have a read what exactly ZRAM is here.

However Google decided that 4GB of RAM must be enough for the Pixel 3/XL again. I won´t disable ZRAM by default. Instead I decided to pick the latest ZRAM changes from kernel/common in this kernel and try to enhance it further. (just like I did on the Pixel 2 XL with great success!)

There are different compression algorithms available for ZRAM. The most used one is LZ4. It offers the fastest compression and decompression speed.

The new ZRAM implementation introduces a "new" algorithm called ZSTD. Think of it as a more balanced algorithm. It has not quite as fast compression/decompression speeds as lz4 but it offers a higher compression ratio. The usage of ZSTD allows to store more "unneeded" resources in the 512MB of available space for ZRAM on the Pixel 3/XL than ZRAM that uses LZ4 (default for Pixel 3/XL).

For reference here is a benchmark verifying this:

https://github.com/mavam/compbench

This is also linked to OOM_REAPER and the Kernel LMK freeing RAM hopefully more efficiently for daily usage on the Pixel 3/XL. So far my tester reported better memory managment and that´s also what I´m experiencing! But one must keep in mind that 4 GB are in the end just 4 GB of RAM!

3. EAS

I decided for now to follow the EAS implementation from CAF for the Snapdragon 845. The kernel is now patched up to latest state by CAF for our SOC!

Have a read about EAS in general here but keep in mind this is for ARMS implementation! But to get the general idea this is definitely worth a read!

I´m getting quite ( ;) ) good battery life and exceptional performance, just like I want it from my pixel device.

4. Schedutil

Schedutil is a cpufreq governor that makes it possible to control CPU clock frequency selection directly from the scheduler. Schedutil works as a shim layer between the scheduler and the CPUFreq framework. This enables the scheduler to implement a CPUFreq policy governor by itself, basically replacing legacy governors such as ondemand, interactive, etc. The tight connection between the scheduler and clock frequency selection provides better system-wide policies and improves both performance and power savings.

Also patch up schedutil with latest patches from kernel/common and CAF!

More info about schedutil also here.

5. CAF Patches

CAF (Code Aurora Forum) patches are published regularly on their git for each Snapdragon SOC. I take it slow with merging these patches in as I want the releases to be completely stable.

For now I picked updates for cpuidle, which is responsible for low power modes and deep sleep.

6. Upstream patches from kernel/common

Will also be merged in regular intervals. So far sdcardfs and binder is up to date. Information on both can be found in the OP!

This release includes additional support for various Sony Controllers. Take a look at my github.

Patches for loop device and xfrm.

7. Linux-Stable Updates

Kernel is usually upstreamed to latest available stable version within a reasonable timeframe! ( I´m just a human :) ) This release bumps it from 4.9.135 to 4.9.136!

Have a read about linux-stable and why it is important here

8. MAC Randomization

This feature my come in handy for some that care about privacy. It´s disabled by default, because I know some networks detect devices based on MAC. Wouldn´t be nice if you walk in such a network and don´t get WiFi connection.

Each device has basically it´s MAC Adress and a network can identify your device via this address (for example a free WiFi at a big shopping mall) . That may be for various reasons. Like tracking you, displaying personalized ads, identify the righteous device to enter the network.

See here and maybe also there for more information.

The path to enable MAC Randomization is:

/proc/sys/dev/cnss/randomize_mac

I suggest you create a tile in EXKM app. Just go to Tools -> User Settings -> Hit the + Button and choose the correct path!

Type in "1" to enable. "0" means it´s disabled.

9. Optimize Power Consumption and System Fluidity!

Most of these patches are from the dear [MENTION=4800121]Sultanxda[/MENTION]. So all credits to him for that. I just cherry-picked them to the Pixel 3 XL. He did all the work to make this possible!

CPU Input Boost: a custom CPU boost driver to keep the phone smooth while maximizing battery life (details: 1, 2, 3)

Improved overall system fluidity and graphics performance (details: 1, 2, 3)

Reduced power consumption (details)

10. Miscellaneous Changes

F-Sync

There is an option to disable F-Sync via Kernel Manager now. However it is recommended to keep it on by default!

Enable Support for Gamepad Controllers

Playstation and XBox Controller support is enabled

Changelog

- Upstream to latest 4.9.137

- Enable Kernel LMK instead of Userspace LMK

- Patch up ZRAM with kernel/common patches and use ZSTD as default compression algorithm

- Add Mac Randomization

- Add latest CAF changes to EAS implementation

- Add CAF updates to cpuidle

- Enable OOM_Reaper

- Schedutil Updates

- patches to usb gadget, loop device, xfrm, sony HID

- Add CPU input boost from [MENTION=4800121]Sultanxda[/MENTION]

- Boost CPU and ddr bandwidth device when new frame is ready to be commited

- Boost CPU and ddr bandwidth pixel launcher

- Boost CPU and ddr bandwidth for important threads

- Force trivial, unbound kthreads onto low-power CPUs

- Option to disable F-Sync ( recommend not to do it, unless you think you know what you´re doing)

- Enable some Sony Controllers and Xbox Controllers

For further details please take a look at my github!

Download is below :)

Download:

https://www.androidfilehost.com/?fid=11410963190603846145

or following the link in the op to the correction version

Instructions can be found in the OP!

Have fun, enjoy the kernel and your phone.

If you like my work please consider a donation.

Donations are not mandatory but very welcome.

If you like my work and want to buy me a coffee: http://paypal.me/freak07