A high-performance Magisk module written in C++17 that optimizes Android system processes via direct Linux syscalls.
Unlike shell-based optimizers, Core Task Optimizer runs as a native binary, offering nanosecond-level efficiency in adjusting CPU affinity, scheduling policies (SCHED_FIFO), and I/O priorities to eliminate UI lag and reduce touch latency.
- 🚀 Native C++ Architecture: Built with C++17 for minimal overhead and thread-safe execution.
- 🧠 Auto-Adaptive CPU Topology: Dynamically detects Performance vs. Efficiency cores by parsing
/sys/devices/system/cpufrequencies. No hardcoded core masks. - 🎮 GPU & Touch Real-Time Mode: Forces
SCHED_FIFOpriority on critical threads likekgsl_worker_thread(Adreno GPU) andfts_wq(Touch Panels). - 🛡️ Syscall-Level Optimization: Bypasses standard shell commands to invoke
sched_setaffinity,setpriority, andioprio_setdirectly via the kernel interface. - 🔋 Intelligent I/O Throttling: automatically lowers I/O priority for background logging and garbage collection tasks (
f2fs_gc) to prevent disk contention.
The optimizer uses a custom SyscallOptimizer class to apply changes safely and effectively:
Target: system_server, surfaceflinger, zygote, composer
- Action: Sets Nice -10 and locks to Performance Cores.
- Result: Instant app launches and smoother UI rendering.
Target: kgsl_worker_thread (GPU), crtc_commit (Display), nvt_ts_work (Touch Input)
- Action: Applies SCHED_FIFO (Real-Time Scheduling) with Priority 50.
- Result: Eliminates micro-stutters in games and reduces input delay.
Target: f2fs_gc, wlan_logging_th
- Action: Sets Nice 5, restricts to Efficiency Cores, and lowers I/O Class to 3.
- Result: Prevents background maintenance from slowing down your active app.
The module includes a thread-safe Logger with automatic rotation to ensure transparency without filling your storage.
- Main Log:
/data/adb/modules/task_optimizer/logs/main.log - Error Log:
/data/adb/modules/task_optimizer/logs/error.log
- Root Access: Magisk, KernelSU, or APatch.
- Android Version: Android 8.0+ (Oreo and newer).
- Architecture: ARM64 (Snapdragon, MediaTek, Exynos, Tensor).
- Download the latest ZIP from Releases.
- Install via Magisk/KernelSU Manager.
- Reboot.
- Check the logs at the path above to verify successful optimizations.
Note
Safety First: This module uses a Sanitizer class to validate PIDs and prevent regex injection. It is designed to be fail-safe; if a syscall fails, it logs the error and continues without crashing the system.
Caution
Disclaimer: While thoroughly tested, modifying kernel scheduling parameters always carries a slight risk. I am not responsible for any software instability.