Development [Kernel][12.08.2023][Android 13.0.0 Stable]Kirisakura_Raviantah 1.1.4 for Pixel 7/Pro aka "Pantah"

Are you interested in a magisk module introducing a so called summer mode(explanation in the thread)

  • Yes

  • No


Results are only viewable after voting.
Search This thread

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,337
22,376
Kirisakura-Kernel for the Pixel 7/Pro

Hello everyone,

To keep it short: Here is Kirisakura - Kernel for the Google Pixel 7 Pro aka Cheetah and the Pixel 7 aka Panther, together Pantah.
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.
By merging linux-stable regularly we get most security updates months ahead of the stock kernel and also before they even end up in the android security bulletin.


The kernel includes a lot of improvements and contributions from other developers as well. Without those contributtion this kernel would not exist as it is.
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 13 Stable
- Linux-Stable-Upstream included to 5.10.189
- Compiled with prebuilt Google clang 17.0.3
- Backport entire RCU subsystem to linux 6.0
- Lazy RCU which should result in power-savings while the device is lightly-loaded or idling, more information here
- Backport Maple tree from Linux 6.1
- improve preallocations from maple tree (affects especially android)
- reduce necessity to rewalk the maple tree
- Per VMA-locks in conjunction with Maple Tree RCU-Mode (improve app launch time, this feature in general benefits greatly from lazy rcu!)
- further improve maple tree/per-vma locks introduced in an earlier release
- Dynamic Energy Models depending on device state
- make TEO-Cpuidle util-aware (improves latency, performance and decreases energy consumption for certain workloads, more information here)
- introduce runnable boosting, wire it up with pixel_sched
- improve CPU throttling behaviour
- improvements to uclamp, prevent capacity inversion (reduce missed frames)
- greatly speed up camera launch time!
- merged kernel/common (improvements to android-common-kernel straight from google)
- MM subsystem reworked (more info and some patchsets linked in this post)
- Multi-gen LRU backported/reworked and enabled (more info here, here as well and here) to improve mm and reduce cpu cycles, latest V15 state
- 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
- restrict maximum CPU-Freqs during screen off/ idle to 1.4GHZ 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
- merge and enable f2fs block_age-based extent cache (improve the accuracy for data temperature classification, reduce the garbage collection overhead after long-term data updates)
- TCP backports from mainline
- SSG IO scheduler for reduced overhead and less CPU cycles (more lightweight and android optimized)
- scheduler backports from linux-main
- mm updates from linux-main
- locking updates frm linux-main
- improve memory performance by tweaking google´s eh zram implementation
- fix sysfs endpoint for googles eh zram
- 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 )
- include bbrv2 from google, more info here
- Enable support for TTL spoofing
- important patches from kernel/common for 5.10 (here are more details)
- increase priority of GPU work
- several updates from QPR beta, and a few from Pixel 6 that googles missed to include in the pixel 7 kernel
- improve thermals
- change compaction proactiveness based on device state for improveed memory management
- improve ZRAM usage
- reduce overhead

- improve performance and efficiency by properly wiring up pixel_sched with teo util awareness (thanks @ada12 for spotting this!)
- update to cpuset/cgroup subsystem (speeds up camera launches, device unlocks etc as cpusets are switched on those conditions, patches reduce overhead in those conditions)
- flashing the kernel will preserve root


CleanSlate Features
- 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)
- Check the CleanSlate thread for more information about those features
- The CleanSlate thread also contains the apps that allows you to control those features!
- If you consider those features useful, maybe consider purchasing the apps in the PlayStore or a small donation to @tbalden, he deserves it! Don´t forget to switch to beta channel for those apps, as this is needed for device running A13!


Various Optimizations:
- update several drivers to use power efficient workingqueues (for example wlan driver)
- f2fs: reduce timeout for uncongestion
- f2fs: Demote GC thread to idle scheduler class
- f2fs: set ioprio of GC kthread to idle
- tcp: enable advanced tcp, give user more options for tcp alorithm
- mm: vmstat: use power efficient workingqueues
Wakelock Blocker:
- advanced wakelock blocker with the ability to block kernel wakelocks (dangerous, use with caution, please read this for further info). You should only block kernel wakelocks in case you face uncontrollable scenarios, like company wifi causing a wakelock to be active 100% of the time! Blocking kernel wakelocks to "improve" battery life almost always backfires and causes issues!


Powerhint Module:
- restrict little cluster to 1,4ghz mid cluster to 1,4ghz and big cluster to 1,4ghz during screen off, to reduce battery usage for example during music playback
- only use little cores during screen off/device suspend
- account for scheduler and other changes done to the kernel
- boost memory interface controller during interaction (decreased missed frames, improved soc efficiency according to google docs)
- 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)
- switch between default and custom idle energy model on device is being interacted with / device idle.
- reduce missed frames during scrolling/device interaction by adjusting uclamp boosts
- dynamically adjust target load for memory interface during interaction.
- remove dynamic GPU policy change as it´s causing instability and is unneeded due to GVFS period
- implement handling during video recording of CPU like Google did on QPR A13
- more small improvements

DOWNLOAD:
Downloads are attached to the release posts linked below in the changelog section.


Please note that androidfilehost is currently not working properly.
Link to AFH:
Deprecated afh download, still here for old releases:


Changelog:
Android 13.0.0 Stable (not QPR beta!)

1.0.0 Initial Release | Mirror for Download in case AFH is not working
1.1.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87743627
1.2.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87822161
1.2.1 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87878321
1.2.2 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87944505
1.2.3 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87960183
1.2.4 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88108123
1.3.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88286027
Raviantah_1.0.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88316285
Raviantah_1.0.1 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88323527
Raviantah_1.0.2 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88399915
Raviantah_1.0.4 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88497279
Raviantah_1.1.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88645103
Raviantah_1.1.2 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88719667
Raviantah_1.1.3 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88847285
Raviantah_1.1.4 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88866285




Requirements

- vbmeta flags for verity/verification disabled (this requires a wipe if you´re coming from stock with those flags enabled), check the FAQ for information on how to do this
- 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, use stable in case you want to be absolutely safe)
- IMPORTANT: Unrelated to the kernel, but update both slots of your phone to A13 before you flash anything to your device!
- it´s handy to have a backup and a way to return back to stock (check the faq for that)
- make sure to download the correct kernel version for your firmware. (you can´t flash a kernel made for stable firmware on a QPR beta or dev preview and expect there to be no isses, the release posts mention which firmware the respective kernel releases are compiled for)
- this kernel is tested on stock google firmware. If you want to use it on custom roms you´re kind of on your own as I can´t account and give support for any changes custom roms apply that could render the kernel incompatible. (e.g. if you´re custom rom is still on the previous months update, there may be issues flashing an updated kernel for the next month on top or custom roms requiring specific kernel changes to work correctly )
- it´s always best to start on stock images and don´t have another custom kernel flashed when flashing this kernel for the first time. consecutive flashes can just be installed on top, if not I´ll mention it in the release post
- read the first and second post, there's a lot of valuable information


How to flash the Kernel:
1a. Make sure you tick all the requirements above
1b. Make sure to flash the release made for your firmware! Usually the release post contains information on that

1. Download the kernel.zip (unified for both devices) and the correct powerhint module depending on your device (Pixel 7 = panther || Pixel 7 Pro = cheetah)
2. Flash the powerhint module via magisk manager as you would any other magisk module! Make sure to flash the latest one. It will be mentioned in the release post if there´s an update.
3. Flash the kernel.zip via EXKM, FKM or kernel flasher. Root will be preserved.
4. Reboot and profit.


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 pixels, avb, hashtree patcher, the counsel and the kernel flasher!
@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
 
Last edited:

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,337
22,376
F.A.Q:

Question:
How do I check the state of avb flags for verity/verification on my phone?
Answer: Check @capntrips post here and get the magisk module for this from here. After flashing the magisk module reboot your phone. You can now use the commands from @capntrips post to check.

Question: How do I update my phone to a new monthly update if this kernel is installed?
Answer: The easiest solution is to just use any full firmware package to update your phone to the new stock firmware. You can do so with the android web flash tool, a factory image or a full OTA image.

An excellent guide on how to use the factory image to do so was posted by @roirraW "edor" ehT on this thread. Feel free to use this as a reference.

I also posted what I do each month to update my phone here.

This also serves as the easiest way to return back to stock, if you don´t like the kernel and feel not comfortable flashing anything via fastboot.

Just remember to disable verity/verification vbmeta flags each time you update your phone as described in the next question below.
If you boot once, without them disabled a wipe is required to disable them again.

Question: How do I disable the vbmeta flags for verity/verification?
Answer: The easiest solution is to use the android web flash tool and tick the correct checkbox.
Alternatively extract the vbmeta.img from the matching factory image and flash it in fastboot via:
Code:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Please note that disabling those flags will require a full wipe for the device to boot if coming from flags enabled state!
And a further note: You need to repeat this command every time you flash a full firmware zip ( a factory image or a full OTA.zip) to update the firmware of your phone as those contain a vbmeta image. Otherwise the flags will be reset to default enabled and it will require another wipe to disable them again! As with the firmware.zips, you need to tick the checkbox in the webflasher every month you update your phone or flash a firmware there!

Question: How do I return back to stock?
Answer: Extract boot.img, dtbo.img, vendor_kernel_boot.img and vendor_dlkm.img from the matching factory image provided on googles download page.
Flash those images via fastboot/fastbootd and you will be back on stock kernel. If you don't know the fastboot commands to flash the images, check the instructions how to flash those images in post #4.

Alternatively dirty flash the whole firmware without wiping by using either the android web flash tool, a factory image or a full OTA image. If you disabled the vbmeta flags, don't forget to disable them again (or tick the correct options on the web flash tool) after flashing a full firmware package and re-root.

Kernel flasher has the capability to backup those partitions as well, but if your phone doesn´t boot, because you flashed a kernel for stable firmware on dev preview that backup will not help you.

Question: Does this kernel include a mod similar to the well known KCAL modification?
Answer: No it does not, as KCAL is tapping into a QCOM specific driver and that´s not included in the tensor source as it´s based on exynos.
There´s a very powerful app called CF Lumen from @Chainfire, that serves the same purpose and even includes far more options that were available from kernelspace. Link to the thread here.


Question: How to report bugs properly?
Answer: Have a look at post #3 in the linked thread. The linked guide is a pretty good starting point.
Before reporting any bug make sure you´re running on a supported firmware. Usually I'm announcing in the release post, the firmware the kernel.zip is compatible with, but most of the time the kernel is updated when a firmware update drops.
Please make also sure you're running a stock configuration.
That´s means you´re not using any mods, tweaks in kernel managers or other root tweaks , magisk modules, xposed/lsposed etc, scripts or other modifications that alter various functions like sound mods, data traffic, sleeping behaviour, scheduler, magical battery tweaks etc.
Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
Is the issue reproducible? Does it happen frequently?
Please make sure to meet the points described above, provide logs as detailed in the link above, otherwise debugging is a lot more time consuming and harder. (kernel flashing apps usually support exporting logs of flashes too) If these requirements aren´t met and I don´t find time to either reproduce the issue myself or I´m not able to reproduce the issue myself, reports might just be ignored. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.


Question: What about unlocking, rooting, passing safetynet, apps detecting root/modifications and other topics that are vaguely related, but not really subject of this thread?
Answer: If you want to modify your phone via root/magisk in any way you need to unlock the bootloader. Unlocking will result in safetynet not passing. This has nothing to do with the kernel. At the moment of writing this, safetynet not passing can be worked around with a magisk module called "Universal SafetyNet Fix".
Not passing safetynet is unrelated to the kernel since hardware attestation is enforced on nearly all newly released devices now.
If you´re not passing safetynet banking apps might for example be detecting root. There are various tricks to hide root/modifications to the phone from banking apps or others but that´s not really subject of this thread.
I recommend taking a look at this excellent collection of helpful threads from @roirraW "edor" ehT!
It can be found following this link!


Question: I get a device corrupted message after flashing the kernel or just reboot to bootloader. How to get rid of it?
Answer:
There seems to be an issue with verity on Pixel devices that can trigger randomly. That means even if the expected hashes match the device refuses to boot due to this bug.
Short answer, flash magisk patched init_boot.img via fastboot, afterwards flash stock init_boot.img. That should clear this situation.
 
Last edited:

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,337
22,376
AOSP Build Environment and Standalone Kernel builds (monolithic builds)

I´m sure some of you followed the movement towards the Generic Kernel Image (GKI) and Qcoms adaption to it called QGKI.
You can find more information about GKI following this link.
What does that mean for custom kernels and this custom kernel?
The last few years the kernel on android devices was more or less compiled as a monolith. That means the kernel is in the zImage with all (most) drivers compiled inline.
However with GKI this changed. There´s the base kernel image while vendor/device specific drivers are compiled as dynamically loadable kernel modules.
On last years devices like the Pixel 5 (using a 4.19 kernel) and this years devices with SD888 on a 5.4 kernel base, there was the possibility to change the QGKI kernel back into a monolithic kernel image. (building the drivers that are on stock kernel external modules back into the zImage to end with a monolithic kernel)
On the Pixel 6 I wasn´t able to achieve this yet. Same goes for the Pixel 7. But during my tries I also wondered if maybe finally the time has come to follow suit, instead of trying to enforce old ways, when there´s a new way going forward.
What does that mean. This means that at this point the kernel is shipped as images that are to be flashed via fastboot. At a later stage I´m sure we can modify anykernel3 to allow flashing zips again, but at this early stage fastboot flashable images will be provided.
Those images can be flashed the same way the device is rooted, therefore I think everybody should be able to flash it easily since the device can´t be rooted any other way.

The kernel was compiled using the aosp kernel build environment. Information about it can be found on the documentation page from google.

This kernel needs to be compiled in the aosp kernel build environment just like the stock kernel. All necessary and modified repos are available on my github. Otherwise please refer to the aosp build environment and the instructions there.
 
Last edited:

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,337
22,376
Fastboot commands:

This serves just as a reference to restore the images via fastboot. This is not to install the kernel.

Flash the images in this order:

Boot to bootloader:
Either select Reboot to bootloader option via magisk manager, use the button combinations or run the following command while in the OS:
or type:
Code:
adb reboot bootloader

Now in fastboot flash boot.img, dtbo.img and vendor_kernel_boot.img
Commands:
Code:
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash vendor_kernel_boot vendor_kernel_boot.img

Now boot to fastbootd
Code:
fastboot reboot fastboot

Once in fastbootd:
Code:
fastboot flash vendor_dlkm vendor_dlkm.img
4. Reboot either via buttons
or by typing
Code:
fastboot reboot
5. Profit!
 
Last edited:

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,337
22,376
Prebuilts for custom roms.
 

Attachments

  • Kirisakura_Pantah_1.2.4.zip
    688 MB · Views: 271
  • Kirisakura_Pantah_1.3.0.zip
    450.9 MB · Views: 172
  • Kirisakura_Raviantah_1.0.1.zip
    463.1 MB · Views: 62
  • Kirisakura_Raviantah_1.0.2.zip
    486.5 MB · Views: 81
  • Kirisakura_Raviantah_1.0.4.zip
    466.5 MB · Views: 76
  • Kirisakura_Raviantah_1.1.3.zip
    397.2 MB · Views: 24
Last edited:

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,337
22,376
So unfortunately we´re at the moment out of ideas and options for the vbmeta verity/verification disable requirement. @tbalden and me tried a few things and failed with our final idea this morning, which worked on a similar device.

Maybe somebody finds a way so we can actually flash custom images with the avb/vbmeta flags enabled, but at the moment not. I didn´t want to delay the release any further so here we go.

I understand this is a pain for many, but unfortunately that´s how it is now. It was a pain for me too, because on the final test, we really hoped it would work, but we we´re trapped in the wipe ourselves.


Anyway, have fun everyone with the release. It basically includes everything from the Pixel 6 kernel, as they branches are similar. :)
 
Last edited:

Ky0sHiR0

Senior Member
Aug 30, 2013
267
43
@Freak07
Thank You very much for this kernel!
May I ask if this one from CleanSlate is included? How is this works?
VoLTE call properties patched in - no root/magisk needed for non supported carriers/countries and VoLTE calls.
 

Ghisy

Senior Member
Mar 27, 2010
2,114
969
HTC Desire
Google Nexus 4
Duuuuude! This kernel sounds amazing. And the Powerhint module? WHAT?!

Probably moving to the 7 Pro this weekend so this is very welcome!

Thanks :)

Edit: I'm a little confused: should we flash the zip as usual through EXKM/Kernel flasher or use the fastboot commands from post #4??

Because the OP also mentions the usual way of flashing...
 
Last edited:

i5lee8bit

Senior Member
Duuuuude! This kernel sounds amazing. And the Powerhint module? WHAT?!

Probably moving to the 7 Pro this weekend so this is very welcome!

Thanks :)

Edit: I'm a little confused: should we flash the zip as usual through EXKM/Kernel flasher or use the fastboot commands from post #4??

Because the OP also mentions the usual way of flashing...

I think that was just a copy and paste from the older P6 thread (also now deprecated for that device, from what I understand). Just use EXKM or Kernel Flasher and you'll be good to go!

Edit: and the companion zip in Magisk Manager. Whoops. In other words, you don't need to manually flash each image to install the kernel.
 
Last edited:
  • Like
Reactions: Freak07

rav101

Senior Member
Dec 1, 2013
2,416
1,404
Walsall
Google Pixel 7 Pro
I think that was just a copy and paste from the older P6 thread (also now deprecated for that device, from what I understand). Just use EXKM or Kernel Flasher and you'll be good to go!

Nope,

The powerhint module was never actually depreciated, on P6 he was able to have it included in the kernel zip and it auto-installed into magisk at the same time.

That isn't working here at the moment so you have to manually flash it yourself again
 

Ghisy

Senior Member
Mar 27, 2010
2,114
969
HTC Desire
Google Nexus 4
I think that was just a copy and paste from the older P6 thread (also now deprecated for that device, from what I understand). Just use EXKM or Kernel Flasher and you'll be good to go!
Sorry, maybe I wasn't being clear: should I use quote #1 or #2 down there?

How to flash the Kernel:
1a. Make sure you tick all the requirements above

1. Download the kernel.zip (unified for both devices) and the correct powerhint module depending on your device (Pixel 7 = panther || Pixel 7 Pro = cheetah)
2. Flash the powerhint module via magisk manager as you would any other magisk module
3. Flash the kernel.zip via EXKM, FKM or kernel flasher. Root will be preserved.
4. Reboot and profit.

Fastboot commands:


Flash the images in this order:

Boot to bootloader:
Either select Reboot to bootloader option via magisk manager, use the button combinations or run the following command while in the OS:
or type:
Code:
adb reboot bootloader

Now in fastboot flash boot.img, dtbo.img and vendor_kernel_boot.img
Commands:
Code:
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash vendor_kernel_boot vendor_kernel_boot.img

Now boot to fastbootd
Code:
fastboot reboot fastboot

Once in fastbootd:
Code:
fastboot flash vendor_dlkm vendor_dlkm.img
4. Reboot either via buttons
or by typing
Code:
fastboot reboot
5. Profit![/SPOILER]
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Hi @Freak07, has Google posted the source code for the September kernel yet? I've been traveling in a completely different timezone so somewhat confused with Google's timing right now! 😅
    Nothing past the last u beta 5.3 on their git as of now.

    I started working on the A14 release in the meantime. :)
    I guess a few waited for those news already.

    Will be a huge release, stay tuned :)
    10
    It seems basically all of the discussion here drifts away to off-topic and nothing is related to development of the kernel which is the actual topic of this thread.

    Please try to use threads that actually cover your topic. I don't mind occasional off-topic, I'll try to explain everything to my best ability even if it's not strictly kernel related. Since I think it strays of a bit to far at the moment I feel this statement might be necessary.
    If posts begin to start with "this is not kernel related" it´s probably better to search for a thread covering this exactly topic and post there.


    It´s really frustrating to see this again and again lately.


    Ambient temperature? You don't think this is a little excessive for a phone that's sitting unused on the charger on my desk where my thermostat is set to 70° and the AC is on at 5:30 in the morning
    Just a note here. I think it´s completely unnecessary that you use my words from a previous post that has no relation whatsoever to the problem you described.
    You did say "On the charger". Always makes my phone warm when charging. What do you think will happen when tranfering energy from one source to the other? It's gonna get cold? Dude you're a contributor.
    Yeah except no other device I've ever had did this. Ever.
    In a nutshell it's a 'you' problem not a kernel issue. You need to sleuth what's leading to those temps on your particular device. Maybe reflash this, stock, or another kernel? Go look at battery use, wake locks, etc.?

    All devices heat up while charging like @Slim2none4u said. Different OEMs emply different thermal policies while charging.

    Of course ambient temperature is closely related to your device temperature. While usage, while charging, while the phone is just sitting there, since there´s no active cooling involved.

    Here are the thresholds to which your phone is allowed to go up to while charging.

    This also kind of means that if you cool the phone by having an AC with a fan next to it while charging, it will still try to reach 39°C skin temps if the charging current peak is not reached during fast charging.

    Note that those skin temps in the file I linked are NOT exactly the same as the battery temp displayed by apps. ;)
    Also note that battery temp displayed by apps is not the same across different devices, but just a virtual temp based on reading from different sensors. Each OEM decides by themselves, how this is calculated.



    Example from my end. My p7pro is currently charging on the stock google charger on my desk. It reached 94% charge and the device temp is 34°C as it usually starts to cool down once it reaches 80-90% charge as charging rate slows down there. My ambient temp is about 20°C in that room. That´s completely normal.
    Now while I typed the post it reached 96% and cooled down to 32°C battery temp displayed by app.

    The phone feels warm, just like any other phone of mine that is being fast charged or was being fast charged.. (Pixels, Asus, OnePlus, Sony.)
    While it charges it goes close to 40°C, just like intended and feels warmer to the touch.

    As to why yours seems to be hotter than mine I can´t answer.
    Could be a simple thing like google backup starting to do the daily backup on your phone while charging towards the end of that charging session, generating additional heat.
    Could be something else like @Locoman_ hinted at. Could be a faulty charger, could be a non stock charger that doesn´t work as well.


    I know you seem to be plagued on your device, but I don´t think there´s any reason to hijack my thread if there´s no relation to that custom kernel given.

    There are a few threads on this forum about this.

    Hi there i know it's not kernel related but i can't find anywhere to ask with this... Anyone tried kernel su on 7 pro ...please need assistance with it banking apps not working with magisk anymore
    Why do you post it here if it´s not kernel related?
    I thought I was the only one or maybe messed things up somehow. I'm facing the same issue as the person above. I tried August update with latest Kiri + magisk stable + Displax Universal SafeNet Fix 2.4 MOD 1.3. CTS is passing and playstore shows device is certified but GPay or or any other banking apps are not working. They show that my device is rooted. I reverted to stock kernel with the same magisk modules as before and everything works without any issues.
    Works completely fine here.
    No issues on my end, just like @TotallyAnxious.
    Basic and device integrity passing with the usual fixes, google pay works just fine.

    There are threads on XDA that cover exactly this topic.
    9
    Look, @Freak07, I never said it was your kernel but you replied to a post in this thread and I responded to that. That's not taking it off-topic. It's called a discussion and you seem to have this innate inability to accept the fact that overheating on this device is not a rare and random occurrence. It's widespread and at the same time mine was idle @ 39° (102° F), my daughter's S22Ultra, also on the charger in the same room was @27° and no, it's not an Ambient temperature when the room is @70° F.

    Sorry if you feel this is hijacking the thread but the conversation comes back to this issue time and time again.

    TBH, this has overall been a great phone, but I'm ready for Oct 4th to get here and excited to see what you accomplish on the P8P
    So why do you think there's the need for your initial reply in this thread in the first place if it's not related to the development of this kernel or to the kernel like you just said?

    How is anything of this reply now relevant to the development of this project?


    Please check the rules for posting in development.
    To quote from there:

    • Please keep all non Development relevant chatter off the DEV project topics, feel free to create a new topic in General for non Development comments about specific ROM / MOD / THEME / etc... valid replies within a DEV project are: BUG Reports, Problem, Troubleshooting Steps & Logs.

    • ... and Please! keep all your personal bickering via PMs, do not pollute the forum with your personal indifferences.
      If you have a problem with a specific member please contact the Moderators for help, that's what we're here for, but we are not babysitters, we are here to gather, organize and provide useful information for our over priced phones.




    Feel free to discuss your opinion or what you believe to be facts about this phone in general in the relevant threads, but not here. This is about development of this kernel. This is not a place for opening discussion and steering posts of other users or my reply to those posts into discussions about what you think is not a rare and random occurrence on this phone.
    Like mentioned in the thread linked above, if there´s no thread covering your topic:
    feel free to create a new topic in General for non Development comments

    I don´t have an innate inability to discuss heat related problems. I know how hot the SoC runs, I know exactly how the thermal hal works and the thresholds as well as the thresholds during charging ( I told you where to look for those). If I want to discuss those matters I do so in the relevant threads.



    Even if posts are off-topic I usually try to reach a hand and point in directions that might be worth looking into. But if the same matter with no actual relation to development in here is brought up again and again, it´s going in circles and is off-topic.

    Due to how hot the SoC actually runs I know how quickly the phone can get hot if anything is wrong. But this is not the right place to discuss those matters in detail, just like it´s not the right place to seek help or discuss safety-net not passing.

    The kernel touches a lot of areas, but at one point things are just not related to development in here.
    9
    This kernel https://forum.xda-developers.com/t/...l-for-pixel-7-pro-a-september-3-2023.4623789/ was posted recently and it claims that it doesn't need dm-verify disabled. I haven't tried it or looked at how this was accomplished or what compromises he had to make if any.

    Is this something that might make it's way into this kernel some day?
    Good question, I basically waited for it. The answer is: Yes most probably.

    All drivers are built into the zImage, which sits in the boot.img, instead of drivers being distributed across boot, vendor_kernel_boot and vendor_dlkm.img like it's now default on latest devices with gki style.
    Since boot partition is not avb checked, the kernel can be just flashed without disabling the flags.


    I did the same thing on zenfone 9.
    The difference for me is that google pushes a fully working environment that compiles the kernel the gki way (so boot, dtbo, vendor_kernel_boot and vendor_dlkm) without me doing anything, while on zenfone 9 there's no such environment to begin with.

    To compile the kernel that has all drivers built into the zImage and only boot.img needs to be changed to flash a kernel, requires quite a lot of changes on how the repo is structured.

    So in the case of zenfone 9, there's was no working build environment anyway and changing the kernel repo didn't put any additional work in the future in place that wouldn't have already been there before even starting.

    On the pixels however the already working repos need to be changed around, so the compilation works that way, putting more "maintenance" burden for me in place, since I can no longer just simply fetch and merge source updates. It will involve a bit more work than previously.

    But I guess the ease of use for the users will win here.
    I think just flashing boot.img without the need to keep the avb flags disabled every time a user updates their device is probably the way forward. (And just flashing boot.img makes debugging kernel panics if drivers sitting in vendor_dlkm are involved easier for me as well)
    7
    So...say i am updating to the latest google security drop, as we do on these pixels, and i dont disable the powerhint module, it could have adverse effects? I only ask because i never do and i have not, as of yet, had any adverse effects that i noticed and will clearly add that part to my update process.

    ✌️
    If you never want to face any issues, it´s probably best to just disable the powerhint module before flashing the update.
    If you leave it enabled simply for the sake of updating and booting into the updated OS to immediately flash the kernel it´s fine at the moment.
    If google decides to change something regarding how the powerhal checks existing nodes or functions, this might change in the future. (i.e. freezing the phone, bootlooping etc)
    However running stock kernel with the powerhint module or this kernel without the powerhal module for longer periods is not recommended as the powerhal will throw a lot of errors, negatively impacting everything as they´ll conflict.
  • 86
    Kirisakura-Kernel for the Pixel 7/Pro

    Hello everyone,

    To keep it short: Here is Kirisakura - Kernel for the Google Pixel 7 Pro aka Cheetah and the Pixel 7 aka Panther, together Pantah.
    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.
    By merging linux-stable regularly we get most security updates months ahead of the stock kernel and also before they even end up in the android security bulletin.


    The kernel includes a lot of improvements and contributions from other developers as well. Without those contributtion this kernel would not exist as it is.
    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 13 Stable
    - Linux-Stable-Upstream included to 5.10.189
    - Compiled with prebuilt Google clang 17.0.3
    - Backport entire RCU subsystem to linux 6.0
    - Lazy RCU which should result in power-savings while the device is lightly-loaded or idling, more information here
    - Backport Maple tree from Linux 6.1
    - improve preallocations from maple tree (affects especially android)
    - reduce necessity to rewalk the maple tree
    - Per VMA-locks in conjunction with Maple Tree RCU-Mode (improve app launch time, this feature in general benefits greatly from lazy rcu!)
    - further improve maple tree/per-vma locks introduced in an earlier release
    - Dynamic Energy Models depending on device state
    - make TEO-Cpuidle util-aware (improves latency, performance and decreases energy consumption for certain workloads, more information here)
    - introduce runnable boosting, wire it up with pixel_sched
    - improve CPU throttling behaviour
    - improvements to uclamp, prevent capacity inversion (reduce missed frames)
    - greatly speed up camera launch time!
    - merged kernel/common (improvements to android-common-kernel straight from google)
    - MM subsystem reworked (more info and some patchsets linked in this post)
    - Multi-gen LRU backported/reworked and enabled (more info here, here as well and here) to improve mm and reduce cpu cycles, latest V15 state
    - 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
    - restrict maximum CPU-Freqs during screen off/ idle to 1.4GHZ 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
    - merge and enable f2fs block_age-based extent cache (improve the accuracy for data temperature classification, reduce the garbage collection overhead after long-term data updates)
    - TCP backports from mainline
    - SSG IO scheduler for reduced overhead and less CPU cycles (more lightweight and android optimized)
    - scheduler backports from linux-main
    - mm updates from linux-main
    - locking updates frm linux-main
    - improve memory performance by tweaking google´s eh zram implementation
    - fix sysfs endpoint for googles eh zram
    - 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 )
    - include bbrv2 from google, more info here
    - Enable support for TTL spoofing
    - important patches from kernel/common for 5.10 (here are more details)
    - increase priority of GPU work
    - several updates from QPR beta, and a few from Pixel 6 that googles missed to include in the pixel 7 kernel
    - improve thermals
    - change compaction proactiveness based on device state for improveed memory management
    - improve ZRAM usage
    - reduce overhead

    - improve performance and efficiency by properly wiring up pixel_sched with teo util awareness (thanks @ada12 for spotting this!)
    - update to cpuset/cgroup subsystem (speeds up camera launches, device unlocks etc as cpusets are switched on those conditions, patches reduce overhead in those conditions)
    - flashing the kernel will preserve root


    CleanSlate Features
    - 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)
    - Check the CleanSlate thread for more information about those features
    - The CleanSlate thread also contains the apps that allows you to control those features!
    - If you consider those features useful, maybe consider purchasing the apps in the PlayStore or a small donation to @tbalden, he deserves it! Don´t forget to switch to beta channel for those apps, as this is needed for device running A13!


    Various Optimizations:
    - update several drivers to use power efficient workingqueues (for example wlan driver)
    - f2fs: reduce timeout for uncongestion
    - f2fs: Demote GC thread to idle scheduler class
    - f2fs: set ioprio of GC kthread to idle
    - tcp: enable advanced tcp, give user more options for tcp alorithm
    - mm: vmstat: use power efficient workingqueues
    Wakelock Blocker:
    - advanced wakelock blocker with the ability to block kernel wakelocks (dangerous, use with caution, please read this for further info). You should only block kernel wakelocks in case you face uncontrollable scenarios, like company wifi causing a wakelock to be active 100% of the time! Blocking kernel wakelocks to "improve" battery life almost always backfires and causes issues!


    Powerhint Module:
    - restrict little cluster to 1,4ghz mid cluster to 1,4ghz and big cluster to 1,4ghz during screen off, to reduce battery usage for example during music playback
    - only use little cores during screen off/device suspend
    - account for scheduler and other changes done to the kernel
    - boost memory interface controller during interaction (decreased missed frames, improved soc efficiency according to google docs)
    - 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)
    - switch between default and custom idle energy model on device is being interacted with / device idle.
    - reduce missed frames during scrolling/device interaction by adjusting uclamp boosts
    - dynamically adjust target load for memory interface during interaction.
    - remove dynamic GPU policy change as it´s causing instability and is unneeded due to GVFS period
    - implement handling during video recording of CPU like Google did on QPR A13
    - more small improvements

    DOWNLOAD:
    Downloads are attached to the release posts linked below in the changelog section.


    Please note that androidfilehost is currently not working properly.
    Link to AFH:
    Deprecated afh download, still here for old releases:


    Changelog:
    Android 13.0.0 Stable (not QPR beta!)

    1.0.0 Initial Release | Mirror for Download in case AFH is not working
    1.1.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87743627
    1.2.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87822161
    1.2.1 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87878321
    1.2.2 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87944505
    1.2.3 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-87960183
    1.2.4 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88108123
    1.3.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88286027
    Raviantah_1.0.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88316285
    Raviantah_1.0.1 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88323527
    Raviantah_1.0.2 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88399915
    Raviantah_1.0.4 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88497279
    Raviantah_1.1.0 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88645103
    Raviantah_1.1.2 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88719667
    Raviantah_1.1.3 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88847285
    Raviantah_1.1.4 https://forum.xda-developers.com/t/...-pixel-7-pro-aka-pantah.4509795/post-88866285




    Requirements

    - vbmeta flags for verity/verification disabled (this requires a wipe if you´re coming from stock with those flags enabled), check the FAQ for information on how to do this
    - 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, use stable in case you want to be absolutely safe)
    - IMPORTANT: Unrelated to the kernel, but update both slots of your phone to A13 before you flash anything to your device!
    - it´s handy to have a backup and a way to return back to stock (check the faq for that)
    - make sure to download the correct kernel version for your firmware. (you can´t flash a kernel made for stable firmware on a QPR beta or dev preview and expect there to be no isses, the release posts mention which firmware the respective kernel releases are compiled for)
    - this kernel is tested on stock google firmware. If you want to use it on custom roms you´re kind of on your own as I can´t account and give support for any changes custom roms apply that could render the kernel incompatible. (e.g. if you´re custom rom is still on the previous months update, there may be issues flashing an updated kernel for the next month on top or custom roms requiring specific kernel changes to work correctly )
    - it´s always best to start on stock images and don´t have another custom kernel flashed when flashing this kernel for the first time. consecutive flashes can just be installed on top, if not I´ll mention it in the release post
    - read the first and second post, there's a lot of valuable information


    How to flash the Kernel:
    1a. Make sure you tick all the requirements above
    1b. Make sure to flash the release made for your firmware! Usually the release post contains information on that

    1. Download the kernel.zip (unified for both devices) and the correct powerhint module depending on your device (Pixel 7 = panther || Pixel 7 Pro = cheetah)
    2. Flash the powerhint module via magisk manager as you would any other magisk module! Make sure to flash the latest one. It will be mentioned in the release post if there´s an update.
    3. Flash the kernel.zip via EXKM, FKM or kernel flasher. Root will be preserved.
    4. Reboot and profit.


    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 pixels, avb, hashtree patcher, the counsel and the kernel flasher!
    @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
    51
    Update to 1.2.4

    Hey guys and girls,

    So here´s the next release. February source did basically not contain anything new for this kernel (as all patches were already included since months due to merging linux-stable and kernel/common in advance) except a stability and a security fix for the GPU driver (which is vendor specific so of course not impacted by linux-stable etc).
    Nonetheless this is a very big release with large underlying changes.
    Short explanation follows below.

    Please note that this release is not for the QPR Beta firmware, but the stable android 13 firmware!
    Make sure to update/flash the new powerhint module attached to this post via magisk manager as it´s been updated!

    Maple Tree / Per VMA-locks via Maple Tree in RCU-Mode
    Linux 6.1 finally merged the Maple Tree patchset. I had my eyes on that patchset for quite a while now. I backported it a few months ago (back in november iirc) but at that time I still ran into a few problems with it so it never made it into a release on XDA.
    However after discovering work done on per vma-locks, which builds directly on the benefits that maple-tree provides interest was sparked again. Decided to pull it in again and fix the remaining issues.
    If you´re interested in details read the linked topics.
    Basically those patches reduce app launch time as well as lock contention. Additionally per vma-locks directly utilizes lazy-rcu, which was backported in 1.1.0. Usually I´m very hesitant when it comes to kernel changes actually translating to real world power consumption improvements, but lazy-rcu is one of the few patchsets that translate to a small improvement for everyone regardless of the usage.
    So the new per VMA-lock patchset directly benefits from the previous backport of lazy-rcu.
    App launch times in ms for cold launching slack app with and without the Per-VMA lock patchset:
    1675766626796.png


    F2FS block_age-based extent cache
    Latest f2fs-stable update contained an interesting new feature called block_age-based extent cache. It´s another optimization done in hindsight to android needs. It´s always nice to see different OEMs (in this regards xiaomi) cooperating and improving android as a whole and not just keep those patches to themselves. Since it´s pushed to f2fs-stable it will sooner or later (probably rather later as trickling through until it ends up on actual production devices always takes a lot of time) find its way to the majority of android devices.
    The features allows to record data block update frequency of the extent per inode, in order to provide better temperature hints for data block allocation thereby improving the accuracy for data temperature classification and reducing the garbage collection overhead after long-term data updates.

    Memory Interface Controller Boosting
    Boost Memory Interface Controller slightly to a fixed min_freq value during interaction, instead of relying solely on the governor taking the decision as it doesn´t ramp up fast enough during interaction in some cases.
    Research of exynos/tensor characteristic shows that the SOC does not perform optimally when cpu freqs ramp up quickly (during interaction, scrolling, touch the screen) and memory interface controller not following suite quite fast enough. This makes the soc overall perform less efficient. The boost aims to correct this behavior.
    The boost also results in a tiny few less missed frames during interaction as a bonus.


    There are other small improvements as well. Please check my github for those.

    The kernel is made for stable A13 firmware, not beta.

    I wish everyone a nice day.


    Changelog:

    - Linux-Stable bumped to 5.10.167
    - Backport Maple tree from Linux 6.1
    - Per VMA-locks in conjunction with Maple Tree RCU-Mode (this benefits greatly from lazy rcu!)
    - bump f2fs to latest f2f2 stable state
    - merge and enable f2fs block_age-based extent cache (improve the accuracy for data temperature classification, reduce the garbage collection overhead after long-term data updates)
    - improvements to the scheduler from QPR2 Beta 2 and Beta 3
    - improvements to memory management from QPR2 Beta 2
    - improve ZRAM usage
    - boost memory interface controller during interaction (decreased missed frames, improved soc efficiency according to google docs)
    - import security fixes and performance improvments to camera driver from QPR2 Beta
    - fixes/improvements to to memory management
    - security fixes/ improvements from kernel/common
    - other fixes please check github



    Download:
    Attached to release post as AFH is currently down.

    Make sure to update and keep the powerhint module installed via Magisk Manager!



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

    Make sure to meet the requirements and read the OP as well as the FAQ before flashing.

    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
    49
    Update to 1.2.1

    Hey guys and girls,


    So here´s the next release. As already hinted it includes some of the kernel changes from the QPR2 Beta. Please note the kernel is made for the stable firmware! You need to be on December stable firmware release to be able to install and run this kernel properly!
    Make sure to flash both, the kernel.zip and the powerhint magisk module as both are updated.

    Google did some significant updates in that latest qpr2 update, which is great to see.

    The GPU driver is now based on version r38p1. This fixes several vulnerabilities that made the news recently.

    AOC driver and WiFi driver were also updated and most of those improvements ended up in this kernel release as well.
    There were several improvements to memory management done by google, which should result in improved efficiency, improved reclaim and also reduced jank.
    There are a few other nice patches that should improve performance and generally improve system responsiveness. For specifics please check those on github. :)

    Scheduler patches from linux-main are also included.
    The lazy rcu patchset was updated to the latest state that was also recently merged into the linux kernel. (more info about lazy rcu check here)

    Kernel is now compiled with latest 16.0.2 prebuilt Clang from Google.


    There are other small improvements as well. Please check my github for those.


    I wish everyone a nice day.


    Changelog:

    - Linux-Stable bumped to 5.10.159
    - Bump prebuilt clang to latest 16.0.2 from Google
    - include most of the QPR2 improvements so we can enjoy them ahead of time
    - fixes/improvements to to memory management
    - import all improvments from google QPR2 to powerhint module
    - other fixes please check github



    Download:
    Attached to release post as AFH is currently down.
    I´ll push to AFH once it´s back up.


    Make sure to update the powerhint module via Magisk Manager!


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

    Make sure to meet the requirements and read the OP as well as the FAQ before flashing.

    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
    43
    Update to Raviantha 1.0.4

    Hey guys and girls,


    So here´s the next release for stable May firmware! (although technically it should still work on April as there were no changes that weren´t already present.)
    This release is not including the bigger changes I was alluding to during my last post in this thread, but it still includes some big improvements that warrant a new release. :)
    More information below.



    Important:

    Make sure to flash the powerhint module attached to this post via magisk manager if you haven´t already done so.
    Please note that this release is not for the QPR Beta firmware or dev preview, but the stable android 13 firmware!
    Please make use magisk stable if you don´t know your way around bugs and don´t want to actively help debugging magisk development.
    You should download magisk stable only from official magisk release site!
    Latest platform tools have issues flashing super.img, please use platform tools 33.0.3 when updating your firmware

    There are other small improvements as well. Please check my github for those.

    The kernel is made for stable A13 firmware, not beta.

    I wish everyone a nice day.


    Changelog:

    - Linux-Stable bumped to 5.10.179
    - bump clang to 17.0.1 stable
    - bump f2fs-stable to latest
    - loads of improvements, bugfixes etc to memory management from latest linux main
    - improvements to memory management from 6.1 kernel common
    - improvements to MGLRU (check first post for more info about MGLRU)
    - updates/improvements to RCU from latest linux main
    - updates to lazy RCU from latest linux main
    - fixed screen-off max cpufreq restriction (thanks to @elesbb for making me aware)
    - other fixes please check github



    Download:
    Attached to release post as AFH is currently down.

    Make sure to update and keep the powerhint module installed via Magisk Manager!



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

    Make sure to meet the requirements and read the OP as well as the FAQ before flashing.

    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
    41
    Update to 1.1.0

    Hey guys and girls,

    So here´s the next release. I finally feel it´s ready to be publicly released as there was not a single issue encountered over the last two weeks.
    Make sure to flash both, the kernel.zip and the powerhint magisk module!

    The kernel is now at 5.10.155 way ahead of the stock kernel. To further emphasize the importance of this. About 90% of kernel security issues are solved in linux stable.
    5.10.148 and 5.10.149 fixed the CVEs discussed here and here. Those were fixed on kernel common on November 2nd. It might take up to a few months until they trickly down into any officially shipped android kernel!
    The initial 1.0.0 release, had those CVEs fixed already as 5.10.149 was merged.
    What also needs to be kept in mind is that a big part of those security issues are resolved in linux-stable, sometimes months ago, before those patches end up in a monthly security patch. Additionally to that, the security patches on android devices are about 3 months behind the discovery of those vulnerabilities.

    This release features a few major changes, which I want to explain in greater details, so excuse the longer release post. I´d appreciate if everyone takes the time to at least read it. :)

    Introduction of Lazy RCU

    1.1.0 has the entire(!) RCU subsystem updated to latest linux 6.0 kernel state. This also allowed for Lazy RCU to be merged into the kernel, which should result in power-savings while the device is lightly-loaded or idling (which is basically the case all the time a smartphone isn´t being interacted with (nothing touching the screen and no other workload such as video editing is done).
    If you´re interested in details check the slides, which are also linked in the article I linked above.
    A very simplified explanation: RCU functionality can be called 1000s of times a second, batching RCU calls can save power by not calling as often.

    That´s one of the changes I wanted to be tested extensively, as there are a few 10000 lines of code changes.

    Please keep in mind, those are kernel changes and battery life will not be improved magically by huge amounts, due to such a change, even if the change itself is massive.
    Example: If you raise or lower the display brightness by around 10% over an entire day, you´ll see a bigger impact.
    Reading the OP gives you a good idea what this project is about! :)


    Dynamic Energy Model

    Google introduced the possibility to use different Energy Models "on the fly" a while back in the Pixel 6 and Pixel 7 kernel.
    I played around with this during the last few weeks and ironically Google did something similar in the QPR A13 Beta when I checked the firmware dump. Google switches to a different Energy Module while taking Videos. Based on my understanding to control heat better during video recordings.

    However I had another idea, but the mechanism I use to switch the profiles taps into the same system.
    While the device is idle, a different Energy Model is used, compared to when interaction is happening.
    While interaction is happening there are many boosts in play already to bias tasks to get executed as quickly as possible anyway. But switching to a different energy model allows us to basically bias tasks to get even more prominently scheduled to the little and middle cores. Since the mid cores are a78 on p7 and way more energy efficient, this should give as a double positive effect. As during idle state there are no boosts active the scheduler can now freely decide how to use EAS to the best to place the tasks as efficiently as possible.
    The energy module was tuned, so the scheduler prefers little and mid cores during idle. (nothing touching the screen, watching videos, listening to music, reading websites etc.)

    Additionally to this I decided to include the changes Google did on A13 QPR Beta while taking video to also include already in the kernel.

    Powerhal

    Switch between default and idle energy model on device is being interacted with / device idle.
    Reduce missed frames during scrolling/device interaction by adjust uclamp boosts.
    Dynamically adjust target load for memory interface during interaction.
    Remove dynamic GPU policy change as it´s causing instability and is unneeded due to GVFS period
    Implement handling during video recording of CPU like Google did on QPR A13 stable
    Raise minfreqs during screen off to 1,4ghz


    Playback over USB C to 3.5mm Dongles
    Some users were experiencing issues while using usb-c to 3.5mm dongles while running my kernel. After a long time I finally discovered how to reproduce the bug as the logs did not point towards any kernel error. It happens only if default usb configuration in developer options is set to anything else than "no data transfer". If "no data transfer" is selected there´s no issue at all.
    A few commits from linux-stable for the usb dwc3 driver breaks playback when screen is shut off or cycling through the "default usb configuration" settings, which causes the aoc driver that´s responsible for playback to shut down.
    Reverting those commits fixes the issue.

    Thanks to @WhoIsJohnGalt1979 and @Hurt Copain for nagging me about the issue and providing logs, I finally found a way to reproduce the issue so I was able to debug it.

    Given that playback is "glitchy" (a brief audio stutter) on stock kernel as well, when either cycling through different "default usb configuration" settings or turning screen on/off, that driver is generally very wonky. A user told me however that this glitch is solved in QPR Beta. So that´s good to hear if that´s the case.


    Other improvements
    Several other improvements from kernel/common (for higher branches than 5.10) and linux-main were backported to this branch so we can benefit from those improvements. For details please check my git.


    I´d like to write all of this with more detail, but at the moment I lack the time to do so.

    Kernel is compiled for stable A13, not A13 QPR Beta!


    I wish everyone a nice day.


    Changelog:

    - Linux-Stable bumped to 5.10.155
    - Backport entire RCU subsystem to linux 6.0
    - - Lazy RCU which should result in power-savings while the device is lightly-loaded or idling, more information here
    - Dynamic Energy Models depending on device state
    - Fix audio playback stopping for some users when turning screen off (thanks for @WhoIsJohnGalt1979 and @Hurt Copain for nagging me about the issue and providing logs)
    - improve CPU throttling behaviour by backporting a QPR Beta change
    - improvements to MGLRU
    - improvements from linux-mainline for several subsystems
    • scheduler
      • 02595c9fb4ec sched/core: Fix comparison in sched_group_cookie_match()
        407e4ccbb158 sched/fair: Move call to list_last_entry() in detach_tasks
        0ea56a65b686 sched/fair: Cleanup loop_max and loop_break
        0461c9736ec2 sched/fair: Make sure to try to detach at least one movable task
        f2489ca21b11 sched/fair: Cleanup for SIS_PROP
        5a3074a7ac79 sched/fair: Default to false in test_idle_cores()
        bb95868debb0 sched/fair: Remove useless check in select_idle_core()
        50112e040e6a sched/fair: Avoid double search on same cpu
        2457687f35d3 sched/fair: Remove redundant check in select_idle_smt()
    • memory management
      • 6bf69138a12b mm: rename p4d_page_vaddr to p4d_pgtable and make it return pud_t *
        9819fcefb782 mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *
        997cdba71861 mm: add vma_lookup(), update find_vma_intersection() comments
        eb1eccad20cb mm/page_alloc: fix obsolete comment in deferred_pfn_valid()
        1f30d4f3fb20 mm/page_alloc: remove obsolete gfpflags_normal_context()
        17dd220de848 mm/page_alloc: use costly_order in WARN_ON_ONCE_GFP()
        4d7be8d8d6d4 mm/page_alloc: init local variable buddy_pfn
        521b49f4067c mm/page_alloc: use helper macro SZ_1{K,M}
        9838ea6feaee mm/page_alloc: use local variable zone_idx directly
        d049e3821e8b mm/page_alloc: add missing is_migrate_isolate() check in set_page_guard()
        5dc1c3c60469 mm: remove obsolete pgdat_is_empty()
        55e89c7708e3 mm/page_alloc: fix freeing static percpu memory
        bd801ed8eace mm/page_alloc: add __init annotations to init_mem_debugging_and_hardening()
        ce00e122335e mm/page_alloc: remove obsolete comment in zone_statistics()
        cc20df37215b mm: remove obsolete macro NR_PCP_ORDER_MASK and NR_PCP_ORDER_WIDTH
        97e15d20dd79 mm/page_alloc: make zone_pcp_update() static
        f7425d856d30 mm/page_alloc: ensure kswapd doesn't accidentally go to sleep
        236a9831f7e4 mm: add merging after mremap resize
        bd1537226f30 mm: mremap: fix sign for EFAULT error return value
        4fe39974c254 mm/mremap: avoid unneeded do_munmap call
        3983a53d85a6 mm/mremap:: use vma_lookup() instead of find_vma()
        b832f38c3630 mm, hugepages: add mremap() support for hugepage backed vma
        23aa8d328a4c mm/mremap: allow arch runtime override
        b029910a3ec8 mm/mremap: use pmd/pud_poplulate to update page table entries
        53093a2f034d mm/mremap: don't enable optimized PUD move if page table levels is 2
        c7b8580c66ff mm/mremap: convert huge PUD move to separate helper
        d7e1ce9e582e mm/mremap: fix memory account on do_munmap() failure
        a2a195324435 mm/mremap: use vma_lookup() in vma_to_resize()
        7f87797e053b mm/mremap: don't account pages in vma_to_resize()
        bbebb360b5e2 mm: forbid splitting special mappings
        9fce5b920e9d mremap: check if it's possible to split original vma
        089557da4960 vm_ops: rename .split() callback to .may_split()
        c180d1867972 mremap: don't allow MREMAP_DONTUNMAP on special_mappings and aio
        e7404be1ba61 mm/mremap: for MREMAP_DONTUNMAP check security_vm_enough_memory_mm()
        5bae8c6fbfff mm/mremap: account memory on do_munmap() failure
        281904d82593 mm: refactor of vma_merge()
    • PSI
      • d95535a6cabf sched/psi: Fix periodic aggregation shut off
        73abf1a6b993 psi: dont alloc memory for psi by default
        UPSTREAM: psi: Fix psi state corruption when schedule() races with cgroup move
        df3995427bf1 sched/psi: Remove unused parameter nbytes of psi_trigger_create()
        feb99cdbd69e psi: Fix PSI_MEM_FULL state when tasks are in memstall and doing reclaim
        83fc90cd1a63 psi: Reduce calls to sched_clock() in psi
        f6af1db49cbd psi: Optimize task switch inside shared cgroups
        317f29565dd3 psi: Pressure states are unlikely
        7e17bae683a3 psi: Use ONCPU state tracking machinery to detect reclaim
        118d212fd15e psi: Add PSI_CPU_FULL state
    • more details please check github
    - patches to f2fs
    - increase priority of GPU work
    - binder fix
    - updates from kernel/common to several subsystems
    - tweak powerhal for improved performance/efficiency
    • Switch between default and idle energy model on device is being interacted with / device idle.
    • Reduce missed frames during scrolling/device interaction by adjust uclamp boosts.
    • Dynamically adjust target load for memory interface during interaction.
    • Remove dynamic GPU policy change as it´s causing instability and is unneeded due to GVFS period
    • Implement handling during video recording of CPU like Google did on QPR A13 stable
    • Raise minfreqs during screen off to 1,4ghz


    Download:
    Attached to release post as AFH is currently down.
    I´ll push to AFH once it´s back up.


    Make sure to update the powerhint module via Magisk Manager!


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

    Make sure to meet the requirements and read the OP as well as the FAQ before flashing.

    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