• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Development [r3] arter97 kernel for OnePlus 9 series

Search This thread

thirtythr33

Senior Member
Sep 3, 2011
346
151
New York
OnePlus 6T
OnePlus 9 Pro
Have you faced any random reboots with r2?
yep, although it took a while to get one (others were getting random reboots sooner than I was) -- in short, when I open my camera, I have about a 1 in 4 chance of getting a reboot, don't know why, but that is the only time I get them. went back to stock bc having my phone reboot when trying to take a video on xmas is something I don't feel like dealing with unfortunately. thing is this kernel is awesome in every way and I wish I could continue using, but that's the deal breaker for me
 
Last edited:

samwhiteUK

Senior Member
Jul 1, 2012
139
45
Cambridge
OnePlus 9 Pro
yep, although it took a while to get one (others were getting random reboots sooner than I was) -- in short, when I open my camera, I have about a 1 in 4 chance of getting a reboot, don't know why, but that is the only time I get them. went back to stock bc having my phone reboot when trying to take a video on xmas is something I don't feel like dealing with unfortunately. thing is this kernel is awesome in every way and I wish I could continue using, but that's the deal breaker for me
It was the camera for me too. Hopefully it gets fixed!
 

eugenechiuu

Senior Member
Oct 20, 2011
252
20
Just want to double check. If I would like to update to 11.2.10.10, the safest way woud be to do a local upgrade via a full installation file, re-root via magisk and flash back arter via FKM?
 

eugenechiuu

Senior Member
Oct 20, 2011
252
20
It won't work. You have to restore backup of partitions altered by this kernel.
You can also try other methods mentioned in comments above.


Ah ok, because if I read from the first post, installing a stock ROM with a full OTA restores the said partition. So that method doesn't work anymore huh.

/* Notice */

Only OxygenOS on Android 11 is supported.

This kernel touches vendor_boot and dtbo partitions, meaning you'd need to restore said partitions whenever you're switching to another kernel or stock.
Please make a back-up of these partitions. The installer doesn’t do this automatically for you. Installing the stock ROM with a full OTA restores said partitions as well.
 

l_mike

Senior Member
Jan 6, 2013
244
136
Xiaomi Mi Pad 4
Google Pixel 4a 5G
Ah ok, because if I read from the first post, installing a stock ROM with a full OTA restores the said partition. So that method doesn't work anymore huh.

/* Notice */

Only OxygenOS on Android 11 is supported.

This kernel touches vendor_boot and dtbo partitions, meaning you'd need to restore said partitions whenever you're switching to another kernel or stock.
Please make a back-up of these partitions. The installer doesn’t do this automatically for you. Installing the stock ROM with a full OTA restores said partitions as well.
Thought so too, but it turned out differently ;)
 

thirtythr33

Senior Member
Sep 3, 2011
346
151
New York
OnePlus 6T
OnePlus 9 Pro
It won't work. You have to restore backup of partitions altered by this kernel.
You can also try other methods mentioned in comments above.
this is for anyone that was asking about the easiest way to do this process:

(if you don't have dtbo/vendor_boot/boot img's backed up): go to the telegram group for this kernel, find the user 'ileux' who posted 11.2.9.9AA img's, download all three (he posted an already magisk patched boot img), reboot to fastboot, run:
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash vendor_boot vendor_boot.img
reboot to oos
then local upgrade 11.2.10.10 (don't reboot when done)
flash twrp.zip from nebrassy's thread in magisk (if you use twrp) - don't reboot
flash magisk to inactive slot
- now reboot
profit
 

l_mike

Senior Member
Jan 6, 2013
244
136
Xiaomi Mi Pad 4
Google Pixel 4a 5G
this is for anyone that was asking about the easiest way to do this process:

(if you don't have dtbo/vendor_boot/boot img's backed up): go to the telegram group for this kernel, find the user 'ileux' who posted 11.2.9.9AA img's, download all three (he posted an already magisk patched boot img), reboot to fastboot, run:
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash vendor_boot vendor_boot.img
reboot to oos
then local upgrade 11.2.10.10 (don't reboot when done)
flash twrp.zip from nebrassy's thread in magisk (if you use twrp) - don't reboot
flash magisk to inactive slot
- now reboot
profit
I don't think that's the easiest way since you install twrp anyway.
You can install twrp, install the full OTA via twrp, than reflash Magisk and kernel via twrp. All works fine fore me.
 

thirtythr33

Senior Member
Sep 3, 2011
346
151
New York
OnePlus 6T
OnePlus 9 Pro
I don't think that's the easiest way since you install twrp anyway.
You can install twrp, install the full OTA via twrp, than reflash Magisk and kernel via twrp. All works fine fore me.
yeah I get that, but I don't use twrp to flash oos unless I absolutely have to, but that works too. with this method you take care of everything without having to reboot until it's done
 

infamousvincci

Senior Member
Apr 10, 2013
1,475
337
Carson
OnePlus 9
OnePlus 9 Pro
Reading other peoples experience with updating, now I know its not only me that got screwed.

Usually local update overwrites my kernel and root and i just flash magisk on the other side and reboot.

Ill stick with stock kernel for now
 

infamousvincci

Senior Member
Apr 10, 2013
1,475
337
Carson
OnePlus 9
OnePlus 9 Pro
What happened to yours?
Usually i download the whole update (3gb) from oxygen updater and local update using the system and then flash magisk on the other slot (for ota) and then reboots.

But with this kernel, i cant do that. Something prevented me and it keeps failing so i tried to restore my back ups dtbo, vendor, boot and it soft bricked my op9. Black screen at all. Thankfully msm tool saved me and now im just gonna run 10.10 rooted with stock kernel.
 

eugenechiuu

Senior Member
Oct 20, 2011
252
20
Usually i download the whole update (3gb) from oxygen updater and local update using the system and then flash magisk on the other slot (for ota) and then reboots.

But with this kernel, i cant do that. Something prevented me and it keeps failing so i tried to restore my back ups dtbo, vendor, boot and it soft bricked my op9. Black screen at all. Thankfully msm tool saved me and now im just gonna run 10.10 rooted with stock kernel.
Oh man sorry to hear that, I gotta do a proper backup then before attempting to restore back up and update hmm.
 

eugenechiuu

Senior Member
Oct 20, 2011
252
20
this is for anyone that was asking about the easiest way to do this process:

(if you don't have dtbo/vendor_boot/boot img's backed up): go to the telegram group for this kernel, find the user 'ileux' who posted 11.2.9.9AA img's, download all three (he posted an already magisk patched boot img), reboot to fastboot, run:
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash vendor_boot vendor_boot.img
reboot to oos
then local upgrade 11.2.10.10 (don't reboot when done)
flash twrp.zip from nebrassy's thread in magisk (if you use twrp) - don't reboot
flash magisk to inactive slot
- now reboot
profit
So I tried local upgrade straight and it failed like how everyone else mentioned.

Managed to use the backup boot/dtbo/vendor boot images from the previous Omega kernel I was using. Flashed that, booted up and local upgrade works again, followed these steps and am back to rooted stock rom again.

Will observe using stock kernel for a bit and see whether they fixed any issues from previous stock or not.
 
  • Like
Reactions: thirtythr33

Samuel Holland

Senior Member
Jun 26, 2013
530
253
lake charles
OnePlus 9 Pro
I know this may not be supported officially in regards to the few posts above, but I personally flashed the last OTA in TWRP. Not sure if I had to but then I flashed TWRP retention script(magisk), kernel, and magisk. Everything seems okay so far and was a lot easier then the usual process. 🙂👍
 

Top Liked Posts

  • 2
    After months of tests, r3 is up and it's a major release that should fixes all major bugs from previous versions and improve performance.


    It turned out that using SimpleLMK causes random soft reboots due to page allocation failures.
    This kernel reverts back to using the stock lmkd until this issue is sorted out.
    You may experience a slight decrease in how many apps you can leave in the background.

    Also, random app crashes and freezes are fixed too.
    This was specific to OxygenOS, which freezes apps with cgroup and expects the kernel to un-freeze them, but with my kernel lacking that feature from OnePlus, using my kernel led to app crashes and freezes.
    This was fixed by forcefully disabling that feature from the kernel.

    Some Bluetooth and USB stuffs were also fixed with this release.


    Bug fixes alone make this a noteworthy release, but it also comes with nice performance improvements.

    With the Qualcomm HDK, I've managed to debug why using Clang 13 leads to boot failures.
    r3 has that issue sorted out and now the kernel uses the latest Clang 13.0.2 instead of 12.

    Read-write semaphore backported from Linux v5.16 will also give some nice latency improvements under heavy I/O.
    These patches are actively being talked in the f2fs mailing list for backporting to older Android devices.

    From Sultan (kerneltoast), r3 also has SLUB per-CPU partial caches disabled for better latency.


    r3
    SimpleLMK disabled for now to fix random soft reboots
    Fixed random app crashes and freezes due to op_cgroup
    Bluetooth drivers re-worked to fix Bluetooth-related issues
    USB malfunctions fixed (dwc3)
    LA.UM.9.14.r1-18900-LAHAINA.0 merged
    LA.UM.10.9.1.r1-00800-QCS610.0 merged
    Linux v5.4.174 merged
    Wi-Fi drivers updated to 2.0.8.26T
    2022-01-05 security patch merged
    Latest WireGuard merged
    Latest f2fs from Linux v5.17 merged
    Latest LRNG v43 merged
    Read-write semaphore backported from Linux v5.16 to improve smoothness under heavy I/O
    Now built with the latest Clang 13.0.2
    Disabled SLUB per-CPU partial caches for better latency (by Sultan)
  • 2
    After months of tests, r3 is up and it's a major release that should fixes all major bugs from previous versions and improve performance.


    It turned out that using SimpleLMK causes random soft reboots due to page allocation failures.
    This kernel reverts back to using the stock lmkd until this issue is sorted out.
    You may experience a slight decrease in how many apps you can leave in the background.

    Also, random app crashes and freezes are fixed too.
    This was specific to OxygenOS, which freezes apps with cgroup and expects the kernel to un-freeze them, but with my kernel lacking that feature from OnePlus, using my kernel led to app crashes and freezes.
    This was fixed by forcefully disabling that feature from the kernel.

    Some Bluetooth and USB stuffs were also fixed with this release.


    Bug fixes alone make this a noteworthy release, but it also comes with nice performance improvements.

    With the Qualcomm HDK, I've managed to debug why using Clang 13 leads to boot failures.
    r3 has that issue sorted out and now the kernel uses the latest Clang 13.0.2 instead of 12.

    Read-write semaphore backported from Linux v5.16 will also give some nice latency improvements under heavy I/O.
    These patches are actively being talked in the f2fs mailing list for backporting to older Android devices.

    From Sultan (kerneltoast), r3 also has SLUB per-CPU partial caches disabled for better latency.


    r3
    SimpleLMK disabled for now to fix random soft reboots
    Fixed random app crashes and freezes due to op_cgroup
    Bluetooth drivers re-worked to fix Bluetooth-related issues
    USB malfunctions fixed (dwc3)
    LA.UM.9.14.r1-18900-LAHAINA.0 merged
    LA.UM.10.9.1.r1-00800-QCS610.0 merged
    Linux v5.4.174 merged
    Wi-Fi drivers updated to 2.0.8.26T
    2022-01-05 security patch merged
    Latest WireGuard merged
    Latest f2fs from Linux v5.17 merged
    Latest LRNG v43 merged
    Read-write semaphore backported from Linux v5.16 to improve smoothness under heavy I/O
    Now built with the latest Clang 13.0.2
    Disabled SLUB per-CPU partial caches for better latency (by Sultan)
  • 43
    arter97-xda.png



    arter97 kernel for OnePlus 9 series running OxygenOS

    /* Features */

    Supports OnePlus 9 series
    Fully rebased kernel without unnecessary OnePlus code
    Latest CAF msm-5.4 kernel fully merged
    Latest Linux v5.4 subversion merged
    Latest Google’s security fix merged
    BBR as the default TCP network congestion control
    Features the latest WireGuard
    Modules support disabled for lighter kernel
    Latest Wi-Fi drivers from Qualcomm with customized config
    Built with Clang 12 and ThinLTO
    Power optimizations
    Memory management optimizations
    Latest SELinux subsystem backported from mainline
    Latest f2fs backported from mainline
    Latest BFQ I/O scheduler backported from mainline
    mmap/mremap backported from mainline for a major performance boost
    Touchscreen optimizations for lower latency
    Uses LRNG for better performance

    /* Details */

    - Fully rebased kernel without unnecessary OnePlus code -



    This kernel is not based on the stock OxygenOS kernel source provided by OnePlus. Instead, it’s based on the latest and greatest Qualcomm has to offer. Only the necessary parts from the OnePlus kernel have been cherry-picked, such as OnePlus 9 specific device drivers.

    This effectively kills all kernel modifications/optimizations from OnePlus, including the infamous app throttler.
    Due to the completely different base, this kernel will behave drastically different from other kernels, in both good and bad ways.


    - Power optimizations -


    This kernel makes some conscious decisions for reducing power consumption.

    First, the stock OnePlus configuration forces display-related processes to use the big cores exclusively.
    This configuration brings a huge power regression since it makes every frame dispatch to wake up and use the power-hungry cores.

    This kernel resets this profile to use the configuration Google recommends, which is to use the LITTLE cores exclusively instead. (Reverted in r2 as it seems like that little cores aren't enough to drive 120 Hz fluidly.)
    This kernel allows these processes to use little and middle cores (0-6), depending on the load.

    Second, this kernel disables wakelocks upon Wi-Fi’s RX unicast packet transmissions. qcom_rx_wakelock is one of the major culprits to increased idle power consumption. Although its total wakelock time is quite low, it's catched very frequently and prevents the system from entering suspend repeatedly.

    As dropping unicast or local ARP packets doesn’t pose practical issues on Android, this kernel disables qcom_rx_wakelock.

    Third, this kernel reduces the duration of the Bluetooth ISR wakelock from 2 seconds to 100ms. This was done from an observation that the average userspace response time from ISR is less than 10ms.
    My kernels have been doing this for years and no Bluetooth-related issues were reported.

    Fourth, the vibrator driver used in this kernel no longer controls the cpuidle driver. The stock kernel disables the cpuidle whenever the vibrator is used. This kernel disables it as the vibrator is not that sensitive to deadline misses.

    There are other small improvements throughout the kernel tree as well.


    - Memory management optimizations -


    This kernel disables LMKD and uses an in-kernel solution called SimpleLMK, made by kerneltoast. You can track how often SimpleLMK kicks in by monitoring:
    Code:
    /sys/module/lowmemorykiller/parameters/lmk_count

    This kernel also changes a lot related to swap and zram.

    The swap-related code has been backported from Linux v5.9 (link1, link2) to efficiently support fast swap device and allow swappiness over 100. This kernel currently sets swappiness to 160 on < 6GB of RAM, 120 on 8GB and 90 on 12GB.

    zram has been also backported from mainline Linux and further tweaked to use block device writeback. This is equivalent to the recent “RAM Plus” feature that companies have been marketing that uses the internal storage to extend RAM.

    This kernel uses zram writeback to offload idle pages (i.e., really, really unused RAM) to the internal storage. As it's extremely slow to bring pages back from UFS, writeback code works quite conservatively. It'll start to writeback pages that haven't been used for a day or two. It makes use of the hidden 2GB “last_parti” partition from the UFS storage.

    Along with zram writeback, this kernel also enables deduplication with xxHash. Each page stored in zram is checked for deduplication to further save memory. With these 2 features combined, RAM reaching 1GB is additionally saved, but your mileage may vary.

    The post boot script used in the stock ROM is also overridden and it sets the readahead to 128KB. As I/O workload under Android is mostly random, high readahead doesn’t help and only increases memory thrashing.

    This kernel also incorporates a lot of patches to reduce/optimize memory allocations used throughout the entire kernel.

    mmap/mremap code was also backported from Linux v5.10 to optimize ART (see here for more info).


    - Latest subsystems -


    This kernel backports the SELinux subsystem from mainline Linux. This includes caching improvements that drastically reduces time spent on lookups. 10K lines of code has been changed.

    This kernel also backports f2fs (Flash-Friendly File System) from mainline Linux. This includes bug fixes and performance improvements such as shorter discard latency, more optimized GC logic for Android, and checkpoint merging.

    BFQ I/O scheduler has also been backported from mainline Linux for better I/O performance.


    - LRNG -


    This kernel ditches the traditional RNG driver from the Linux kernel in favor of LRNG. See here and here for more info.

    A rudimentary throughput benchmark shows an improvement of 10.5% (keep in mind that this is only one aspect of an RNG metric).


    /* Notice */

    Only OxygenOS on Android 11 is supported.

    This kernel touches vendor_boot and dtbo partitions, meaning you'd need to restore said partitions whenever you're switching to another kernel or stock.
    Please make a back-up of these partitions. The installer doesn’t do this automatically for you. Installing the stock ROM with a full OTA restores said partitions as well.

    /* Disclaimer */

    Your warranty is now void.
    I am not responsible for bricked devices, dead SD cards,
    thermonuclear war, or you getting fired because the alarm app failed. Please
    do some research if you have any concerns about features included in this kernel
    before flashing it! YOU are choosing to make these modifications, and if
    you point the finger at me for messing up your device, I will laugh at you. Hard. A lot.

    /* Thanks to */

    Vishalcj17
    kristofpetho
    kdrag0n
    kerneltoast (SultanXDA)

    /* Instructions */

    1. Read the above. Please.
    2. Flash the zip file from FK Kernel Manager. Any other installation methods are untested.

    /* Downloads and links */

    arter97.com
    Kernel source
    Telegram chat link
    18
    r2 is up, and it's a big release.

    Changelog is quite self-explanatory.

    r2
    Display-related processes are now allowed to use the middle cores as well for better smoothness
    Enabled more mremap() performance improvement that was missing from r1
    LA.UM.9.14.r1-18400-LAHAINA.0 merged
    LA.UM.9.16.r1-08100-MANNAR.0 merged
    LA.UM.10.9.1.r1-00300-QCS610.0 merged (contains a lot of new improvements including power optimizations)
    Linux v5.4.159 merged
    Wi-Fi drivers updated to 2.0.8.25M
    2021-11-06 security patch merged
    Watermark boosting disabled to fix aggressive app killings (by Sultan)
    Workaround added to fix unwanted doubles presses from the power button
    15
    After using the kernel myself and daily driving for few days and monitoring how the kernel behaves, I now feel comfortable to mark it stable.

    r1 is released.

    The original post is re-written to feature what's special with this kernel.
    Please take your time and re-read the original post.
    10
    /* Changelog */

    r3

    SimpleLMK disabled for now to fix random soft reboots
    Fixed random app crashes and freezes due to op_cgroup
    Bluetooth drivers re-worked to fix Bluetooth-related issues
    USB malfunctions fixed (dwc3)
    LA.UM.9.14.r1-18900-LAHAINA.0 merged
    LA.UM.10.9.1.r1-00800-QCS610.0 merged
    Linux v5.4.174 merged
    Wi-Fi drivers updated to 2.0.8.26T
    2022-01-05 security patch merged
    Latest WireGuard merged
    Latest f2fs from Linux v5.17 merged
    Latest LRNG v43 merged
    Read-write semaphore backported from Linux v5.16 to improve smoothness under heavy I/O
    Now built with the latest Clang 13.0.2
    Disabled SLUB per-CPU partial caches for better latency (by Sultan)

    r2
    Display-related processes are now allowed to use the middle cores as well for better smoothness
    Enabled more mremap() performance improvement that was missing from r1
    LA.UM.9.14.r1-18400-LAHAINA.0 merged
    LA.UM.9.16.r1-08100-MANNAR.0 merged
    LA.UM.10.9.1.r1-00300-QCS610.0 merged (contains a lot of new improvements including power optimizations)
    Linux v5.4.159 merged
    Wi-Fi drivers updated to 2.0.8.25M
    2021-11-06 security patch merged
    Watermark boosting disabled to fix aggressive app killings (by Sultan)
    Workaround added to fix unwanted doubles presses from the power button

    r1
    First stable release
    9
    Another new alpha build is up with big changes yet again.
    I still have quite a few TODOs left, but I ported many changes from my OnePlus 7 Pro kernel.

    Wi-Fi will behave differently with this kernel, so please let me know if you encounter Wi-Fi issues.

    r1a7

    Wi-Fi configuration merged with the latest CAF
    Wi-Fi's rx_wakelock disabled and removed
    Support for WireGuard added
    Bunch of memory optimizations
    Bunch of optimizations for screen and the GPU driver