Development [Kernel][08.06.2022][Android 12.1.0]Kirisakura 3.0.1 for Pixel 6/Pro aka "RAVIOLE"

Search This thread

Jon8RFC

Senior Member
Apr 3, 2010
113
65
TX
I guess everyone else already tried going into recovery and trying to get /proc/last_kmsg (doesn't exist) and /sys/fs/pstore (doesn't exist), or similar. I just googled and came across those...although last_kmsg was from 2012 and may not be applicable.

Anyway, I read that "you should patch your boot.img on your own phone" to play it extra safe. This has me wonder if maybe there is something barely different about the boot.img files from one phone to the next. Is there a chance, at all?
If so...
Freak07, would you mind sending me your working Kirisakura_Raven-2.1.0_A12_stable 24306 manually patched boot.img for raven/pixel6pro, if that's your phone? If it's a worthwhile trial, I'd like to see (just for grins), what happens if we trade. I never patched 2.3.0 with 24306, so I don't have that one handy, but I could still try your 2.3.0 anyway.

If feel like there must be a way to narrow down the cause, whether it's magisk or the phone, because of whatever changed between 24302 and 24303 being able to point at something in particular.

EDIT:
Actually, I do see /sys/fs/pstore/console-ramoops-0 with su while I'm booted into android. But apparently I don't know the right way to access that from recovery.

adb shell was my missing step. So /sys/fs/pstore/ does exist, but it's empty. No console-ramoops-0 either. Does this kernel support config_pstore?
 

Attachments

  • kirisakura_2.1.0_magisk_patched-24306_pixel6pro_apr22.zip
    16 MB · Views: 21
Last edited:
  • Like
Reactions: Freak07

viper8u2

Senior Member
Mar 8, 2008
252
33
I agree, my phone has been off the charger for almost 24 hours screen on time says 6h 27m and I am 53% battery left. Wow I just sent you a small donation to your Paypal to show my appreciation. Thank you
 
  • Like
Reactions: Freak07

roirraW "edor" ehT

Forum Moderator
Staff member
Anyway, I read that "you should patch your boot.img on your own phone" to play it extra safe. This has me wonder if maybe there is something barely different about the boot.img files from one phone to the next. Is there a chance, at all?
There is definitely no difference in the boot.img on different devices before patching with Magisk. There is definitely a difference in the boot.img when patched with Magisk on different devices.
 

Jon8RFC

Senior Member
Apr 3, 2010
113
65
TX
There is definitely no difference in the boot.img on different devices before patching with Magisk. There is definitely a difference in the boot.img when patched with Magisk on different devices.
Just to clarify that we're on the same page...

It's not merely a difference in the hash of the file because maybe magisk salts something innocuous but unique into each patched boot.img, like the wifi mac address and the first and last 2 digits of the IMEI or something?

So if I buy two Pixel 6 Pro phones, set them up identically, then patch boot.img, they will be fundamentally different and the boot.img files will function differently? If so, I'm even more interested to try a "working" 24306 boot.img
 
  • Like
Reactions: Freak07

capntrips

Senior Member
Aug 29, 2020
212
396
OnePlus 6T
Google Pixel 6
Just to clarify that we're on the same page...

It's not merely a difference in the hash of the file because maybe magisk salts something innocuous but unique into each patched boot.img, like the wifi mac address and the first and last 2 digits of the IMEI or something?

So if I buy two Pixel 6 Pro phones, set them up identically, then patch boot.img, they will be fundamentally different and the boot.img files will function differently? If so, I'm even more interested to try a "working" 24306 boot.img
For what it's worth, if I patch the same boot image with the same version of Magisk on both a Pixel 6 and a Pixel 5a, the binaries are identical. I'm sure there are some configuration differences between some devices that would prevent that from being the case, so I wouldn't expect that to be true for all devices.
 
  • Like
Reactions: Freak07 and Jon8RFC

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,578
18,565
I guess everyone else already tried going into recovery and trying to get /proc/last_kmsg (doesn't exist) and /sys/fs/pstore (doesn't exist), or similar. I just googled and came across those...although last_kmsg was from 2012 and may not be applicable.

Anyway, I read that "you should patch your boot.img on your own phone" to play it extra safe. This has me wonder if maybe there is something barely different about the boot.img files from one phone to the next. Is there a chance, at all?
If so...
Freak07, would you mind sending me your working Kirisakura_Raven-2.1.0_A12_stable 24306 manually patched boot.img for raven/pixel6pro, if that's your phone? If it's a worthwhile trial, I'd like to see (just for grins), what happens if we trade. I never patched 2.3.0 with 24306, so I don't have that one handy, but I could still try your 2.3.0 anyway.

If feel like there must be a way to narrow down the cause, whether it's magisk or the phone, because of whatever changed between 24302 and 24303 being able to point at something in particular.

EDIT:
Actually, I do see /sys/fs/pstore/console-ramoops-0 with su while I'm booted into android. But apparently I don't know the right way to access that from recovery.

adb shell was my missing step. So /sys/fs/pstore/ does exist, but it's empty. No console-ramoops-0 either. Does this kernel support config_pstore?
Just to clarify that we're on the same page...

It's not merely a difference in the hash of the file because maybe magisk salts something innocuous but unique into each patched boot.img, like the wifi mac address and the first and last 2 digits of the IMEI or something?

So if I buy two Pixel 6 Pro phones, set them up identically, then patch boot.img, they will be fundamentally different and the boot.img files will function differently? If so, I'm even more interested to try a "working" 24306 boot.img
For what it's worth, if I patch the same boot image with the same version of Magisk on both a Pixel 6 and a Pixel 5a, the binaries are identical. I'm sure there are some configuration differences between some devices that would prevent that from being the case, so I wouldn't expect that to be true for all devices.
Correct, you should always patch the boot.img yourself on your own device. Besides the advice to do that as patching on different devices might not create the exact same binary (has happened in the past, but don´t ask my why), the uninstall magisk option will not work properly if not patched on your own device. That´s the most important reason.

Kernel has pstore support. You can check how to get a ramoops via the linked post in the FAQ.
As far as I´m aware you can´t access pstore from stock recovery. we´d need a custom recovery for that.
You already learned how to access it from the running system, once booted up again after a crash occured.

Attached is the pixel 6 pro/raven boot.img uploaded to androidfilehost for 2.3.0 patched via magisk 24306.
Flashed powerhint module via magisk manager, then flashed the 4 images according to the instructions via fastboot/fastbootd and booted up no problems.

I agree, my phone has been off the charger for almost 24 hours screen on time says 6h 27m and I am 53% battery left. Wow I just sent you a small donation to your Paypal to show my appreciation. Thank you
Glad it´s working out for you!
Thank you very much for the donation! It´s greatly appreciated :)
 

Attachments

  • boot_raven_2.3.0_24306_magisk_patched.img
    64 MB · Views: 18
Last edited:

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,578
18,565
Update to 2.3.0

Hey guys and girls,

Here´s a small update for the original 2.3.0 update. The only changes are done to the scripts that setup the device during boot and a small adjustment to the powerhal to better integrate the PMU limit feature.

If you flashed the kernel.zip via a kernel manager app:
Re-Uploaded 2.3.0 to androidfilehost. Just redownload and reflash the zip and you´re good to go.


user following the manual installation method:
just download the new powerhint module and flash via magisk manager if you´re already running 2.3.0. Otherwise follow the instructions.



Previous changelog included for reference.

Alright here´s the next update. It´s a major one. I want to put it out shortly before we hopefully receive the next monthly security update on Monday kinda as a final rehearsal.
This kernel is made for stable Android 12.1.0 April 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.

A few changes from A13 Beta are merged to the kernel so we can enjoy the improvements on A12 already. Most of them aim to improve the scheduler and task placement.
A13 Beta source contains a commit that can restrict max-cpufreqs based on PMU reading. I setup this mechanism 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 etc)
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.

DAMON patch-series is included to this release as it was merged to kernel/common. It includes DAMON-reclaim. You can read more about it here.
This feature is currently disabled by default on this kernel. If you want to use it you can tune it to your liking as per the documentation linked above.
The feature can be enabled via:
Code:
echo 1 > /sys/module/damon_reclaim/parameters/enabled
I think Google might start to use it in the not so far future, but for now it´s disabled by default.


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 April 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
- improvements from kernel-common a13 to page_pinner
- mainline backports for BFQ scheduler
- rework Multi-Gen LRU implementation
- merge DAMON to the kernel, which includes DAMON-Reclaim (this feature is not enabled by default, you need to enable it manually if you want to test)
- 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



Download:


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
 

Jon8RFC

Senior Member
Apr 3, 2010
113
65
TX
Kernel has pstore support. You can check how to get a ramoops via the linked post in the FAQ.
As far as I´m aware you can´t access pstore from stock recovery. we´d need a custom recovery for that.
You already learned how to access it from the running system, once booted up again after a crash occured.

Attached is the pixel 6 pro/raven boot.img uploaded to androidfilehost for 2.3.0 patched via magisk 24306.
Flashed powerhint module via magisk manager, then flashed the 4 images according to the instructions via fastboot/fastbootd and booted up no problems.
Thanks! Unfortunately, it didn't work.

I removed my PIN hoping maybe if the pstore contents were encrypted-hidden in recovery (whatever that weirdness is that it does) that it'd be accessible, but it wasn't. I remember TWRP being unique in asking for the PIN to be able to access data from the phone.

As best I can infer, the pstore folder is overwritten on boot. I compared the files after a boot, then rebooted, and none of the old data was retained upon reboot. I also let it bootloop on the 5.10.113 kernel for ten times, then I flashed back to the 5.10.109 kernel, grabbed the console-ramoops-0 file and it only contained 5.10.109 references.

There were some older files I grabbed, but after seeing that data is overwritten on reboot, I struggle to believe that the data is relevant, which is why I tried with a different version kernel to more easily check. I've attached files I grabbed after clicking through a bootloop 10 times, then letting it idle through a bootloop 10 times, consecutively, then flashing a working boot.img. Based on the file size being half of that of a reboot from a successful boot (which overwrote all of the old data), I don't know if those "reboot info" messages were just from my flashing reboots in my batch file, or what.

Thanks again for entertaining this mess, Freak07. I really wish there was a quick way to figure this out...or that TWRP existed so I could actually pull the files in confidence.
 

Attachments

  • 10_and_10.zip
    76.6 KB · Views: 4

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,578
18,565
Thanks! Unfortunately, it didn't work.

I removed my PIN hoping maybe if the pstore contents were encrypted-hidden in recovery (whatever that weirdness is that it does) that it'd be accessible, but it wasn't. I remember TWRP being unique in asking for the PIN to be able to access data from the phone.

As best I can infer, the pstore folder is overwritten on boot. I compared the files after a boot, then rebooted, and none of the old data was retained upon reboot. I also let it bootloop on the 5.10.113 kernel for ten times, then I flashed back to the 5.10.109 kernel, grabbed the console-ramoops-0 file and it only contained 5.10.109 references.

There were some older files I grabbed, but after seeing that data is overwritten on reboot, I struggle to believe that the data is relevant, which is why I tried with a different version kernel to more easily check. I've attached files I grabbed after clicking through a bootloop 10 times, then letting it idle through a bootloop 10 times, consecutively, then flashing a working boot.img. Based on the file size being half of that of a reboot from a successful boot (which overwrote all of the old data), I don't know if those "reboot info" messages were just from my flashing reboots in my batch file, or what.

Thanks again for entertaining this mess, Freak07. I really wish there was a quick way to figure this out...or that TWRP existed so I could actually pull the files in confidence.
Like I said you can´t access pstore in stock recovery.

On each reboot sys/fs/pstore will be overwritten from the past running session. If you boot from fastboot to fastbootd to flash vendor_dlkm, the files will be overwritten as that´s a reboot.
Might need to use a few tricks to get a ramoops then.

I don´t fully understand what you´re trying to do or get logs for. From your previous post I assume you´re trying to figure out why patching with magisk 24300 works and boots but patching with magisk 24306 doesn´t work on your end?

If your device is bootlooping and not crashing like you describe, you can simply try to get a dmesg via adb shell with su access granted. If you get to adb shell there´s no need for a pstore.

adb shell

su

dmesg -w

check what´s happening or save the log.


So how you can get pstore for your situation if it´s crashing and not bootlooping and you never get to adb shell:

Install latest powerhint module via magisk manager.
Flash 2.3.0 boot.img patched via magisk 24300, the other images according to instructions and make sure everything works.
Now flash 2.3.0 boot.img patched via magisk 24306 and let the phone crash.
You might need to get the timing right if you press any buttons to get to bootloader. If you press too long you trigger a reboot which will overwrite previous pstore.

Once in bootloader, flash back working 24300 magisk patched 2.3.0 image. boot up and check if you have a ramoops of the crash. That way you avoid rebooting to fastbootd.

The 4 images you´re flashing always have to match from the same compilation. you can´t mix and match there.
 

Jon8RFC

Senior Member
Apr 3, 2010
113
65
TX
Like I said you can´t access pstore in stock recovery.

On each reboot sys/fs/pstore will be overwritten from the past running session. If you boot from fastboot to fastbootd to flash vendor_dlkm, the files will be overwritten as that´s a reboot.
Might need to use a few tricks to get a ramoops then.

I don´t fully understand what you´re trying to do or get logs for. From your previous post I assume you´re trying to figure out why patching with magisk 24300 works and boots but patching with magisk 24306 doesn´t work on your end?

If your device is bootlooping and not crashing like you describe, you can simply try to get a dmesg via adb shell with su access granted. If you get to adb shell there´s no need for a pstore.

adb shell

su

dmesg -w

check what´s happening or save the log.


So how you can get pstore for your situation if it´s crashing and not bootlooping and you never get to adb shell:

Install latest powerhint module via magisk manager.
Flash 2.3.0 boot.img patched via magisk 24300, the other images according to instructions and make sure everything works.
Now flash 2.3.0 boot.img patched via magisk 24306 and let the phone crash.
You might need to get the timing right if you press any buttons to get to bootloader. If you press too long you trigger a reboot which will overwrite previous pstore.

Once in bootloader, flash back working 24300 magisk patched 2.3.0 image. boot up and check if you have a ramoops of the crash. That way you avoid rebooting to fastbootd.

The 4 images you´re flashing always have to match from the same compilation. you can´t mix and match there.
Thanks. What it's doing is crashing then, and it cyclically reboots itself.

I was doing that before, but I expected something to stand out to me more obviously than some of these things which look like normal unlocked bootloader or custom kernel kind of things. I hope that the AVB error is exactly what it is, and then it's a piece of cake fix for magisk to correct. Is that it, a bug in magisk? Do I just post a bug report and send them dtbo.img, vendor_boot.img, vendor_dlkm.img, and both 24300 and 24306 boot.img files? Nope, that looks normal for unlocked bootloader/custom kernel stuff. And I have no idea what the other errors could remotely mean, so I hope you have some insight.

  1. successful boot with Kirisakura 2.1.0 patched via magisk 24300 and powerhint_p6_v11.zip
  2. restarted via interface
  3. held volume down button only after power off, bootloader came up
  4. fastboot flash boot kirisakura_2.1.0_magisk_patched-24306_pixel6_apr22.img
  5. clicked power button once to issue "START" from bootloader
  6. phone rebooted
  7. allowed to crash
  8. when screen was blank, held volume down button, bootloader came up
  9. fastboot flash boot kirisakura_2.1.0_magisk_patched-24300_pixel6_apr22.img
  10. clicked power button once to issue "START" from bootloader
  11. phone rebooted
  12. copied sys/fs/pstore/console-ramoops-0 file
 

Attachments

  • console-ramoops-0_24306_to_24300.zip
    44 KB · Views: 6
Last edited:

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,578
18,565
Thanks. What it's doing is crashing then, and it cyclically reboots itself.

I was doing that before, but I expected something to stand out to me more obviously than some of these things which look like normal unlocked bootloader or custom kernel kind of things. I hope that the AVB error is exactly what it is, and then it's a piece of cake fix for magisk to correct. Is that it, a bug in magisk? Do I just post a bug report and send them dtbo.img, vendor_boot.img, vendor_dlkm.img, and both 24300 and 24306 boot.img files? Nope, that looks normal for unlocked bootloader/custom kernel stuff. And I have no idea what the other errors could remotely mean, so I hope you have some insight.

  1. successful boot with Kirisakura 2.1.0 patched via magisk 24300 and powerhint_p6_v11.zip
  2. restarted via interface
  3. held volume down button only after power off, bootloader came up
  4. fastboot flash boot kirisakura_2.1.0_magisk_patched-24306_pixel6_apr22.img
  5. clicked power button once to issue "START" from bootloader
  6. phone rebooted
  7. allowed to crash
  8. when screen was blank, held volume down button, bootloader came up
  9. fastboot flash boot kirisakura_2.1.0_magisk_patched-24300_pixel6_apr22.img
  10. clicked power button once to issue "START" from bootloader
  11. phone rebooted
  12. copied sys/fs/pstore/console-ramoops-0 file
Yes that looks like you catched it.

I´d open an issue on magisk github. Explain that boot.img patched via magisk 24300 works, while 24306 breaks booting.
Upload all images (boot, dtbo, vendor_boot and vendor_dlkm), the unpatched ones and both patched images.
Describe the setup of your phone, verity enabled, remove all other modifications etc except the powerhint module to make sure the issue is not from something else.

Include the ramoops file and maybe someone might know why that is happening.
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,578
18,565
hello, can't we disable the magisk module that comes with this kernel? I did that then stuck at boot logo
No you can't disable it. It's crucial as it contains a part of the updated firmware from the qpr beta, which some kernel changes rely on.

I'll put a warning in the instructions in the OP.
 

McNaccken

Member
Nov 25, 2018
9
22
Hi there, just wanted to say big thanks to Freak07 and this awesome kernel! Flashed the latest one without a single problem and so far so good. Will report back in a few days how it goes, especially about the battery usage. Really curious about that. Thanks again!
 
  • Like
Reactions: Lycidias

awarman

Senior Member
Sep 19, 2010
76
47
Google Pixel 6 Pro
Does anyone notice degraded performance after your phone has been up and running for over 24 hours? I have no idea if it's the Kernel or not. I mostly notice that after a reboot I can record my screen with no fps drops then a day later when I attempt to use it, I notice the fps drops and lag. Is it kernel related or does it happen on stock? Is it just me?
 

Admiral2145

Senior Member
Sep 28, 2010
2,074
362
Xiaomi Poco F3
Google Pixel 6
Does anyone notice degraded performance after your phone has been up and running for over 24 hours? I have no idea if it's the Kernel or not. I mostly notice that after a reboot I can record my screen with no fps drops then a day later when I attempt to use it, I notice the fps drops and lag. Is it kernel related or does it happen on stock? Is it just me?
It was like that for me on the kernel before this one... I haven't tried this newer version yet to see if it was fixed or not... Most people said it was nothing wrong when I brought it up here.
 
  • Like
Reactions: awarman

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    Update to 3.0.0

    Hey guys and girls,


    Alright here´s the next update and it´s a very big one that´s why I decided to bump the kernel version to 3.0.0.

    I decided to rebase the kernel ahead of time. The base kernel is now build upon the Android 13 branch, but made to work on A12 by reverting a few changes that depend on too much firmware updates outside the kernel. That will also ease the transition for me once A13 stable is dropped.
    Thanks to the way the kernel is build the GKI way, the rest of the device specific drivers could be adjusted to work on A12 as well.
    There are quite a few improvements overall on the A13 branch and now we can take advantage of them before A13 drops as stable. Please note this kernel is made to work on A12 stable June firmware, not A13 beta.

    Thanks to @capntrips and all his hard work on hashtree patcher, there should be no problems flashing the updated kernel.zip on latest magisk canary (which some users may want to use to fix certain apps otherwise detection root) while leaving the verity/verification flags enabled when updating the phone as it´s integrated in the kernel.zip now. A huge thanks to @capntrips at this point.

    I will also stop distributing the files for the manual install as flashing via @capntrips kernel flasher app, which can be found here, is open source and free, works perfectly fine for me and that spares me a lot of work for each release.

    Now to the actual kernel changes:

    The kernel was rebased on the A13 branch for the Pixel 6 Pro but made to work on A12, which brings a lot of improvements all around.

    There´s a PMU limiting feature introduced in the A13 kernel. It was imported in the previous 2.4.0 release too and configured to try to reduce heat, reduce the usage of high cpu freqs when it isn´t needed. The explanation can be found in the release post of 2.4.0.
    I went ahead and refined the implementation and usage of that feature again.
    Short explanation: The PMU limiter can cut back max cpu freq if the PMU (performance monitoring unit) doesn´t cross a certain threshold. If that threshold is crossed the limit is lifted and the phone is allowed to use peak performance.
    While the previous approach restricted the cores just to a single limit of 1,4GHZ/1,6GHZ/2,4GHZ (for little/mid/big cores), the new approach restricts to different limits based on interaction and scenario what´s happening.
    That means there are different limits and thresholds for app launches, interaction (tapping the screen, scrolling), display idle (no movement on screen content, nothing interactions with the display, no tapping the screen etc).

    If none of the conditions below are met the limits are 1,19GHZ/1,32GHZ/1,42GHZ (for little/mid/big cores) if the performance threshold is not crossed.
    During app launches we keep the limit of 1,4GHZ/1,6GHZ/2,4GHZ (for little/mid/big cores) if the performance threshold is not crossed. (that´s useful to not boost too much if an app is already in memory)
    During scrolling limits of 1,4GHZ/1,6GHZ/1,8GHZ (for little/mid/big cores) will be set. The reason for that I will explain later.
    During idle screen limits of 1,19GHZ/1,0GHZ/1,1GHZ (for little/mid/big cores) will be set if the threshold is not crossed.

    If the device really needs max perf, the limits will be crossed and it will also perform to its max. The performance impact by the PMU limiter is minimal to negligible/non-existent.

    Uclamp value of top-app tasks, rt-tasks and sf-tasks are raised during interaction. This improves scrolling performance as it biases tasks to start on a mid or big CPU rather than a small one. By restricting the maxfreq of mid and big cores via the PMU limiter during scrolling/interaction we do not generate additional heat by doing that. The threshold was specifically tuned by doing a lot of tracing to achieve not crossing the PMU limit during scrolling. For example gmail scrolls a lot smoother now. Some apps like twitter just need to fix scrolling on their own end.

    BFQ improvements from linux-main were backported.
    Scheduler updates for pelt, load, tasks placement were backported from linux-main.
    LRNG was bumped to V45.
    An improved energy model for thermal control is used.

    And a huge bunch of additional changes.

    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:


    - Rebase kernel on A13 branch and make it work on A12
    - preserve all previous features and improvments
    - Linux-stable merged to 5.10.120
    - Use prebuilt Google Clang 14.0.7 for compilation
    - Scheduler improvements from latest linux kernel
    - BFQ improvements from latestlinux kernel
    - LRNG bumped to V45
    - use improved energy model for exynos cpu cooling/thermal control
    - MGLRU changes and updates
    - affine IRQS to CPU 7 during camera usage for improved performance as it tends to overload the little cores
    - allow GPU to scale down to 150mhz, but boost to higher value in case of interaction via powerhal
    - safetynet issues some users were experiencing while running 2.4.0 official release, but fixed later via the release here are solved and gone (if your app does not work due to root on stock kernel, the same will be the case here)
    - updated anykernel3.zip (thanks to @osm0sis) -> allow flashing using latest canary with enabled vbmeta flags ( huge thanks to @capntrips )
    - loads of other changes, please check github



    Download:

    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
    20
    I assume the touchscreen will need the updated drivers that were needed for QPR beta builds before.

    It´s getting late here and usually google is pushing the source somewhere during nighttime in my timezone. I´ll try to get the kernel updated as soon as possible once I know it´s stable.

    I wish everybody a great day/evening.
    20
    Update to 3.0.1

    Hey guys and girls,


    Alright here´s a hotfix for 3.0.0 which had broken netflix, amazon prime video, HBO and other streaming apps playback that relies on a trusted secure connection to establish playback. (thanks to @Gungrave223 for the report)
    The A12 hal is not yet ready for some driver changes introduced in the A13 kernel base. Those changes were identified and reverted. Thanks to @TotallyAnxious for providing me the logs via PM.
    Playback for those services works fine again on 3.0.1.
    Seems like during testing for just a little bit over the last two weeks no time was found to watch a single stream on the phone and that little bug slipped through. 🤠

    I´ll include the changelog for 3.0.0 again in this post in hide tags as I´m sure not everyone has yet upgraded and that post contains a lot of vital info.
    The original release post for 3.0.0 can be found following this link.

    I wish everyone a nice day.
    Changelog for 3.0.0 below:

    Alright here´s the next update and it´s a very big one that´s why I decided to bump the kernel version to 3.0.0.

    I decided to rebase the kernel ahead of time. The base kernel is now build upon the Android 13 branch, but made to work on A12 by reverting a few changes that depend on too much firmware updates outside the kernel. That will also ease the transition for me once A13 stable is dropped.
    Thanks to the way the kernel is build the GKI way, the rest of the device specific drivers could be adjusted to work on A12 as well.
    There are quite a few improvements overall on the A13 branch and now we can take advantage of them before A13 drops as stable. Please note this kernel is made to work on A12 stable June firmware, not A13 beta.

    Thanks to @capntrips and all his hard work on hashtree patcher, there should be no problems flashing the updated kernel.zip on latest magisk canary (which some users may want to use to fix certain apps otherwise detection root) while leaving the verity/verification flags enabled when updating the phone as it´s integrated in the kernel.zip now. A huge thanks to @capntrips at this point.

    I will also stop distributing the files for the manual install as flashing via @capntrips kernel flasher app, which can be found here, is open source and free, works perfectly fine for me and that spares me a lot of work for each release.

    Now to the actual kernel changes:

    The kernel was rebased on the A13 branch for the Pixel 6 Pro but made to work on A12, which brings a lot of improvements all around.

    There´s a PMU limiting feature introduced in the A13 kernel. It was imported in the previous 2.4.0 release too and configured to try to reduce heat, reduce the usage of high cpu freqs when it isn´t needed. The explanation can be found in the release post of 2.4.0.
    I went ahead and refined the implementation and usage of that feature again.
    Short explanation: The PMU limiter can cut back max cpu freq if the PMU (performance monitoring unit) doesn´t cross a certain threshold. If that threshold is crossed the limit is lifted and the phone is allowed to use peak performance.
    While the previous approach restricted the cores just to a single limit of 1,4GHZ/1,6GHZ/2,4GHZ (for little/mid/big cores), the new approach restricts to different limits based on interaction and scenario what´s happening.
    That means there are different limits and thresholds for app launches, interaction (tapping the screen, scrolling), display idle (no movement on screen content, nothing interactions with the display, no tapping the screen etc).

    If none of the conditions below are met the limits are 1,19GHZ/1,32GHZ/1,42GHZ (for little/mid/big cores) if the performance threshold is not crossed.
    During app launches we keep the limit of 1,4GHZ/1,6GHZ/2,4GHZ (for little/mid/big cores) if the performance threshold is not crossed. (that´s useful to not boost too much if an app is already in memory)
    During scrolling limits of 1,4GHZ/1,6GHZ/1,8GHZ (for little/mid/big cores) will be set. The reason for that I will explain later.
    During idle screen limits of 1,19GHZ/1,0GHZ/1,1GHZ (for little/mid/big cores) will be set if the threshold is not crossed.

    If the device really needs max perf, the limits will be crossed and it will also perform to its max. The performance impact by the PMU limiter is minimal to negligible/non-existent.

    Uclamp value of top-app tasks, rt-tasks and sf-tasks are raised during interaction. This improves scrolling performance as it biases tasks to start on a mid or big CPU rather than a small one. By restricting the maxfreq of mid and big cores via the PMU limiter during scrolling/interaction we do not generate additional heat by doing that. The threshold was specifically tuned by doing a lot of tracing to achieve not crossing the PMU limit during scrolling. For example gmail scrolls a lot smoother now. Some apps like twitter just need to fix scrolling on their own end.

    BFQ improvements from linux-main were backported.
    Scheduler updates for pelt, load, tasks placement were backported from linux-main.
    LRNG was bumped to V45.
    An improved energy model for thermal control is used.

    And a huge bunch of additional changes.

    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:


    - Rebase kernel on A13 branch and make it work on A12
    - preserve all previous features and improvments
    - Linux-stable merged to 5.10.120
    - Use prebuilt Google Clang 14.0.7 for compilation
    - Scheduler improvements from latest linux kernel
    - BFQ improvements from latestlinux kernel
    - LRNG bumped to V45
    - use improved energy model for exynos cpu cooling/thermal control
    - MGLRU changes and updates
    - affine IRQS to CPU 7 during camera usage for improved performance as it tends to overload the little cores
    - allow GPU to scale down to 150mhz, but boost to higher value in case of interaction via powerhal
    - safetynet issues some users were experiencing while running 2.4.0 official release, but fixed later via the release here are solved and gone (if your app does not work due to root on stock kernel, the same will be the case here)
    - updated anykernel3.zip (thanks to @osm0sis) -> allow flashing using latest canary with enabled vbmeta flags ( huge thanks to @capntrips )
    - loads of other changes, please check github



    Download:


    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
    16
    Hello everyone,

    I just found a very small oversight regarding the powerhal, which I corrected in the kernel.zip now. The kernel itself hasn´t changed.

    I re-uploaded the zips for 3.0.0. If you flashed them already prior to this post, feel free to reflash. It probably won´t hurt, that much to run the old zip, but it´s better to flash the new one. Just flash over 3.0.0 if you´re already running it.
    You can grab the updated 3.0.0 zips from the release post by following this link.

    Sorry for any inconvenience caused. I wish everyone a great day.
    10
    Hey man I just want to say thank you for taking the time to make this legit kernel. I know a lot of people just come here with issues but I just wanted to thank you.
  • 100
    Kirisakura-Kernel for the Pixel 6/Pro

    Hello everyone,

    To keep it short: Here is Kirisakura - Kernel for the Google Pixel 6 Pro aka Raven and the Pixel 6 aka Oriole, together Raviole.
    I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.

    The kernel aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security, stability and performance!
    This includes Linux-Stable, F2FS-Stable and kernel/common!
    If that got you curious, have a read about linux-stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.

    The kernel includes a lot of improvements and contributions from other developers as well. Without this kernel would not exist.
    A big part of improvements originate from @arter97´s, @kdrag0n´s and @Sultanxda´s work. Many others contributed in some way or another to this kernel.
    A big thanks to all of them at this place!

    Now lets continue with a list of features in the next paragraph!

    Features:
    Main Features:
    - Based on latest A13 kernel sources from Google, Kernel is made for Android 12
    - Linux-Stable-Upstream included to 5.10.120
    - Compiled with prebuilt Google clang 14.0.7
    - merged kernel/common (improvements to android-common-kernel straight from google)
    - Multi-gen LRU backported (more info here, here as well and here) to improve mm and reduce cpu cycles
    - Utilize an additional kswapd thread to increase throughput for memory reclaim
    - pelt multiplier tied into powerhal to speed up scheduler during interaction (more info here)
    - prevent frequency spikes caused by small transient tasks when the device is idle(more info here)
    - tie mechanism to prevent frequency spikes caused by small tasks also into powerhal
    - scheduler improvements for RT (realtime) tasks
    - introduce and setup PMU limiter (prevents CPU from spiking to max when it isn´t needed, based on PMU reads, more information here)
    - improve camera performance by tuning the powerhal during recording
    - bias tasks of rt, sf and ta groups to prefer high capacity cpus during app launches, interactions
    - improve app launches via powerhal
    - improve trusty driver performance which connects to fingerprintscanner-hal by using high perf wq during fp unlock
    - restrict maximum CPU-Freqs during screen off/ idle to 1.1GHZ for all clusters to save power
    - introduce unfair f2fs rwsems to prevent writer starvation and improve IO perf under heavy load
    - fuse: give wakeup hints to scheduler to speed up compress/decompress in internal storage (details)
    - enable RCU_BOOST (details here), also fix RCU_BOOST behaviour
    - F2FS-Stable updated
    - TCP backports from mainline
    - BFQ updates backported from mainline
    - Scheduler updates from linux-main
    - use improved energy model for exynos cpu cooling/thermal control
    - allow GPU to scale down to 150mhz, but boost to higher value in case of interaction via powerhal
    - affine IRQS to CPU 7 during camera usage for improved performance as it tends to overload the little cores
    - use bbr as default TCP congestion algorithm (fasted algo according to this excellent research from @kdrag0n found here )
    - Enable support for TTL spoofing
    - Include LRNG, see here and here for more info, bump to v45 with 3.0.0
    - important patches from kernel/common for 5.10 (here are more details)
    - CleanSlate Features from @tbalden, big applause here! (s2s, notification booster, battery saver, flashlight notifications. Please note: cleanslate features that work otherwise with rooted devices like kadaway (adblocking) are not implemented on this kernel since I´m running rooted)
    - dirty pipe exploit fixed
    - supports direct usb access for hi-res playback over USB-C DACs
    - flashing the kernel will preserve root

    Various Optimizations:
    - update several drivers to use power efficient workingqueues (for example wlan driver)
    - kernfs: use buffer from the stack space
    - printk: use buffer from the stack space
    - kthread: use buffer from the stack space
    - bpf: avoid dynamic memory allocation for small value buffers
    - binder: Reserve caches for small, high-frequency memory allocations
    - kernfs: use kmem_cache pool for struct kernfs_open_node/file
    - cgroup: use kmem_cache pool for struct cgrp_cset_link
    - f2fs: reduce timeout for uncongestion
    - f2fs: Demote GC thread to idle scheduler class
    - f2fs: set ioprio of GC kthread to idle
    - mm: vmstat: use power efficient workingqueues
    Wakelock Blocker:
    - advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
    - please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]this for further info

    AK3 Helper Module:
    - restrict little cluster to 1,19ghz mid cluster to 1,19ghz and big cluster to 1,1ghz during screen off, to reduce battery usage for example during music playback
    - only use little cores during screen off/device suspend
    - tie pelt multiplier into the powerhal (more info here)
    - prevent frequency spikes caused by small transient tasks during idle operation (more info here)
    - boost scheduler using the pelt multiplier during fingerprint unlock operation
    - setup and control PMU limiter via powerhal (more info here)

    DOWNLOAD:
    Download is always located in this folder:

    Changelog:
    Android 12.0.0

    1.0.0 Initial Release
    1.0.2 https://forum.xda-developers.com/t/...r-pixel-6-pro-aka-raven.4358435/post-85910621
    1.0.5 https://forum.xda-developers.com/t/...r-pixel-6-pro-aka-raven.4358435/post-85924419
    1.3.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-85976139
    1.4.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86109665
    1.5.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86259863
    1.7.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86390563
    1.8.4 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86541727

    Android 12.1.0 Stable (March feature drop and more recent)
    2.0.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86617873
    2.0.1 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86637233
    2.1.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86695911
    2.3.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86821331
    2.4.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86834981

    Android 12.1.0 Stable (June feature drop and more recent)
    3.0.0 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86992705
    3.0.1 https://forum.xda-developers.com/t/...pixel-6-pro-aka-raviole.4358435/post-86996237



    Android 12L QPR Beta - Deprecated

    Requirements

    - unlocked Bootloader
    - USB-Debugging in developer options enabled
    - latest adb and fastboot binaries
    - working adb and fastboot environment so you can flash back to stock in case something goes wrong
    - working magisk environment (a device rooted with latest magisk stable in case you want to be absolutely safe)


    How to flash the Kernel:
    1a. Make sure you tick all the requirements above
    1. Download the correct kernel.zip depending on your device (Pixel 6 = oriole || Pixel 6 Pro = raven)
    2. Flash the correct kernel.zip via EXKM, FKM or kernel flasher. Root will be preserved. The AK3 magisk helper module will be automatically installed during flashing the kernel.zip and be present on next reboot.
    Do not remove or disable the AK3 Magisk Helper Module otherwise the device will bootloop.
    3. Reboot and profit.


    Manual installation is no longer supported starting with release 3.0.0, as there´s a free open-source option to flash kernel.zips now.
    Instead use the free kernel flasher, which can be found here.

    Manual installation without relying on paid apps like fkm/exkm:
    Please have a look at the linked post.



    Donations:
    Donations are not mandatory but very welcome if you want to support development or just buy me a coffee/tea/beer :)
    If you like my work: http://paypal.me/freak07

    Credits:
    @osm0sis for all his work on AK3.
    @tbalden for being the best HTC, Pixel, OnePlus and Asus wingman!
    @capntrips for all his work on the pixel 6!
    @LeeDroid and @mwilky for their awesome roms and work I used on multiple devices!
    @Captain_Throwback for all the mentoring and guidance!
    @Eliminater74 for bringing me into the game and the Inspiration
    @nathanchance for his upstream guidance and assistance
    @RenderBroken for helping me out
    @flar2 for all his work
    @joshuous for all the help he provided to me in the past!
    @arter97 for giving me advice
    @kdrag0n for his help and advices!
    @topjohnwu for magisk and his entire work!


    Source Code: https://github.com/freak07/Kirisakura_Raviole
    37
    Update to 1.8.4

    Hey guys and girls,


    So here´s the next update. It´s kind of an off schedule update, as I planned to update the kernel with the next security update/feature drop.

    But in the light of recent events regarding the new exploit called "Dirty Pipe" (more info here), which is similar to the "Dirty Cow" exploit from a while ago, but easier to exploit this time, I decided to release an update ahead of schedule.

    This exploit was fixed in linux-stable 5.10.102, as opposed to a single commit in AKC (android kernel common, commit here). This shows once more why merging linux-stable is beneficial as explained in detail in the OP.

    Since one of the key aspects of this kernel is security and staying on par with upstream (which often fixes exploits way ahead of android security bulletin updates, even before an exploit is even known or fixed via a patch on the security bulletin) I decided to release this update as quickly as possible, so this exploit is fixed on devices running this kernel.

    Several other notable improvements and changes in this release:
    Bring in scheduler updates from Android 13 Developer Preview, which aim at improving task placement. (adjust powerhal accordingly)
    BFQ IO-Sched is now on par with linux-mainline.
    Several fixes to mm subsystem, f2fs and others.

    Several other improvements are included as well. More details in the changelog.
    Download is below.
    Updated instructions in the OP!


    Changelog:
    - linux-stable 5.10.103
    - contains fix for the dirty pipe exploit
    - built with clang 14.0.2 prebuilt by google
    - improvments from kernel/common
    - fix memory leaks
    - security related patches
    - mm improvments
    - f2fs fixes
    - scheduler fixes
    - for details please check github
    - built with improvements from A13 Dev Preview to display driver
    - other changes please look at my github


    Download:


    Instructions can be found in the OP! Please follow the instructions to avoid any 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.
    37
    Update to 1.7.0

    Hey guys and girls,


    So here´s the next update. It includes the february security update. Most of the changes brought by the February kernel source drop, were already included in this kernel by merging kernel/common and linux-stable.


    Several other notable improvements and changes in this release:
    Improve f2fs performance by merging a patchset to prevent writer starvation for the checkpoint thread. This was discussed this month in the f2fs mailing list and is already merged to the kernel/common tree. It´ll improve performance under heavy I/O utilization.
    You can find more information following the discussion here.
    Necessary backports were brought to the kernel and the platform specific f2fs-implementation was also adjusted.
    Latest f2fs-stable was also merged to the kernel.

    Update the patchset to prevent frequency spikes caused by small tasks as well. Tie those new changes into the powerhal. (That means users not flashing the kernel.zip, but instead use the manual installation method, which are only a handful from the download count, need to flash the updated magisk helper module. Users that flash the kernel.zip via FKM/EXKM have to just flash and forget)

    Several other improvements are included as well. More details in the changelog.
    Download is below.
    Updated instructions in the OP!


    Changelog:
    - February Security update merged
    - linux-stable 5.10.96
    - include latest f2fs-stable
    - improvments from kernel/common
    - fix memory leaks
    - security related patches
    - mm improvments
    - for details please check github
    - introduce unfair f2fs rwsems to prevent writer starvation and improve IO perf
    - update patchset to prevent freq spikes caused by small transient tasks (also tie this into powerhal)
    - give pelt multiplier power hint for scheduler performance boost during fingerprint unlock
    - fuse: give wakeup hints to scheduler to speed up compress/decompress in internal storage (details)
    - enable RCU_BOOST (details here), also fix RCU_BOOST behaviour
    - update LRNG implementation (thanks to arter97 )
    - improvements/fixes for CleanSlate features
    - other changes please look at my github


    Download:


    Instructions can be found in the OP! Please follow the instructions to avoid any 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.
    36
    Update to 2.1.0

    Hey guys and girls,


    Alright here´s the next update. And it´s again a really big update! :)
    A few weeks ago google pushed a backport of Multi-Gen LRU for the 5.15 kernel to their aosp/kernel common branches. I went ahead and backported that to our 5.10 tree alongside other mm-improvements from linux-mainline. By now google pushed their own backport for 5.10, but I decided to go with my original implementation as it contains a lot more improvements alongside the main Multi-Gen LRU backport and ran stable for well over 3 weeks.

    Powerhal was adjusted quite significantly too. CPU-freqs are restricted to 1.1GHZ max during screen off/device idle operations to save more power. App launches and camera operation are improved as well in the powerhal. General usage benefits from those changes too.

    Latest linux-stable, f2fs-stable and kernel/common were merged as well.

    Users that decide to not use the CleanSlate features and don´t install the apps won´t see the kernel parsing for the config files extensively.
    Vibration Booster from CleanSlate was improved as well to kind of counter the weaker haptic feedback since the March update. Please check the linked thread from the changelog. Huge thanks to @tbalden for this. If you want to give a little bit back consider purchasing the apps via playstore or maybe a small donation. :)



    I´ll keep the warning as to preferably using magisk stable to avoid potential issues as well here in this post.
    Please note that 24305 works fine for me though on non beta, stable April 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.



    Changelog:

    - Update for April Source
    - Linux-stable merged to 5.10.109
    - f2fs-stable merged
    - fixes and improvements from kernel/common including several subsystems
    - multi-gen LRU ( more info here, here as well and here)
    - general LRU improvements from Linux-Mainline
    - improve camera performance by tuning the powerhal during recording
    - improve app launches via powerhal
    - restrict maximum CPU-Freqs during screen off/ idle to 1.1GHZ for all clusters to save power
    - remove cleanslate config files getting parsed excessively even if user did not install the CleanSlate apps
    - improve vibration boosting feature in CleanSlate config app to allow stronger vibration again(please have a look at this post )
    - other fixes for CleanSlate features such as sweep to sleep
    - updated anykernel 3 zip, thanks to @osm0sis
    - probably a lot more I forgot as time is short for me.


    Download:


    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
    35
    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:


    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