[Samsung Galaxy Note 9 (Exynos) ROMs, Kernels, Reco] azZA_09:
Hello, XDA! Me and @Da-BOSS would like to publish the Ultimate Kernel - Zeus :victory: .

Without too much hassle, let's see what this Kernel brings to our beloved Note 9.​

​

Behold the wall of features

Android Q kernel is based from Google sources Android-Q branch with applied on top of it Samsung's kernel sources.

Since there is no more ELS repository for Android Q kernels.. I made a branch on the same repository on Github called [ZeusELS] which is purely a completely stock kernel with linux upstreamed always to the latest :angel: that's if anyone wanted to develop a new kernel from scratch ;) also.. ZeusELS is based from Google sources Android-Q branch with applied on top of it Samsung's kernel sources too ! :fingers-crossed:

Download links are always at the end of this post

ZeusROM Features for Android Q

[*] It is just simply a replicate of DevBaseROM from @_alexndr but with more debloats and Zeus Kernel ready inside... just flash it and it is ready ;)

Kernel Features for Android Q

Imported N960FXXS4DTA5 kernel sources

Used updated ramdisk N960FXXS4DTA5

The kernel is now compiled with

GCC 10.0.1

along with LTO [

L

ink

T

ime

O

ptimization] using the latest updates available for [isl,mpc,mpfr,zlib,etc..] GCC is self compiled with all kind of flags optimizations applied for maximum performance benefits and increase code quality

Using GCC LTO with all fixes and optimizations which leads to faster kernel operations and less kernel code bloating which will lead to less kernel size in which allows me to make room and use O3 kernel optimizations which will increase kernel size a little bit for results in significantly improved hackbench performance, which is a sign that overall performance in the kernel is improved. It works especially well in conjunction with LTO.

Implemented/Using

[W.B.T.]

W

rite

B

ack

T

hrottling driver which increases IO performance and smoothness of the kernel operating generally.. what it does is...

[Enable throttling of buffered writeback to make it a lot

more smooth, and has way less impact on other system activity.

Background writeback should be, by definition, background

activity. The fact that we flush huge bundles of it at the time

means that it potentially has heavy impacts on foreground workloads,

which isn't ideal. We can't easily limit the sizes of writes that

we do, since that would impact file system layout in the presence

of delayed allocation. So just throttle back buffered writeback,

unless someone is waiting for it.]

Implemented hybrid poll mode With this hybrid scheme, we can achieve big latency reductions while still using the same (or less) amount of CPU.

Implemented various patches from 4.10/4.14/4.19 imported

Simple LMK! first in the history of Samsung smartphones with all updates and patches applied

Undervolted everything on the SOC from RAM,CPU,Camera,CPU Bus,etc..

Reduced SELinux expensive calls for audit and disabled entirely

Updated SchedUtil to the latest patches & updates

Updated SchedUtilX to the latest patches & updates

Implemented IOwait and Use it + Make IOwait boost more energy efficient

Re-adjusted Samsung values on nearly everything volts,battery,ram,etc..

Using the S10/N10 Values to our beloved Note9 for Exynos hotplugging drivers

Using CPU Assist driver and updated its values

Disabled all kind of Debuggings, loggings, tracings aggressively

kernel size is under

30MB!

Boost DevFreq whenever a new frame kicks

Added PowerSuspend Driver which will help on battery saving extensively and integrated it to display driver

Using HTC's Fsync named

[Asynchronous Fsync]

and made it working as default for Note 9

Implemented Sched Yields to force sleep whenever it kicks in

Moved MMC driver to SCHED_FIFO thread to reduce the impact of

load on IO performance.

Applied O3 compiling flags to Crypto drivers for increase performance

Tuned Up ALMK [Adaptive LowMemoryKiller] values and use it by default

Adapted and Implemented

Force Reclaim

driver from

Lenovo

and use it by default

Killed Samsung's poor RBIN memory management

Implemented

CMA

from Qualcomms devices and Use it as a replacment of Samsung's RBIN here what does it do..

[CMA pages are designed to be used as fallback for movable allocations

and cannot be used for non-movable allocations. If CMA pages are

utilized poorly, non-movable allocations may end up getting starved if

all regular movable pages are allocated and the only pages left are

CMA. Always using CMA pages first creates unacceptable performance

problems. As a midway alternative, use CMA pages for certain

userspace allocations. The userspace pages can be migrated or dropped

quickly which giving decent utilization.]

Introduce and Implement and Use

GCMA [Guaranteed Contiguous Memory Allocator]

read below what it does..

[While demand for physically contiguous memory allocation is still alive, especially in embedded system, existing solutions are insufficient. The most adapted solution is reservation technique. Though it serves allocation well, it could severely degrade memory utilization. There are hardware solutions like Scatter/Gather DMA and IOMMU. However,

cost of these additional hardware is too excessive for low-end devices. CMA is a software solution of Linux that aims to

solve not only allocation but also memory utilization problem. However, in real environment, CMA could incur unpredictably slow latency and could often fail to allocate contiguous memory due to its complex design. We introduce a new solution for the above problem, GCMA (Guaranteed Contiguous Memory Allocator). It guarantees not only memory space efficiency but also fast latency and success by using reservation technique and letting only immediately discardable to use the area efficiently. It shows 15 to 130 times faster and more predictable allocation latency without system performance degradation compared to CMA.]

Implement binderfs for Andorid IPC

Wakelock Blocker is used by default and it already blocks the needed wakelocks by default

Added DropCache feature which will help with memory management on the long run

Tuned Adaptive LMK to work

Asynchronously

Implemented

ZRAM Deduplication feature

which will..save amount of memory usage by zram. Read below the benefits...

[Android is one of the biggest users to use zram as swap and it's

really important to save amount of memory usage. There is a paper

that reports that duplication ratio of Android's memory content is

rather high. And, there is a similar work on zswap that also

reports that experiments has shown that around 10-15% of pages

stored in zswp are duplicates and deduplicate them provides some

benefits.]

Implemented

ZSWAP same-filled pages handling feature

look below what does it do..

[Zswap is a cache which compresses the pages that are being swapped out

and stores them into a dynamically allocated RAM-based memory pool. This patch adds a check to identify

same-filled page before compression of the page. If the page is a

same-filled page, set zswap_entry.length to zero, save the same-filled

value and skip the compression of the page and alloction of memory in

zpool. Improvemnt in preformance varies between 19% ~ 32% increased performance in store time & 49% ~ 85% increased performance in loading time]

Implement B-tree function and Made ZSWAP to Use it by default which will lead to the following IO bogo operations: * original: 73778.8 * btree: 393999

WireGuad using the latest version always

Added MoroSound!

Brought a collection of Paranoid Android & Xiaomi patches to our beloved Note9 devices

Tuned UFS net boost table

Speed up scatterlist to roughly a 2x performance gain & Speed up cache entry creation for mbcache2

Implemented some fucntions & drivers from 4.14 Kernel and use it on Note 9 [which have 4.9 Kernel]

Using

Jump Lable

on the kernel read below what does it do..

[This option enables a transparent branch optimization that makes certain almost-always-true or almost-always-false branch conditions even cheaper to execute within the kernel.

Certain performance-sensitive kernel code, such as trace points, scheduler functionality, networking code and KVM have such branches and include support for this optimization technique.

If it is detected that the compiler has support for "asm goto", the kernel will compile such branches with just a nop instruction. When the condition flag is toggled to true, the nop will be converted to a jump instruction to execute the conditional block of instructions.

This technique lowers overhead and stress on the branch prediction of the processor and generally makes the kernel faster.]

Using

Jump Lable Relative References

on the kernel read below what does it do..

[Reduce the size taken up by absolute references in jump label

entries themselves and the associated relocation records in the

.init segment, add support for emitting them as relative references

instead.This reduces the size of the __jump_table by 33%, and

gets rid of the RELA section entirely.]

Improve ION cache accounting

Added Fingerprint Boost Driver

Low Memroy Killer features... LMK Fast RUN, OOM Reaper, Process reclaim

Updated ZRAM & ZSWAP with LZ4,ZSTD,LZO compression algorithm

Implemented Devfreq Boost driver and updated it... look below what it does

"This driver boosts enumerated devfreq devices upon input, and allows for

boosting specific devfreq devices on other custom events. The boost

frequencies for this driver should be set so that frame drops are

near-zero at the boosted frequencies and power consumption is minimized

at said frequencies. The goal of this driver is to provide an interface

to achieve optimal device performance by requesting boosts on key

events, such as when a frame is ready to rendered to the display."

Introduced a centralized Energy Model (EM) management framework which aggregates the power values provided by drivers into a table for each performance domain in the system.

Using always the latest GCC 10 Build with LTO self compiled

Added battery Store mode [used to limit charging] advanced use only & Unstable power detection driver and made it optional through HKTweaks app (Google it)

Added battery charging control!! [The first on XDA & outside XDA]

Kernel size decreased from 39MB to 28~29MB from the debloating the kernel! [Truth to be told the Lightest Kernel on XDA & Outside XDA]

WireGuad using the latest version always

Added MoroSound! because many requested it

Optimized GPU futher by speeding up rendering frames to the display driver

Disabled security options that reported it might slow down kernel operation upto 30% [Thanks @arter97!]

Tuned UFS net boost table

Fixed CPUSet driver & updated block core for faster operations

Optimized block driver that should help shaving off a few cycles of the I/O hot path

Improve event-poll driver which make wakelocks less likely to happen

Improved/Optimized hrtimer, alarmtimer, timers drivers

Added Spinlocks, Qspinlocks, RWLocks, QRwlock, Atomic drivers & updated it

Optimized Dcache & ARM driver to improve cache-line alignments performance

Optimized CGroup to have a dedicated kmem_cache pool and avoid costly dynamic memory allocations.

Dynamtic Shedtune driver implemented and updated it with the latest patches

Clean up garbage/unused codes from CPU governers

Optimized IO up to 34% improvement in the I/O latency.

Removed a lot of garbage code and cleaned it up

Updated lib lz4 modules from 2013 to 2018/2019 including all updates which makes it possible to enable applications to use fast and/or high compression depending on the use case

State notifier driver enabled

Linux Up streaming kernel updated to the latest always

Applied PSI driver on RAM , CPU , IO Drivers... see what it does...

[When systems are overcommitted and resources become contended, it's hard to tell exactly the impact this has on workload productivity, or how close the system is to lockups and OOM kills. In particular, when machines work

multiple jobs concurrently, the impact of overcommit in terms of latency and throughput on the individual job can be enormous.

In order to maximize hardware utilization without sacrificing individual job health or risk complete machine lockups, this patch implements a way to quantify resource pressure in the system.]

Compiled it with GCC 10 with the latest updates applied & custom optimizations is used

Implemented FRANDOM

Fade Ramp Control

SELinux Permissive/Enforced

Boeffla WakeLock Blocker

Added Unstable Power Detection through HKTweaks app

(Google it)

CPU Max Freq for LITTLE - Max Freq 2002MHz Min Freq - 455Mhz

CPU Max Freq for BIG - Max Freq 2946MHz Min Freq - 650Mhz

Sky's the limit.. OC'ed CPU Quad Core to 2.31Ghz & Dual Core to 2.65Ghz!

[Default on stock kernel is 1.8GHz Quad & 2.3GHz Dual]

Implemented Power saving work-ques and made it optional for those who don't like power saving

Updated F2FS to the latest updates taken from Android-Q Google sources! needs ROM modifications to get F2FS working on /data partition

HMP is synced with Googles latest scheduler changes

Kernel Features for Android Pie

Imported N960FXXU4CSK1 kernel sources

Used updated ramdisk N960FXXU4CSK1

Implemented Devfreq Boost driver and updated it... look below what it does

"This driver boosts enumerated devfreq devices upon input, and allows for

boosting specific devfreq devices on other custom events. The boost

frequencies for this driver should be set so that frame drops are

near-zero at the boosted frequencies and power consumption is minimized

at said frequencies. The goal of this driver is to provide an interface

to achieve optimal device performance by requesting boosts on key

events, such as when a frame is ready to rendered to the display."

Taken SDCard drivers from Note10.

Introduced a centralized Energy Model (EM) management framework which aggregates the power values provided by drivers into a table for each performance domain in the system.

Possible fix for 1950Mhz to be forced to 2GHz

Added & enabled BBR tcp optimizations and networking operations optimizations... using fq_codel+bbr

[Observed a significant increase in BBR throughput (measured using netperf), in a basic wifi setup.]

Implemented further more CPU optimization for power consumption from Nvidia!! to Enhance power efficiency and adapted it to our Note9 device

Using always the latest GCC 10 Build with LTO self compiled

Optimized UKSM function and KSM along with it

Add ROW scheduling algorithm & ROW driver... mechanism of it is...

[

The ROW scheduling algorithm will be used in mobile devices as default

block layer IO scheduling algorithm. ROW stands for "READ Over WRITE"

which is the main requests dispatch policy of this algorithm.

The ROW IO scheduler was developed with the mobile devices needs in

mind. In mobile devices we favor user experience upon everything else,

thus we want to give READ IO requests as much priority as possible.

The main idea of the ROW scheduling policy is:

If there are READ requests in pipe - dispatch them but don't starve

the WRITE requests too much.

]

Added battery Store mode [used to limit charging] advanced use only & Unstable power detection driver and made it optional through HKTweaks app (Google it)

Added battery charging control!! [The first on XDA & outside XDA]

Made automated driver for read-ahead size decision when inserting any OTG/USB external storage on the device to optimize file processing performance.

Kernel size decreased from 39MB to 34.9MB from the debloating the kernel! [Truth to be told the Lightest Kernel on XDA & Outside XDA]

WireGuad using the latest version always

GFS -

G

entle

F

air

S

leepers options provided to have more battery life

Added MoroSound! because many requested it

Initial support for Nethunter users

Optimized GPU futher by speeding up rendering frames to the display driver

Disabled some security options that reported it might slow down kernel operation upto 30% [Thanks @arter97!]

Added/Implemented UKSM

Brought a collection of Paranoid Android & Xiaomi patches to our beloved Note9 devices

Tuned UFS net boost table

Fixed CPUSet driver & updated block core for faster operations

Optimized block driver that should help shaving off a few cycles of the I/O hot path

Added SIMD & VSDO Technology

Added Power suspend driver and integrated it to display driver

Improve event-poll driver which make wakelocks less likely to happen

Improved/Optimized hrtimer, alarmtimer, timers drivers

Added Spinlocks, Qspinlocks, RWLocks, QRwlock, Atomic drivers & updated it

Added Dynamic Fsync driver and made it available with normal Fsync driver

Introduce CPUSet Assist driver for optimized multitasking

Optimized Dcache & ARM driver to improve cache-line alignments performance

Optimized CGroup to have a dedicated kmem_cache pool and avoid costly dynamic memory allocations.

Added Sweep2wake, Doubletap2wake and Sweep2sleep for Samsung Galaxy Note 9

CPU Input driver implemented and updated

Micro-optimizations for Ion driver, Binder, PCI Exynos drivers, hotplug driver,F-ECM driver.

CPU-Boost driver implemented and updated to the latest version including all kind of patches and updates from Sony,Xiaomi, and Nvidia

Dynamtic Shedtune driver implemented and updated it with the latest patches

Clean up garbage/unused codes from CPU governers

Optimized IO up to 34% improvement in the I/O latency.

Using Galaxy S10 + Note 10 HMP extracted drivers combined and implemented it to our be loved Note 9!

Introduced [Host Performance Booster] HPB driver from Pixel 3! & Adapted it to our Note9!! Please read below what HPB can do...

[HPB is essentially caching of the NAND chip’s FTL (flash translation layer) L2P (logical to physical) mapping tables into the hosts (SoCs) main memory. This allows the host driver to look up the target L2P entry directly without betting on UFS’s limited SRAM to have a cache-hit, reducing latency and greatly increasing random read performance. The authors of the feature showcase an improvement of 59-67% in random I/O read performance due to the new feature. It’s worth to mention that traditional Android I/O benchmarks won’t be able to show this as as those tend to test read speeds with the files they’ve just created.]

(Source of this info ---> Here)

Added Ainur audio driver for those who want to use DTS Audio mods

Applied PSI driver on RAM , CPU , IO Drivers... see what it does...

[When systems are overcommitted and resources become contended, it's hard to tell exactly the impact this has on workload productivity, or how close the system is to lockups and OOM kills. In particular, when machines work

multiple jobs concurrently, the impact of overcommit in terms of latency and throughput on the individual job can be enormous.

In order to maximize hardware utilization without sacrificing individual job health or risk complete machine lockups, this patch implements a way to quantify resource pressure in the system.]

Implemented AnyKernel Installer for the kernel so now Kernel will be flashed as a zip file! no more lockscreen/Samsung account issues (Make sure to clean install ROM if you have Samsung account issues)! [Big Thanks to @klabit87 for his awesome help! & @djb77 for his permission to use some of his scripts]

Updated Ramdisk to the latest build

Updated Kernel build base to the lastest available

Removed a lot of garbage code and cleaned it up

Updated lib lz4 modules from 2013 to 2018/2019 including all updates which makes it possible to enable applications to use fast and/or high compression depending on the use case

State notifier driver enabled

Linux Up streaming kernel updated to the latest always

Added IO governor & Updated to the newest version/patches:-

-Anxiety

-Maple

-SIO

-FIOPS

-Marrow

-Tripandroid

Implemented IO Switcher Driver (Taken from Oreo kernel) which will save more battery by switching IO Governor to 'Noop' when Screen Off and switch back to CFQ when is On for maximum battery and optimization + without need any user intervention... it does this automatically.

Fixed USB issues

Compiled it with GCC 10 with the latest updates applied & custom optimizations is used

Implemented FRANDOM

Fade Ramp Control

Compatible with DriveDroid

WireGuard Support

SELinux Permissive/Enforced

Boeffla WakeLock Blocker

Added Unstable Power Detection through HKTweaks app

(Google it)

Using CPUAssist & StuneAssist

Implemented SchedUtilX CPU Gov and made it as default

Implemented Blu_schedutil CPU Gov

CPU Max Freq for LITTLE - Max Freq 2002MHz Min Freq - 455Mhz

CPU Max Freq for BIG - Max Freq 2946MHz Min Freq - 650Mhz

Sky's the limit.. OC'ed CPU Quad Core to 2.31Ghz & Dual Core to 2.5Ghz!

[Default on stock kernel is 1.8GHz Quad & 2.3GHz Dual]

Implemented Power saving work-ques and made it optional for those who don't like power saving

Updated F2FS to the latest updates taken from Oreo!

CPU Input driver implemented and updated

Battery polling & NFS wakelock control

State notifier driver

SimpleLMK [Oreo feature for the moment]

GPU OC [Oreo feature for the moment]

And a lot more, that you need to find ;).

FDE.AI & L Speed & Nuked Script it's been tested for Zeus kernel & ROM and

me as a Kernel Developer I officially support it

. It is been tested for everything.. stability , performance and improved battery life ;)

Everyone give full support to those developers @Paget96 , @FeraVolt :fingers-crossed:

====================================================================================================

ZeusROM Q Version

For N960F/FD users:-

GoogleDrive Download Link:-

Download Link Here

Mega Download Link:-

Download Link Here

MD5:-

a1d7cc2991435c74cf843b0ff468e70c

For N960N users:-

GoogleDrive Download Link:-

Download Link Here

Mega Download Link:-

Download Link Here

MD5:-

aa656b105dfcf00a8e76e33e11b7beb4

====================================================================================================

Kernel Q Version

Here

Kernel Pie Version

Here

Telegram Link

mod edit - link removed

I recommend using Hktweaks app through this link.. it fully supports Zeus kernel :)

Here

Credits:-

Samsung Open Source Release Center for the Source code

Google for AOSP Common Kernel Source

@osm0sis for Android Image Kitchen

@klabit87 for his scripts :highfive:

@farovitus for ELS

@djb77 for scripts

@Anastasis Vasileiadis for his help to provide the needed changes for NetHunter to work :)

@Arteush for providing a proper scripts to get it working with all TWRP (Especially his own ones) :)

@Eamon for compile script

And every one that made Android a beautiful world! :fingers-crossed:

XDA:DevDB Information

Zeus Kernel, Kernel for the Samsung Galaxy Note 9

Contributors

azZA_09, Da-BOSS, All users on telegram group

Source Code: https://github.com/THEBOSS619

Kernel Special Features: F2FS, Custom CPU BUS, Debloated Code, Power Suspend Driver, CPU OC, CPU Bus Mods, Driver Mods, Pocket Judge Idle, GCC Mods, IO Switcher, UFS Mods, DynFsync, Host Performance Boost[HBP], HMP mods, Ainur Audio, SIMD & VSDO

Version Information

Status: Stable

Created 2019-08-28

Last Updated 2020-04-14