Skip to content

Stable ZeusKernel Android OneUI2.1 for Note9

Latest
Compare
Choose a tag to compare
@THEBOSS619 THEBOSS619 released this 13 Oct 01:24
· 105 commits to OneUI-2.1 since this release

This the stable release for Android OneUI 2.1 ROM.

This is a huge list which I will try to simplify it as much as possible.

  • Kernel are now using a Dynamic Tick which will be called when a CPU goes into idle state. The code evaluates the next scheduled timer event (from both hrtimers and the timer wheel) and in case that the next event is further away than the next tick it reprograms the sched_tick to this future event, to allow longer idle sleeps without worthless interruption by the periodic tick. The function is also called when an interrupt happens during the idle period, which does not cause a reschedule. The call is necessary as the interrupt handler might have armed a new timer whose expiry time is before the time which was identified as the nearest event in the previous call to hrtimer.

  • That enables a kernel to run without a regular timer tick. The timer tick is a timer interrupt that is usually generated HZ times per second. Running without a timer tick means the kernel does less work when idle and can potentially save power because it does not have to wake up regularly just to service the timer.

  • This allows to run continuously on the CPU with as few interruptions as possible to other cores and keeping all the polling, ticks, and others to 1 core at least. These can reduce the number of OS-related interrupts and reduce packet transit times. This lowers latencies and improving determinism.

A full example about what is happening during those scenarios of dynamic tick :-

  • during slightly idle usage/sessions...
    image
  • another one during casual usage/sessions...
    image

This is what kernel are trying to do... Making all the noise ticks to 1 little core and isolating all other cores clean and relaxed on casual usages.

Kernel Changes on OneUI Compared to latest ones are:-

  • Latest Kernel source from Samsung is being used.
  • Undervolted the whole SOC for CPU Bus/CPU Clusters/GPU/DDR and other subsystems
  • Upstreamed Scheduler further to latest patches and commits
  • Merged some Samsung's media enc/dec-coding drivers updates from newer Samsung devices
  • Changed workqueue operation tasks and threads to CPU 0 to isolate from other cores which leads to elimination other cores from getting exposed to unimportant tasks, interruptions or even race to it.
  • Scheduling ticks, RCU operations and others are now bound to CPU 0 as it helps to isolate other cores from getting the noise of ticks, scheduling mechanisms that happens frequently across all cores.
  • Prevent or lower the chance of preemption from happening to other tasks so that it won't interrupt other important tasks or drivers from operating or functioning which leads to lower latency for other tasks.
  • Used interruptible waits on couple of the drivers that is fine to get interrupted by other important tasks for improved coherency.
  • Upstreamed sched_util governor to latest patches available up to mainline kernel commits 5.4k+.
  • Implemented DSBoost mechanism and use it by default.
  • Introduce kernel space battery saver mode This driver creates a sysfs toggle that can be enabled when battery saver mode is activated in userspace, and provides functions to check the status of battery saver and to activate it from anywhere in the kernel. The former can be used to disable features that may otherwise drain battery faster, such as CPU and DDR boosting.
  • Implement and Use EAS dynamic boosting mechanism which is used for improved UI performance and Added toggle for EAS switches.
  • Blocked Samsung's tweaks from being applied on the kernel as we are using an updated scheduler , FAIR, KAIR, and others to avoid conflicts from happening.
  • Upstreamed some of Simple LMK related patches and applied it.
  • Updated and Adapted MoroSound driver to latest version available v2.1.1
  • Upstreamed CGROUP drivers and functions related to it up to 5.0k+ commits and patches.
  • Import/Backport Note 20 updates/patches drivers for ACPM as it is needed for upstreamed commits to work properly due to outdated Note 9 ones causing troubles.
  • Upstreamed CPUSet drivers and related functions to 5.0k+ commits and patches which improves selection of CPU logic.
  • Tuned number of jiffies CPU is permitted to sleep which should provide more power efficiency and at the same time we prevent the system from hanging during full_no_hz operation mode.
  • Fixed various sensors from slow response on various sensor detection due to changes of ticks functionality.
  • Tuned up Exynos 9810 SOC operations generally for improved battery life and performance.
  • Upstreamed OOM reaper , Kswapd, and generally for Memory management furthermore for improved multitasking performance.
  • Improved parking of stopped CPUs for further more battery life.
  • Remove frequent allocations on dma-buffer for fences for increased render performance.
  • Introduced Proactive Compaction and use it for improved Kernel allocation latencies.
  • Enabled several of TCP Algo for those who wanted to switch to other TCP algo.
  • Merged in performance improvement F2FS patches from other qualcomm devices [Huawei, OPPO, etc, etc].
  • Change it to timer tick rate to 50 HZ [previous zeus kernel was 100hz (stock is 250hz)] 50 Hz is the lowest non-problematic tick rate which theoretically it should provide the best power efficiency at the cost of mildly performance penalty, hence we are still below than 16ms which is where render frames gets signaled so this value should be safe to use. While 100hz presents just merely around 10ms resolution, 50hz
    presents around 15ms resolution. This should be giving fairness and balance between throughput and latency while reducing unnecessary energy consumption and avoiding reduced performance on CPU cores due to too many timer interrupts occurring across all cores.
  • Offload residual 1Hz scheduler tick When the CPU runs in full dynticks mode, so a 1Hz tick remains in order to keep the scheduler stats alive under full dyntick mode.
  • Prevent or don't allow userspace to impose restrictions on CPU idle levels which allows the kernel to have the freedom to choose the proper CPUIdle levels as it sees fit.
  • Don't disable cpuidle when entering suspend Leaving cpuidle enabled can result in improved power consumption.
  • Applied some upstreams to vmpressure driver according to latest Google sources updates.
  • Upstreamed ZRAM and added a configuration that can change the compression algo method for more customizable options.
  • Upstreamed z3fold, zsmalloc, zbud, zpooling mechanism to latest available patches.
  • Introduced uCLAMP scheduler to limit any tasks from consuming CPU bandwidth and integrated with schedutil cpu frequency selections.
  • Rebuild PELT parameters from scratch and regenerated to be using 10ms instead of 32 ms or 16ms.
  • Used most of ktweaks values and hardcoded and applied/used on this kernel by default.
  • Killed userspace frameworks from touching or boosting CPU frequencies since now we have kernel based boosting drivers.
  • Upstreamed CPUIdle drivers and Power management drivers furthermore with related fixes and enhancement.
  • Regenerate outdated PELT values configuration for other settings By using latest available tool by Compiling PELT C program.
  • Fixed Audio stutters from happening due to scheduler trying to preserve power consumption on certain scenarios on wrong timing.
  • Applied some of UFS storage functions from newer Samsung devices for improved performance.
  • Introduced Real-time priority to use for RCU worker threads This function specifies the SCHED_FIFO priority value that will be assigned to the rcuc/n and rcub/n threads.
  • Sync schedutil to latest patches from Samsung Taken from Note 10 5G & S10 [Exynos 9825/9820] and fully merged with KAIR feature as they quote "AI based Resource Control".
  • Adapted most of the EMS stune control functions along with boosting for improved responsiveness.
  • Boost CPU and DDR bus slightly during background compaction to avoid visible jitters from happening.
  • CPU Input Booster added the ability to customize minimum freq, maximum freq, idle freq, active minimum freq, for example it can be customized according to your liking [what idle frequency should it use, what minimum frequency it can use during active sessions, etc]
  • CPU Bus boosting are tuned for optimal power efficiency and performance.
  • Added Fsync toggle for those users who likes increased performance of IO but with increased risk of data loss.
  • Improve node tampering protection on Dynamic SchedTune/Cpuset Assist functions.
  • Added a gcc plugin to structleak for more stack initialization this plugin detects any structures that contain __user attributes and
    makes sure it is being fully initialized so that a specific class of information exposure is eliminated.
  • GCC flags optimizations applied and used on top of it for fastest kernel code.
  • Introduce CGROUP V2 freezer This implements freezer for cgroup v2, it tries to put tasks into a state similar to jobctl
    stop. This means that tasks can be killed, ptraced (using PTRACE_SEIZE*), and interrupted.
  • Make irq affinity function to have cpu isolation aware functionality which helps to manage affinity of IRQ across all cores.
  • Avoid to dynamically allocate memory on many of functions and drivers to avoid the overhead of dynamic memory allocation.
  • Upstreamed sbitmap and bitmap libs to 4.19/5.0k+ commits and patches.
  • Moved most of the unwanted or less important drivers to be active or bind to little cores.
  • Moved most of the important drivers to be active or bind to big cores.
  • Upstreamed and applied patches related to IRQ functions for improved kernel functionality.
  • Migrated almost all drivers to use power efficient workqueues for best power efficiency.
  • Turned on by default Scheduling workqueues on awake CPUs to save power and improve power efficiency as much a possible.
  • Applied IRQ performance critical and Moved most of the important drivers to be active or bind to big cores.
  • Mali tuning and optimization applied from newer Samsung devices (Note 10 & up) on GPU functions for smoother gaming sessions.
  • Made preparation on kernel for Mali to migrate to Note 20 Mali GPU r20 driver which is newer and contains performance enhancement on Mali GPU operation generally (on stock it is r19).
  • Thanks for Dynamic Tick the kernel can be considered as full tickless system kernel.
  • Updated GCC11 toolchain kernel compilation to latest updates available along with all companion libs with latest updates available.
  • Re-Tuned CPU frequency scaling and throttling mechanism for smoother operation under throttling scenarios.
  • Re-Tuned MIF and INT frequency scaling and adapted to CPU Load and frequencies usage for power efficiency.
  • Fixed alot of random reboots and bugs related to kernel operations.
  • Upstreamed further more for Timer, Locking, Clocksource, Timekeeping, CPU time, Futex, hrtimers drivers are upstreamed up to k5.1+ patches and backported to k4.9.
  • Upstreamed Crypto engines and use all kind of crypto accelerations available.
  • Further Removed/Silenced alot of tracings and loggings that is pretty much no benefits from it except hurting performance.
  • Introduced CPUAssist code and enabled it and use it along with updates and patches related to it.

I tried to be as simple as possible by explaining changes that has been made on kernel, any kernel developer can easily get what I am trying to say but hopefully normal users can get at least an idea about what is happening and hence why I took extra steps and added some images to let you see the full picture about what is happening.

I am confident enough to announce that not a single kernel have achieved what I have achieved on Zeus kernel... not even half of it, you will never find any kernel on xda or even outside of xda that offers this much of featurfull, full of performance enhancements, battery friendly and most importantly stable all at the same time.

There is more micro-optimizations has been done into this kernel than what I have mentioned above on the changelogs but imagine those micro-optimizations is being applied on different parts of this kernel and get stacked up those one after another which leads to real optimizations to be shown and seen on this kernel, hence I should just let you know about what is happening for the sake of transparency.