Development [Kernel][07.01.2023][Android 13.0.0 Stable]Kirisakura 1.2.3 for Pixel 7/Pro aka "Pantah"

Search This thread

matrixhaj

Senior Member
Mar 24, 2012
204
67
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
Why are there two powermodules included? Should we flash both powermodules zip, or only the panter one? I thought cheetah one is for non pro pixel, or not? Thanks
 
  • Haha
Reactions: Mrcactuseater

krkhaha

Senior Member
Dec 28, 2013
643
123
Kraków
OnePlus 8
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
Thank you for update. Great kernel.
 

binoysankar

Senior Member
Aug 19, 2016
343
132
Bangalore
No uninstalling old powerhint module first?
I tried uninstalling the old module first and rebooting before installing the new one, and for a bit there magisk was complaining that it had lost root.
But after reinstalling the app it was all good again.
Had no issues installing the new kernel with Kernel Flasher though.
No need of uninstalling powerhint. Flash the latest and the module will be updated to latest in this case v2
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,009
20,710
Thanks a lot.
I am trying to build pixel 7 's kernel from source code.

I downloaded the source from the git in your post:
and I run type ./build_cloudripper.sh to build, but the build process never starts, and tell me can't find ./private/ something.

I also tried download the kernel source from source.android.com
repo init -u https://android.googlesource.com/kernel/manifest -b android-gs-pantah-5.10-android13-d1 ; repo sync -j16
here, I can run ./build_cloudripper.sh and build successfully.


My question is :
1, how can I build from your source ?
or,
2, if the images I build from google's source can flash as the images your provided in your post? the size is very different.



Thanks a lot!
You need to use the aosp kernel build environment to build my kernel as well, just as described here. Replace the relevant repos in the environment with the ones you find on my github.

What is the best order to update to the new kernel / powerhint module if we are coming from kernel v1 and powerhint module v1?
Why are there two powermodules included? Should we flash both powermodules zip, or only the panter one? I thought cheetah one is for non pro pixel, or not? Thanks
Copy paste from the first post:

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 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!
- 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

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.

Hi all. How to update firmware if used this kernel ?
Thanks
Search the forum for guides or check the FAQ as the question is already answered there. :)
Flashing any full firmware will just replace all modified partitions and you´ll end up on the new firmware.
 

Texan1

Senior Member
Dec 22, 2008
930
274
Australia
Google Pixel 7 Pro
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.

Does it actually *matter* if you flash the kernel.zip first, reboot, then flash the powerhint module in Magisk?
 

utk_spartan

Senior Member
Jan 30, 2014
116
121
Indore
After upgrading to v1.1
I am noticing high delay for screen to wake up during calls.
During an ongoing call, when you remove the phone from your ear the screen takes more than 5 seconds before it accepts any input or turns on.

I am using a non pro P7
 
  • Like
Reactions: tbalden

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,009
20,710
Does it actually *matter* if you flash the kernel.zip first, reboot, then flash the powerhint module in Magisk?
no I flash the powerhint in Magisk first, them flash kernel in EXMM. You can flash the powerhint module right over the last version.
@Texan1 for this update it doesn´t matter iirc, but depending on any future changes it can make a difference. (as in crashing devices or things getting messed up on the reboot in between)
So it´s best to follow the instructions to avoid potential issues, especially if users are not certain. :)

After upgrading to v1.1
I am noticing high delay for screen to wake up during calls.
During an ongoing call, when you remove the phone from your ear the screen takes more than 5 seconds before it accepts any input or turns on.

I am using a non pro P7
Thanks for the report. Screen detection state for CleanSlate features (notification flashlight blink etc) was broken on 1.0.0 for regular P7/panther
1.1.0 includes a fix for that. If it´s the kernel, it might be related to this fix. I´ll forward it to @tbalden, but we both don´t have a regular P7.
I can't reproduce that behaviour on P7 pro.
Can you reproduce this behaviour a few times, then go to EXKM, tools, save logs. Please take both, a logcat and a dmesg and upload them, so we can check what´s happening.
 
Last edited:
  • Like
Reactions: Texan1

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,009
20,710
@Freak07 any idea why your kernel ( actually any custom kernel ) doesn't boot on custom ROM ? ( stock November based)
If verity / verification flags are disabled it should boot..
Or maybe these flags has to be disabled not only on stock but on corresponding custom ROM too..before flashing the kernel
No I don´t have any idea. It´s probably due to a difference in either ramdisk or how the images are built for the custom ROMs it doesn´t work on compared to the stock firmware.
There was a report of at least one user being able to flash on a custom ROM.

The kernel is primarily made for the stock firmware. I don´t have the time to cross-flash between different firmwares or to provide multiple versions of my kernel. If it works on custom ROMs it works, if it doesn´t work you can ask the maintainer of the ROM to look into it, but they might not support custom stuff. Which I understand as I do the same.
 
  • Like
Reactions: cultofluna

cultofluna

Senior Member
Nov 25, 2015
4,038
2,053
Google Pixel 6 Pro
Google Pixel 7
No I don´t have any idea. It´s probably due to a difference in either ramdisk or how the images are built for the custom ROMs it doesn´t work on compared to the stock firmware.
There was a report of at least one user being able to flash on a custom ROM.

The kernel is primarily made for the stock firmware. I don´t have the time to cross-flash between different firmwares or to provide multiple versions of my kernel. If it works on custom ROMs it works, if it doesn´t work you can ask the maintainer of the ROM to look into it, but they might not support custom stuff. Which I understand as I do the same.
Thanks again for the reply..
But ramdisk is not on init_boot?..
Kernel doesn't touches it anymore i thought ..
Anyway..this is too far for my knowledge.. 😂
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,009
20,710
Thanks again for the reply..
But ramdisk is not on init_boot?..
Kernel doesn't touches it anymore i thought ..
Anyway..this is too far for my knowledge.. 😂
yes, there´s a ramdisk and init_boot and in vendor_boot as well. both aren´t touched by the kernel.
But images still need to "fit" together. If custom compiled ramdisk, doesn´t work with the images generated by the kernel build environment, that´s where the issue could be.
But I´m also not familiar how exactly custom roms differ from the stock firmware in that regard. Just seems likely to me.

As flashing the kernel is at least working on one custom ROM, those other where it´s not working could look there if they´re interested.
 

tbalden

Recognized Developer
After upgrading to v1.1
I am noticing high delay for screen to wake up during calls.
During an ongoing call, when you remove the phone from your ear the screen takes more than 5 seconds before it accepts any input or turns on.

I am using a non pro P7
I'll have a look at this. Seems like I found what could cause this
 

tbalden

Recognized Developer
You mean this is an issue or bug in the kernel?

I don't have this issue. Tested this couple of times in a call. I am not seeing in delay for screen wakeup nor screen off during calls.
Wondering why its all good for me when you mentioned you found the issue.
This is only happening on p7 non pro with focaltech touchscreen most probably. I can't say I'm sure I found an issue but there's a locking mechanism in the touch driver with which my change might have interfered with.

On 7pro this isn't present.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    Update to 1.2.2

    Hey guys and girls,

    So here´s the next release. January source drop did not contain anything new for this project except a small kvm patch.

    @HipKat and a few others reported random freezes. While I haven´t faced them at all and I´m not 100% sure what´s causing them, I reverted some of the patches from QPR2 Beta, which I merged in the previous update as a precautionary measure.
    It´s very unusual for kernel issues to surface after the kernel ran fine for a few weeks and all reports coming at roughly about the same time for only very few users. So either it was something in the December update that´s triggering very rarely for some and the timing is coincidence, a server side update from google/play services update or similar or it´s caused by some of the kernel changes I pulled in from QPR2 beta in the previous update.
    I reverted those changes a few days ago as a pre-caution, and it seems QPR2 might have the same issues running stock kernel as well. Unfortunately this doesn´t rule out anything as it still could be all of the three possibilities above. Additional to that, browsing XDA or reddit and it seems freezes can happen on completely stock firmware too.

    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.161
    - improvements to MGLRU
    - bump f2fs to latest f2f2 stable state
    - improve GC from f2fs
    - fixes/improvements to to memory management
    - 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 or 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
    32
    Update to 1.2.3

    Hey guys and girls,

    So here´s the next release. Thanks for @woundman for taking the time and providing logs regarding the freeze issue.
    It seems like the updated GPU driver from QPR Beta is causing issues for some.
    This release has those changes to the GPU driver reverted and has it reset back to the stable state.

    Since it´s only been a few days that 1.2.2 with a few bigger changes was released including January changes, here a link to the changelog of 1.2.2.

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

    I wish everyone a nice day.


    Changelog:

    - Linux-Stable bumped to 5.10.162
    - reset gpu driver back to stable state



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


    Make sure to update or 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
    20
    Hi, could you please implement a JSON update method?

    As you know, FKM supports kernel download configuration (JSON schema) so user does not need to go to AFH/Github releases/etc. manually.
    I suppose publishing kernel builds to GH releases so it would be much easier to create such schema ( I bet AFH parsing is much more difficult =) ).
    Bluspark repos can be taken as reference, it worked flawlessly when I was on oneplus.

    Thanks in advance!
    No I won´t implement this.

    I want users to check this XDA thread before flashing, ideally read the release post, the faq and check maybe the last few pages of posts (when a new release drops there´s often new information). I think it´s easy enough to flash a kernel. Especially with some of the difficulties around the pixel 7 pro, vbmeta stuff, a/b stuff, different partitions it´s better to have everything covered here.
    If there´s any important information it will always be here.

    AFH is broken at the moment anyway, or at least it was last time I checked it. Attaching the downloads to the release post seems to work fine as there were no complaints.

    The first post, the faq and this thread is good enough as a central point to get the kernel and everything around the kernel.
    Maintaining those is a lot of work and I think there are not many threads that contain as much useful information.
    That´s why I don´t want to divert traffic from this thread here.
    Additionally maintaining/updating the json´s would be just another thing to maintain.

    I hope you understand. :)
    17
    Really? Wow. It's good to hear I'm not crazy. This guy on telegram is the only other instance I've ever seen anyone mention this. I was absolutely stunned to see he captured an image of it with another phone or device. No idea how he did it unless the image was from a video from a go-pro he wore on his head for hours until the issue recreated itself. Then there's the issue of the glitch occuring between frames on the recording even if you were happening to record when it happened. He's never replied to my DM or posted back in the main p7p telegram channel since asking if anyone else has had the issue, so idk what's going on for him yet or what custom software if any that he's running.

    I have posted about it on here and no one has ever noted they've experienced this. I highly suspect it's something with the software we're using since the 2nd pixel 7 pro has the same issue. My wife's doesn't according to her. The "glitch" is so fast though that, again, it's barely perceivable. It is even LESS noticable if not non-existent on smooth display (120hz).

    It *seems* like the issue occurs during typing on the Gboard more than anything. Like the constant work of animating and enlarging the keys you press on causes the GPU to glitch out. However, it *has* happened at other- seemingly entirely random- occasions.

    Has this been your experience? What software are you all running? I'm using:
    Magisk 25.2
    Lsposed 1.8.5
    Aosp mods 2.5.0
    Substratum lite
    Kiri kernel (always the latest)

    I'm using other modules, but I'd be stunned to find that any of them are causing GPU issues. One reason I suspect AOSP mods is because I have some options selected to modify the keyboard placement, and the issue seems to show itself during typing. I've not been able to collect any info via logs, but I must admit I'm not great at interpreting them anyways.

    I have always used the Kiri kernel. Due to the need to wipe the phone to install a custom kernel I have never ran thwsw phones with stock Google kernels. From day one I've used the Kiri kernel so I can not speak to whether or not the issue was or was not present without the Kiri kernel. Perhaps I'll turn smooth display off today to see if I see the issue with the 1.2.3 kernel using the stable GPU driver.
    Yea it happens to me also very often during typing on keyboard....
    Having this issue from end October..( on first qpr)..
    No matter what kernel...rooted or unrooted..
    Was fixed on November stable..and after Google has merged QPR .. appeared again ...
    Ive send two ramoops logs to a kernel developer...but unfortunately he didn't care that much...( Or he's not so good on debugging...lol)
    I'd appreciate if the discussion about this topic can be stopped at this point.
    It's not related to the kernel project here and just derails the thread even more.
    Lsposed and AOSP mods are some pretty big modifications alongside substratum.
    Feel free to open a new thread with the correct tags @Schroeder09 and see if others can contribute something helpful.

    If it happens on complete stock firmware as well, your best bet is to open an issue on the Google bugtracker and provide a bugreport there.

    Also stop talking about other developers whoever they are in my thread in that disrespectful way @cultofluna. My thread is no place for this.
    Besides that, a ramoops is not suited to debug runtime issues and it might not even be the kernel.



    To everyone else: Please try to report issus from now on as described in the FAQ with at least proper logs.

    I don't want to involve any moderators or need to start reporting posts.

    I know the thread is popular, a lot of people are running the kernel and you're likely to receive an answer here when posting (random) issues (unfortunately it seems google introduced a lot of them in the December qpr release for some users) but please follow the rules, read the FAQ, use the search function and don't create a chaos in here.
    10
    No kernel source for january out yet.

    I went ahead and flashed the current release on January firmware, it booted fine with no issues so far.
    Powerhint module also needs no update.

    Should be fine to flash. If you're not in a hurry I'll try to update the kernel tomorrow if the source is released.
  • 72
    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.162
    - Compiled with prebuilt Google clang 16.0.2
    - 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
    - improve CPU throttling behaviour
    - 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
    - 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
    - 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 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

    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
    - 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:
    Download is always located in this folder:
    Mirror for Download 1.0.0, in case AFH is not working
    Mirror for Download 1.1.0, in case AFH is not working
    Mirror for Download 1.2.0, in case AFH is not working



    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




    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!
    - 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

    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
    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
    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
    37
    I´m currently testing the next release which includes most of the improvements from the new QPR2 Beta kernel.

    That way we can enjoy those changes a bit in advance on the latest stable A13 firmware.

    Stay tuned, if everything goes well I hope I can release it sooner rather than later. :)
    37
    Update to 1.2.0

    Hey guys and girls,


    So here´s the next release. It includes the QPR (quartly platform release) changes and is now on the same state as A13 QPR Beta was previously. You need to be on December firmware release to be able to install this kernel!
    Make sure to flash both, the kernel.zip and the powerhint magisk module as both are updated.

    Amongst the QPR changes from Google, which are a big step ahead of the initial A13 release (always the case the last years, the december update fixes tons of things of the major android version bump), MGLRU was bumped to latest V15 state, which was also merged to the linux-kernel recently. Was testing this out for nearly a month, before releasing. For those interested about MGLRU, here´s an excellent writeup by @MishaalRahman.

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

    A few important improvements to binder and memory management code. One of those fixes should improve performance during memory pressure quite a bit. (e.g. when taking pictures, extremely RAM intensive tasks with GCAM)

    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.157
    - Bump prebuilt clang to latest 16.0.1 from Google
    - important improvements and fixes to binder
    - bump MGLRU to latest V15 state
    - fix to memory management
    - import all improvments from google QPR 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