A simple Android kernel module that enables MGLRU and ensures it is properly configured on devices or ROMs that do not handle it correctly by default.
This module works by writing to standard Linux kernel MGLRU sysfs nodes:
/sys/kernel/mm/lru_gen/enabled
/sys/kernel/mm/lru_gen/min_ttl_ms
Primarily designed for modern Android kernels with MGLRU support.
- Enable MGLRU if it is disabled
- Fix
min_ttl_mswhen exposed but set to0 - Persistent across reboots
- Minimal, safe, and non-aggressive behavior
- KernelSU / KernelSU Next / SukiSU / Wild KSU
- (Also compatible with Magisk)
- Kernel with MGLRU support (Linux 5.15+)
- Kernel exposes the following node:
/sys/kernel/mm/lru_gen/enabled
If the node does not exist or is locked by the kernel, the module will exit safely.
The module follows a simple and safe logic:
- If MGLRU is not supported, installation aborts
- If MGLRU is disabled, the module enables it
- If MGLRU is enabled but
min_ttl_msis0, the module fixes it - If MGLRU is already properly configured, the module does nothing and only verifies at boot
The module does not add new kernel features or override vendor memory policies.
- Install the module via a KernelSU-compatible manager
- Reboot the device
- MGLRU will be enabled or verified automatically at boot
No user interaction is required.
This module uses date-based versioning:
version=user-YYYY.MM.DD
versionCode=YYYYMMDD
Test builds use the test-YYYY.MM.DD format.
- Some ROMs already enable MGLRU by default; in this case, no performance change is expected
- Many Android kernels do not expose MGLRU
statnodes — this is normal - This module is intentionally minimal and avoids aggressive tuning
Do whatever you want.
This is just a simple, honest switch.