FORUMS
Remove All Ads from XDA

[Kernel][31.07.2019][4.14.135] Kirisakura 2.3.0 for OP7/Pro aka Guacamole

3,995 posts
Thanks Meter: 10,452
 
By Freak07, Senior Member on 26th May 2019, 02:01 PM
Post Reply Email Thread
Kirisakura-Kernel for the One Plus 7 Pro

Hello everyone,

After rising to the most popular Kernel on Pixel 3/XL, here it is for the One Plus 7/Pro!

Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!

Being the first kernel on the Pixel 3/XL forum, which features completely merged CAF, it´s now here one the One Plus 7/Pro Forums too!
It´s the first kernel on the OP7/Pro forums to have latest CAF - Source as well as latest linux-stable upstream merged in.

The kernel is fully rebased to latest available CAF source from the Codeaurora-Forums for the 4.14 msm kernel. (except charging driver for now, don´t have the same means as One Plus for testing Battery longevity, no risks there)
The kernel is also upstreamed to latest linux stable for enhanced security and stability.
Have a read about linux-stable and why it is important here

The EAS implementation is heavily updated with changes from CAF, kernel/common and other improvements.
To have a read about our scheduler, which is called EAS, take a look here:
https://developer.arm.com/open-sourc...are-scheduling



Main Features:
- Based on latest kernel sources from One Plus for Android Pie
- Fully rebased on the latest SDX CAF-tag for the SD855
- Linux-Stable-Upstream included to latest 4.14.135
- compiled with Clang 9.0.5 and built with -O3 speed optimizations
- ZRAM patched up to latest kernel/common state and use LZ4 as default compression algorithm to improve memory managment
- Safety Net patches are included -> Kernel passes Safety Net
- Wake Gestures from @flar2 included
- Flashing the kernel will keep root!
- Kernel zip is flashable via EXKM app
- Anykernel zip is based on the all new Anykernel3 release from @osm0sis
- F2FS updated to latest F2FS stable (see post 3 on how to convert your phone to f2fs!)

EAS related features:
- EAS implementation patched up to latest CAF state
- disable autogroups and use cgroups for more efficient task placement!
- disable core_ctl for improved task placement and load balancing
- improved schedutil governor
- mimic pixels setup of the schedutil governor
- use schedtune boost from @joshuous to mimic Pixel-like EAS schedtune boosting behaviour
- setup cpusets like on pixel for more efficiency and better performance



CPU related features:
- Power saving workingqueues enabled by default (toggleable in EXKM)
have a read here: https://lwn.net/Articles/731052/
this complements EAS in general
- Change various drivers ( MM, audio) to user power efficient workingqueues. This should work well in conjunction with EAS
- Add hold functionality to schedtune CPU boost
- cpufreq/times vastly improved

File System related features:
- Set the bio REQ_NOENCRYPT flag (When lower layers such as dm-crypt observe the REQ_NOENCRYPT flag, it helps the I/O stack avoid redundant encryption, improving performance and power utilization. ) (CAF default)
- use blkio/cfq/cgroup setup from Pixel 3a devices (improves overall IO performance, under IO load) more information linked -> here in this post

Usability related features:
- High Brightness Mode for increasing backlight level related to brightness accessible via EXKM app
- Vibration Intensity adjustable via EXKM app
- DC Dimming setting now fully functional

GPU related features:
- KCAL to control the display
- KLAPSE integrated
- KCAL/KLAPSE: changes safety measures -> allow completely disabling two RGB values (this was requested to, for example, only have red values on night dimming)
- Enabled NAP power saving state of Adreno 630
- ability to use the new 675mhz GPU step officially introduced by CAF (OP7/Pro is set to only use 585mhz as max)
more information and benches in the 1.2.0 release post
- some display tweaks to save power on statically rendered images

Camera Driver:
The camera driver is updated to the latest state found on CAF for 4.14 devices with SD855.
These commits contain hundres of changes improving performance, fixing memory leaks, race conditions and general enhancements for the camera driver!

Network related features:
- Wireguard Support (Details)
- advanced TCP algorithms enabled
- includes new bbr
- TCP controller Agile-SD included. more information here and here

Memory related features:
- Memory Management patches from mainline kernel
- Speculative Page Faults (1. 2)
- Fix various memory leaks in different subsystems
- Reap memory of a task that receives sigkill
- disabled smartboost and memboost from OP
- enabled per process reclaim
- change the way ZRAM is used by quite a bit
- allow ZRAM to use higher swappiness values than 100
- you can find more information about ZRAM and the swapfile and how it is utilized differently than the stock kernel in the release post of 1.2.0
- ZRAM compression algorithm lz0-rle added -> more information linked here

Security related features:
- built with clang found on google repo

WLAN Driver
- use CAF wlan driver and compile it inline, the only way to ensure working wlan with this kernel
- the kernel cannot even force load OP prebuild WLAN module as the kernel base is way to far from stock!
- do no longer rely on the pre compiled OP wlan driver module, where OP doesn´t bother to release the source for
- completely removed qcom_rx wakelock (the amount of wakeups caused by this wakelock over a single night is more than 3 times as high as on my pixel 3 -> this improved overnight deep sleep by a considerable margin)
- removed debugging from wlan driver
- removed logging from wlan driver

Audio Driver:
- update it to latest CAF state
- use power efficient workingqueues

Magisk Companion Module
- it is necessary to ensure the device is in a fully working state without me needing to hard edit many system files!
- it is necessary so the kernel can still run enforcing selinux
- fix many selinux denials via magiskpolicy
- set kernel settings like I intend them to be, without the need to hard edit/add to many files to /system or /vendor
- you´re able to use auxiliary camera in GCAM


Misc Features:

Wakelock Blocker:
- advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
- please read this for further info

Other features:
- disable logging to make the kernel more lightweight in various places
- use VDSO_32 patchset from the pixel devices

Feature section for the "non visible" but perceptible improvements:
- updated binder section (responsible for interprocess communication)
- updated sdcardfs ; have a read about it here:


Requirements

- unlocked Bootloader
- USB-Debugging in developer options enabled
- latest adb and fastboot binaries
- working adb and fastboot environment
- magisk root


How to flash the Kernel:

1. Download the latest kernel.zip and the latest companion magisk module

1a. Optional: While it may not be necessary all times, you may want to restore stock boot.img, re-root with magisk and optionally install twrp.zip if coming from another kernel. Before reporting issues make sure you do that! Thank you!

2. Make sure to use latest Magisk stable.

3. Flash the magisk companion module in Magisk Manager.

4. Flash the kernel.zip either in TWRP or via EXKM (starting with app version 5.07)
4a. Important: Only for flashing via EXKM: If you´re coming from the stock kernel or any kernel with AVB intact, you have to flash the kernel.zip twice with a reboot in between via EXKM! If you are unsure about avb, just flash it twice and don´t ask here.

5. Reboot and profit. Now change the wake gestures in EXKM app to your personal liking! The kernel and the magisk module itself ensure you´re running the setup that´s intended. If you change settings, you will probably lose some optimizations. Don´t come back here and complain.
You can make sure everything worked by taking a look at ZRAM and SWAP in EXKM and verifying that ZRAM is smaller than 2GB and SWAP is disabled! The ZRAM size should equal 1/8th of your total RAM size

In case you want to return to another kernel flash the cleanup zip from here and restore the stock boot.img via fastboot or simply dirty flash your rom:
https://www.androidfilehost.com/?fid...31924117905130


DOWNLOAD:
Download is located always in this folder:
https://www.androidfilehost.com/?w=files&flid=294636

Important: Read after Download
Please take a look at the second post after flashing the kernel!


Changelog:
1.0.0 Initial Release
1.2.0 https://forum.xda-developers.com/sho...&postcount=133
1.3.0 https://forum.xda-developers.com/sho...&postcount=212
1.4.0 https://forum.xda-developers.com/sho...&postcount=266
1.5.0 https://forum.xda-developers.com/sho...&postcount=369
1.6.0 https://forum.xda-developers.com/sho...&postcount=533
1.7.0 https://forum.xda-developers.com/sho...&postcount=624
2.0.0 https://forum.xda-developers.com/sho...&postcount=732
2.3.0 https://forum.xda-developers.com/sho...&postcount=821


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

Credits:

@osm0sis for all his work, including the ak2 installer!
@tbalden for being the best HTC wingman!
@LeeDroid for his awesome roms!
@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
@topjohnwu for magisk!
@osm0sis for anykernel!

XDA:DevDB Information
Kirisakura-Kernel, Kernel for the OnePlus 7 Pro

Contributors
Freak07
Source Code: https://github.com/freak07/OP7PRO

Kernel Special Features:

Version Information
Status: Stable

Created 2019-05-26
Last Updated 2019-07-31
The Following 70 Users Say Thank You to Freak07 For This Useful Post: [ View ] Gift Freak07 Ad-Free
 
 
26th May 2019, 02:02 PM |#2  
Freak07's Avatar
OP Senior Member
Thanks Meter: 10,452
 
More
Question: Is root preserved when flashing this kernel?
Answer: My kernel.zip keeps a device rooted by magisk rooted.

Question: My WiFi is not working after flashing the kernel. I can´t toggle it on.
Answer: That means something happened to your device, that is causing some stuff to not get loaded properly when booting. I ran into the same issue once. Read through the thread to find the cause.
I wrote a guide in the linked thread, that explains step by step, how to return to a working condition without the need to wipe the phone completely.
Click the following link to find the post: post is linked here

Question: How to report bugs properly?
Answer: Have a look at post #3 in this thread. The linked guide is a pretty good starting point.
Before reporting any bug make sure you´re not using any mods, magisk modules, scripts or other modifications that alter various functions like sound mods etc.
Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
Is the issue reproducible? Does it happen frequently?
Provide logs, otherwise debugging is a lot harder. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.

If the device force reboots/randomly reboots (that means you see the bootloader unlocked screen!) provide a ramoops file.
Easiest way is immediately after booting up, with a root explorer navigate to sys/fs/pstore. Copy the contents to your internal storage, zip it up and send it to me.

If the issue happens while the device is running provide a dmesg plus a logcat that you take while/shortly after the issue happens. This will log what´s running in the current session. Try to be as detailed as possible what´s happening when the issue appears. It will also help me in reading the log!

To easily get a logcat in case of a crash take a look at this post:
https://forum.xda-developers.com/sho...postcount=1566
Big thanks to @jcmm11 for it

Here´s a tasker task to automatically copy /sys/fs/pstore on each boot to internal storage. Be advised these files get also created on correct reboots.
https://forum.xda-developers.com/sho...postcount=1670
thanks @jsauder2 for this little trick
The Following 12 Users Say Thank You to Freak07 For This Useful Post: [ View ] Gift Freak07 Ad-Free
26th May 2019, 02:02 PM |#3  
Freak07's Avatar
OP Senior Member
Thanks Meter: 10,452
 
More
Useful Resources

How to report bugs:

It is incredibly useful if bug reports are done in a proper way. That saves everyones time and will ultimately lead to a faster bugfix (hopefully).
The following guide from @nathanchance is a very good guideline on how to properly report a bug!

https://github.com/nathanchance/Andr..._Reporting.txt
The Following 9 Users Say Thank You to Freak07 For This Useful Post: [ View ] Gift Freak07 Ad-Free
26th May 2019, 02:03 PM |#4  
Freak07's Avatar
OP Senior Member
Thanks Meter: 10,452
 
More
How to convert your OP7 Pro to use f2fs on /data:

Do this only if you know what you´re doing. This guide works even on stock rom with stock kernel.
OP7 Pros Kernel as well as the fstab support f2fs by default.
If you´re using Kirisakura-Kernel starting with version 1.5.0 you will use the latest upstreamed f2fs implementation. Otherwise you´re running that´s a bit outdated and also a bit slower.
Google did put a lot of work in f2fs and that benefits here greatly too.

1. Backup your data and transfer it to an external storage device, because we will now erase everything on /data
2. Boot to TWRP
3. Go to Wipe - Advanced Wipe - Select "data" - Change file system - f2fs - confirm <- This will erase all userdata including your internal storage (pictures, videos, music etc)
4. Boot up and set up your device freshly.
5. Enjoy f2fs on your OP7 Pro


Androbench Results:

Stock EXT4 taken from XDA OP7 Pro Review:



F2FS on Kirisakura 1.5.0
The Following 20 Users Say Thank You to Freak07 For This Useful Post: [ View ] Gift Freak07 Ad-Free
26th May 2019, 02:10 PM |#5  
zandander's Avatar
Senior Member
Flag Hazlehurst, GA
Thanks Meter: 409
 
More
Well, I wasn't planning on unlocking the bootloader in this phone.... Going to now that you're here! Thanks for your hard work
The Following 2 Users Say Thank You to zandander For This Useful Post: [ View ] Gift zandander Ad-Free
26th May 2019, 02:32 PM |#6  
Senior Member
Flag Walsall
Thanks Meter: 1,227
 
More
Dude,

So pumped to have you on the OP7Pro! This is shaping up to be a really well supported device!

Sent from my OnePlus7Pro using XDA Labs
The Following 3 Users Say Thank You to rav101 For This Useful Post: [ View ] Gift rav101 Ad-Free
26th May 2019, 02:32 PM |#7  
Freak07's Avatar
OP Senior Member
Thanks Meter: 10,452
 
More
So hey everyone



want to lose a few more words here. I spent quite a bit of time getting this up as quickly as possible. I never had an OP device until now. So I needed to get familiar with it and get the hang of it.

I spent quite some hours and most of my free time since thursday, in the hope of getting this up before the weekend ends. Some people I spent less time with, were not quite as happy about this decision, but so be it.
I had quite a bit of experience with the CAF merge from the Pixel 3 XL, that made things a bit more easier and smooth. Upstreaming to latest linux-stable was quite a pain, because there are several commits, which cause the device to boot straight into Qualcomm Crash Dump mode.
In the end I got to 4.14.122

It´s still early here on this forums. So far now use adb sideload to install the kernel. The magisk module needs to be flashed otherwise some things, like accessing battery settings isn´t working, because of selinux-denials. If you can live without it, I´m pretty sure you can run this kernel also unrooted. But for the things I mentioned magisk is required, because you need to flash the companion module.

Once TWRP data decryption works, we can flash the zip simply in TWRP. Once EXKM and FKM are updated, we should be able to flash the zip via the apps too

For now it´s this way

I have a few more plans for this kernel, like wireguard, adding maybe some (not to much) features to it, maybe use f2fs and bringing it to latest state. I´m pretty sure I find more stuff as well.

The kernel is way more snappy than the stock kernel for me. It uses some of the EAS improvements from my Pixel 3/XL kernel, which can be utilized on this newer kernel base as well.
I confirmed it with a few little tests/benchmarks and for me the difference is night and day.
I´m running the device always full resolution and 90fps

If somebody can confirm, this it would be really great

If you encounter bugs, please take a look at post #2 and #3


there is a bit more in the kernel than the pure OP. I´ll update it the next few days


I wish everybody a nice weekend.
The Following 21 Users Say Thank You to Freak07 For This Useful Post: [ View ] Gift Freak07 Ad-Free
26th May 2019, 02:45 PM |#8  
niko2931's Avatar
Senior Member
Flag Denmark
Thanks Meter: 435
 
Donate to Me
More
Great to see you here on this device!
The Following User Says Thank You to niko2931 For This Useful Post: [ View ] Gift niko2931 Ad-Free
26th May 2019, 02:47 PM |#9  
schmeggy929's Avatar
Recognized Themer
Flag New Jersey
Thanks Meter: 1,893
 
Donate to Me
More
Welcome to the world of OnePlus! This is my second device from Oneplus and finding it an awesome device. Sad to see HTC go down the tubes.
The Following User Says Thank You to schmeggy929 For This Useful Post: [ View ] Gift schmeggy929 Ad-Free
26th May 2019, 02:51 PM |#10  
virtyx's Avatar
Senior Member
Thanks Meter: 515
 
More
great to see you here freak!
The Following User Says Thank You to virtyx For This Useful Post: [ View ] Gift virtyx Ad-Free
26th May 2019, 02:55 PM |#11  
Guitarfreak26's Avatar
Senior Member
Flag Birmingham, UK
Thanks Meter: 180
 
More
Great news. Just flashed all working well so far
The Following User Says Thank You to Guitarfreak26 For This Useful Post: [ View ] Gift Guitarfreak26 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes