[Google Pixel 6 Pro] Freak07:
Update to 2.4.0

Hey guys and girls,

Alright here´s the next update and it´s fine to flash on May firmware. As I suspected we already had all the changes for May by merging upstream.

I´ll include the changelog from 2.3.0 as well in this release post, since I think a lot of people flash the kernel on a monthly basis when the security updates drop. So this post pictures the changes going from 2.1.0 to 2.3.0! As I said 2.3.0 was kind of a final rehearsal to make sure everything is good for the May update.

I´ll put a remark behind changes going from 2.3.0 to 2.4.0.

This release is made for stable Android 12.1.0 May firmware. Not QPR Beta or A13 Beta!

Once I find enough time or QPR beta gets updated, I might update the QPR beta release. No plans to support A13 beta.

I also finished up the tables/graphs in regards to different binnings with the respective voltages on different tensor chips thanks to the dmesgs you all provided. I really want to put out a big thanks here to everyone for taking the time and participating. It was really great to see this kind of response.

I´ll provide them in a post in this thread soon.

So with that in mind we´ll get to the next paragraph were I could put those tables to good use.

A few changes from A13 Beta are merged to the kernel so we can enjoy the improvements on A12 ahead of time. Most of them aim to improve the scheduler and task placement.

However the recently dropped A13 Beta source contains a commit that can restrict max-cpufreqs based on PMU (Power monitor unit) reading. I setup this mechanism (lets call it "PMU Limiter") to mildly cut back max-freqs when they aren´t needed. It works quite well so far, with no performance impacts during scenarios where max cpufreq is beneficial. (e.g. app launching, camera launching, interaction etcetc)

That means if a certain threshold is not crossed the max-freqs will be restricted to 1,4GHZ/1,6GHZ/2,4GHZ (for little/mid/big cores). As soon as the PMU detects enough pressure, those limits will be lifted.

The frequency limits are based on tracing during various scenarios, benchmarking and also factor in the voltage table I was able to create. For example: 2.4GHZ for the big cores is the last freq step where a steady linear increase in voltage can be seen. Freq steps higher than 2,4ghz have a steeper slope.

Keep in mind CPU-Freqs shouldn´t be touched in EXKM/FKM or other kernel managers. They are controlled by various mechanisms now (thermal hal, powerhal, pmu limiter etc) and values will get overwritten based on input.

That means if you open the CPU section in a kernel manager, the maxfreqs will not be the actual maxfreqs that are possible. or the minfreqs might be raised. That´s normal and there´s nothing wrong if that´s the case.

Additionally to the previous changes tasks of rt, sf and ta groups are now biased to start on high capacity CPUs during app launches, interactions etc.

As usual, depending on your usage you may or may not notice a difference during these scenarios. :)

While tracing I noticed kswapd often takes 100% cpu share when reclamation is happening. Since we use an 8 core cpu, an additional kswapd thread is being spawned during boot, which increases throughput for kswapd in these scenarios. Reasoning behind this can be found here.

The trusty driver which connects to the fingerprintreader hal uses now a high prio workqueue when the phone is unlocked via fingerprint scanner. This means better performance, especially under stress. Keep in mind this is a kernel level change, it won´t magically improve fingerprint reader times manifold.

DAMON and DAMON-Reclaim were removed from 2.3.0 going to 2.4.0. I tested the feature privately and it unfortunately collides with googles EH zram implementation causing the phone to crash at the moment. Tried to debug this issue, but no luck for the May release here.

If you previously enabled the feature without adjusting the parameters properly and your phone didn´t crash, DAMON-Reclaim just didn´t do anything.

2.4.0 also has an updated anykernel3.zip, which includes all the latest anykernel3 changes.

Thanks to @capntrips we now have full support to resize vendor_dlkm partition which is part of the super partition. That means we finally can flash larger than stock vendor_dlkm partitions via anykernel3.zips and resize the partition properly instead of just dd´ing to it.

A huge thanks to @capntrips for working on this and to @osm0sis for maintaining anykernel3.

Disclaimer:

I´ll keep the warning as to preferably using magisk stable to avoid potential issues as well here in this post.

Please note that 24306 works fine for me though on non beta, stable May firmware!

Important:

Make sure you´re being rooted with magisk 24300 stable before flashing the kernel if you´re unsure. Any magisk version above 24303 might potentially lead to a reboot back to bootloader since android 12.1.0 and A12L QPR3 Beta. At the moment this only affects canary, but I put the warning just in case this will not get resolved in upstream magisk in time until the next stable drops. I saw a post that some modules also have problems with latest canary, so there´s a lot going on at magisk´s side at the moment.

A post containing a short write-up how to "downgrade" magisk can be found following this link.

If you´re one of the unfortunate ones that suffer from the device is corrupt bug on pixel 6 series please take a look at the FAQ at the beginning of this thread it contains a solution. The issue is probably caused by a bug that affects pixel 6 devices and has nothing to do with magisk or a kernel, it just happens to get triggered when using any of those.

Changelog:

- Linux-stable merged to 5.10.113

- Use prebuilt Google Clang 14.0.5 for compilation

- Utilize an additional kswapd thread to increase throughput for memory reclaim

- remove DAMON and DAMON-Reclaim from kernel build (2.4.0)

- improve trusty driver performance which connects to fingerprintscanner-hal by using high prio wq during fp unlock (2.4.0)

- mm improvements from kernel/common (2.4.0)

- improvements from kernel-common a13 to page_pinner

- mainline backports for BFQ scheduler

- rework Multi-Gen LRU implementation

- scheduler improvements for RT (realtime) tasks

- other scheduler improvements

- include scheduler improvements from A13 Beta regarding better task placement

- introduce and setup PMU limiter (prevents CPU from spiking to max when it isn´t needed, based on PMU reads)

- bias tasks of rt, sf and ta groups to prefer high capacity cpus during app launches, interactions, camera launches, etc

- updated anykernel3.zip (thanks to @osm0sis) -> adds full support for resizing vendor_dlkm ( huge thanks to @capntrips )

Download:

Downloads for : -Android- Generic Device/Other | AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.

Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.

www.androidfilehost.com

Instructions can be found in the OP! Please follow the instructions to avoid any issues and read this post carefully. Don´t use magisk canary 24303 or more recent to avoid potential issues!

If you´re coming from another kernel restore stock boot.img, dtbo.img, vendor_boot.img and vendor_dlkm.img before flashing. Thank you.

I wish everybody a great day/evening!

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/green tea: http://paypal.me/freak07