[KERNEL][20 Jan] ə aka schwa [Android 12]

Search This thread

FraSharp

Senior Member
schwa.jpeg

(for anyone wondering, yes i took a completly random photo lmao)​


How often will you update this kernel?
I won't release updates often, but i will still update source and
you are free to compile it yourself.

/*

* .NOTE:
* .If you plan to do so, don't contact me for help ;)
*/


Is my ROM/device supported?
As long as it is OnePlus 8T or OnePlus 9R, and as long as your rom is based
on Android 12, then yes, it is supported.

/*

* .NOTE:
* .OnePlus 9R has not been tested, so I do not guarantee its full support.
* .The same thing goes for Android 11 ROMs (including AOSP one(s))
* .as i did test only on Android 12 AOSP ROM.
*/


Which toolchain did you use?
• Compiled with latest cutting-edge LLVM-Tools-14 (https://llvm.org/docs/ReleaseNotes.html), with LLVM_IAS (integrated assembler), with Clang compiler (refer to https://clang.llvm.org/) and with LD.LLD linker (LLVM linker, refer to https://lld.llvm.org/) to have increased performances and smaller zImage (aka kernel Image) size (which is around ~50MB, compared to the over ~100MB Image of other kernels.).

Toolchain link: https://github.com/ClangBuiltLinux/tc-build



Features
• Compiled with Full LTO (Link Time Optimization, https://llvm.org/docs/LinkTimeOptimization.html), which makes kernel Image bigger than with ThinLTO but also increase performances by a lot (https://docs.google.com/spreadsheets/u/0/d/1mhjyshujZz8jYI7dMoCe-yFbxymW-fWaC08vMhBbEmQ/htmlview).

• Compiled with CFI Clang (https://clang.llvm.org/docs/ControlFlowIntegrity.html) and with Shadow Call Stack (SCS, https://clang.llvm.org/docs/ShadowCallStack.html) to improve security by a lot, but with a little less performance and a little more overhead (around ~1% of overhead, https://source.android.com/devices/tech/debug/shadow-call-stack).

• Disabled STune (SchedTune) in favor or UClamp (UtilClamp) to achieve less jank (jitter) and less fps drops (refer to https://www.linuxplumbersconf.org/e...hments/328/552/UtilClamp_usage_on_Android.pdf).

• Disabled WALT in favor of PELT, even if benchmarks clearly say that WALT is better, i did not see any lag or latency issue (refer to https://www.slideshare.net/linaroorg/walt-vs-pelt-redux-sfo17307.

• Upstreamed F2FS (/data filesystem) to latest (5.16) available mainline port for linux 4.19 (https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git/tag/?h=5.16-rc1-4.19).

• Upstreamed EXT4 (/system, /vendor, /odm, /product filesystem) to latest commits found in linux mainline.

• Use EAS (Energy Aware Scheduler) along with Schedutil governor to improve battery backup and keep high performances.

• Improved cfq I/O scheduler to reduce jitter by a lot.

• Disabled some debugging and tracing features such as Coresight (https://developer.arm.com/ip-products/system-ip/coresight-debug-and-trace).

• Disabled most debugging functions treewide to achieve less overhead and a smoother experience (as debug prints logs in dmesg, there may ve high I/O Disk usage, leading to a notable performance lose): Android binder, mm, drivers, ion, techpack drivers...

• Built qcacld-3.0 (network driver) and most techpack drivers as user and disable useless debug.

• Compiled with LLVM-Polly up-to-date flags to tweak LLVM-Tools and so to get smaller Image and better performances (refer to https://polly.llvm.org/ and to https://polly.llvm.org/performance.html).

• Tweaked UDFPS (Under Display FingerPrint Scanner, aka FOD, Fingerprint On Display) to faster unlock experience (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/6fbf5a20fc78f954818649eb9048a63077bc0f0f).

• Disabled many unused configs to reduce kernel Image.

• Compiled some kernel parts with -Ofast to increase performance on critical points, such as fingerprint and display (https://www.phoronix.com/scan.php?page=article&item=gcc_47_optimizations&num=2).

• Upstreamed kernel to latest ACK (Android Common Kernel, https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline) tag and to latest CAF (Code Aurora Forum, https://source.codeaurora.org/quic/la/kernel/msm-4.19) tag to address latest CVE and to improve kernel treewide.

• Built vdso32 to get better battery backup and better performances according to Google (refer to https://source.android.com/devices/architecture/kernel/config#vdso32-on-arm64)

• Fixed PD (Power Delivery) charging, you can now charge phone with your laptop now at a reasonably good speed (~1400 mAh, tested with OnePlus warp cable and MacBook Air).

• Disabled pstore (logging and debugging feature) as it doesn't work.

• WireGuard VPN tunnel support and upstreamed to latest commits from mainline (https://www.wireguard.com/).

• Upstreamed ZSTD and LZ4 compression algorithms to latest commits from mainline.

• Tweak scheduler to achieve less overhead and better latency (lower).

• Added USB-2.0 fast charge upto ~900mAh (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/1669d653a321f8a491df02b42f5a472fa177db9e).

• Added better number generator, LRNG (Linux Random Number Generator) (https://www.chronox.de/lrng/doc/lrng.pdf).



Very cool, you put some random features, but how to install this?
First of all, make a backup!!! I don't want to be blamed if you lose your data.

1. Download kernel zip from the link in thread.
2. Now you have 2 ways to flash this:
.A) Use Franco Kernel Manager (https://play.google.com/store/apps/details?id=com.franco.kernel&hl=it&gl=US)
.Go to flasher and then press on "Manual Flasher" button, select kernel zip and press "flash and reboot".
.B) Use adb sideload from recovery: Press on apply update, adb sideload, and then execute this command within pc's terminal:
adb sideload <drag n drop kernel zip here>

.If you get "Signature verification failed", change recovery.


3. Flash dtbo with
fastboot flash dtbo dtbo.img


/*
* .NOTE:
* .This is an AnyKernel3 zip, so you won't need to
* .flash Magisk again if you have it installed.
*/


Source moment
Kernel source ("main" branch): https://github.com/FraSharp/kernel_oneplus_sm8250


Credits
@osm0sis - AnyKernel3 (https://github.com/osm0sis/AnyKernel3).
@franciscofranco - FKM (https://play.google.com/store/apps/details?id=com.franco.kernel&hl=it&gl=US).
@YumeMichi - Base kernel source (https://github.com/YumeMichi/kernel_oneplus_sm8250).
@Bicet - For providing me ROMs to test kernel on and to assist me for everything.
LLVM - LLVM Tools and Clang.
OnePlus - Stock kernel source code (https://github.com/OnePlusOSS/android_kernel_oneplus_sm8250/).
GitHub - For hosting kernel source.
@ Any other person who i picked commits from without them knowing xD.



Where to contact you?
I hope you won't need to contact me, but if you need,
you can do it by sending a message to @airfraa on Telegram.
and no i don't have a support group.


Donations?
Well, no. No donations to me. But if you feel the urge to donate to someone
you can donate to the Human Rights Campaign @ https://www.hrc.org/



And finally, download link
You can download kernel zip in GitHub releases at this link:
Kernel direct link -> https://github.com/FraSharp/kernel_oneplus_sm8250/releases/tag/schwa-gm

Releases link -> https://github.com/FraSharp/kernel_oneplus_sm8250/releases
Dtbo direct link -> https://github.com/FraSharp/kernel_oneplus_sm8250/releases/download/schwa-rc4/dtbo.img

CHANGELOG IS ALWAYS ON THE 2ND POST

Support group: https://t.me/schwakernel
 
Last edited:

FraSharp

Senior Member
Changelog as of 27/01/2022:

* Upstreamed to latest linux-4.19.y (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/0ba5a5c8e0755cbfa2ddc5fdb28def6ec8703fcb).

* Upstream rwsem/locking/irq/rcu to reduce latency (jitter) (https://github.com/FraSharp/kernel_...578a8ce4749cd81b7dbd+505&branch=golden-master and after until https://github.com/FraSharp/kernel_...578a8ce4749cd81b7dbd+435&branch=golden-master).

* Remove more logging (https://github.com/FraSharp/kernel_...578a8ce4749cd81b7dbd+436&branch=golden-master).

* Upstream lzo (https://github.com/FraSharp/kernel_...578a8ce4749cd81b7dbd+436&branch=golden-master).

* Set filesystem to noatime by default, https://opensource.com/article/20/6/linux-noatime (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/7893d9ad850529ce59bf0b35b5ee2667d61fee60).

* Fix an issue that made google photos to lag while reproducing videos (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/8c160c0aab46ba8cec3cf5d3e25f6d1d0d92c9b3).

* Fix PD charging and WARP/DASH charging (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/e3172a61a8e0ca8c2a62fe0ac1ea5c31dc6148ca).

* Optimize memmove (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/26faff502d719085a869ad200f587d08b63091d6), memcpy (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/8141be99eb05435540926afbb6616fbf4c2e609a) and memset (https://github.com/FraSharp/kernel_oneplus_sm8250/commit/346a0a920da8878a638c56f38a2c4619d217779e).

* Revert https://github.com/FraSharp/kernel_oneplus_sm8250/commit/eb20099c21879fe0e208ab621fa6414f612f5211 as it was a regression for latency.

* Upstream crypto, network, sysfs-net and sysfs to 5.5-rc1.

Download: https://github.com/FraSharp/kernel_oneplus_sm8250/releases/tag/schwa-gm
 
Last edited:

Bumbae

Member
May 12, 2016
30
10
I really want to try this on Havoc but Havoc is still on android 11. I'm a bit scared, i might break my 8T
 

FraSharp

Senior Member
I really want to try this on Havoc but Havoc is still on android 11. I'm a bit scared, i might break my 8T
it should boot, at most you will have some casual bugs (most likely non working wifi, but it's very unusual to happen), anyway it won't damage for phone. in the worst case it won't boot and all you have to do is reboot to recovery and flash a working kernel
 
  • Like
Reactions: YousifG7

Bumbae

Member
May 12, 2016
30
10
Ohhh i see thank you so much! I'll update if it works on Havoc Os
it should boot, at most you will have some casual bugs (most likely non working wifi, but it's very unusual to happen), anyway it won't damage for phone. in the worst case it won't boot and all you have to do is reboot to recovery and flash a working kernel
 

Immortalis

Senior Member
May 31, 2012
1,461
456
Warsaw
It booted on HavocOS 4.12, no problems found on a quick glance, however on a startup "there was an internal problem" notification popped up.
OP - you might want to include dtbo.img in kernel zip, as AnyKernel3 handles flashing dtbo too (it worked when I copied it), no problem with flashing using OrangeFox Recovery.
 

FraSharp

Senior Member
It booted on HavocOS 4.12, no problems found on a quick glance, however on a startup "there was an internal problem" notification popped up.
OP - you might want to include dtbo.img in kernel zip, as AnyKernel3 handles flashing dtbo too (it worked when I copied it), no problem with flashing using OrangeFox Recovery.
good about the no issues on android 11, the internal problem popup is there and we can do nothing about it 😭 , i didn't know that AnyKernel3 handled dtbo, so thank you for letting me know that, bye.
 
  • Like
Reactions: YousifG7

FraSharp

Senior Member
Ohhh i see thank you so much! I'll update if it works on Havoc Os
@Immortalis tried on HavocOS 4.12, as you can see from this post:
It booted on HavocOS 4.12, no problems found on a quick glance, however on a startup "there was an internal problem" notification popped up.
OP - you might want to include dtbo.img in kernel zip, as AnyKernel3 handles flashing dtbo too (it worked when I copied it), no problem with flashing using OrangeFox Recovery.
 
  • Like
Reactions: Bumbae and YousifG7

Bumbae

Member
May 12, 2016
30
10
Hello OP, I'm going to try this on Havoc OS 4.12 (Android 11). If i'm going to flash using EX kernel manager or FKM. Do i still need to flash dtbo?
 

Top Liked Posts