• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Kernel][Stock Vendor][MIUI][Android R] ztc1997 kernel v1.20.1 for Redmi K30

Search This thread

ztc1997

Senior Member
Feb 5, 2013
120
832
BLUU_exported_66.jpg

Compatibility:
Based on Android R Xiaomi official kernel source.
Works perfectly on MIUI 12, may works on other ROMs based on Android 11 stock vendor. OSS vendor NOT supported.

Features:
  • Built with latest aosp-clang and enabled ThinLTO, LLVM Polly compilation optimization
  • GPU undervolted
  • ZRAM: Use lz4 as default compressor, swappiness allows up to 200 (default 130)
  • PELT scheduler mechanism for power efficiency
  • Optimize EAS energy model
  • Enabled power efficient workingqueue and adjust some driver to use it
  • Use BBR as default
  • Wakelock blocker
  • kcal and KLapse support
  • A lot of other optimizations
Known issues:
  • Proximity sensor not working (fixed)
  • Dt2w may not work on some AOSP based ROMs (You can force enable dt2w by changing /sys/touchpanel/double_tap to 1)

Installation:

Download: GitHub Release
Source: GitHub
Support: Telegram

Anyone can port this kernel without additional authorization.
 
Last edited:

ztc1997

Senior Member
Feb 5, 2013
120
832
Change logs:

v1.20.2
  • Allow user to skip thermal throttling when charging (It is NOT enabled by default for security reason. For user who facing slow charging, enable Usb Fast Charge or Force Fast Charge in any kernel tuning apps, then re-plug the charger.)
v1.20.1
  • Add Zstd compression algorithm
  • Minor bug fixes
v1.20.0
  • Perform ion freeing buffer and PID map reads on the LITTLE CPU cluster
  • Update jump_label from upstream
  • Remove some debug/unused features
v1.19.1
  • Re-add kcal and KLapse by user request
  • Fine-tune cpu input boost and schedutil parameters
v1.19.0
  • Remove some unstable changes
  • Rollback to original frequency table
  • Add cpu input boost
v1.18.0
  • Switch to PELT scheduler mechanism
  • Some scheduler fine-tuning from Pixel 4
v1.17.0
  • Add automatic compaction mechanism
  • Fix for wrong physical panel dimensions
v1.16.1
  • dt2w can now take effect immediately
  • Increase vmstat interval to 20 seconds
  • Revert dynamic Stune Boost and sched_boost
  • Revert some unstable changes
v1.16.0
  • Add sdFAT fs support thanks to @chiru2000 (Fix for random reboot when an SD card inserted)
v1.15.2
  • Revert dynamic cpuset for background tasks
  • Some optimizations of cpuset and memory allocation
v1.15.1
  • Revert some unstable changes
v1.15.0
  • Add Dynamic Stune Boost
  • Add sched_boost on input events
v1.14.0
  • Expose dt2w switcher to userspace (/sys/touchpanel/double_tap)
  • Disable in-kernel LMK, use userspace lmkd instead
  • Some other improvements
v1.13:
  • Disable Full Refcount Validation
  • Import some improvement of zram, cpuidle, proc, cfq
  • Default io scheduler switch back to cfq
  • tcp: Disable timestamps by default
  • hwtracing: Add a driver for disabling coresight clocks
  • Disable some debug/useless features
v1.12.2
  • Switch back to original thermal control driver (Will control heat but reduce performance)
v1.12.1
  • Re-enable MEMCG (Disable it will cause the proximity sensor not work)
  • Switch back to Android LMK
  • Set default swappiness to 130
  • sysctl: Rename swappiness to rswappiness
  • Decrease Down frequency temperature (For safety)
v1.12
  • Add f2fs rapid gc by arter97
  • Update lz4 lib and use lz4 as default compressor of zram
  • Update PID map reads optimization from sultan kernel
  • schedutil: Unlock highest freqs when devfreq boost max
  • Boost whenever the top app changes
  • Import some optimization for CRC32 and XOR (Heavily used by network protocols)
  • msm: kgsl: use kmem_cache pool for draw objects (Reduce millions of times of memory allocating)
  • Block some userspace boost
v1.11.1
  • Change the compiler to aosp-clang 12.0.4 (Stability of proton-clang cannot be guaranteed)
  • scsi: ufs: set IRQ's affinity to CPU1 (Reduce the load on CPU0 a little)
  • scsi: ufs Async suspend/resume callbacks.
  • schedutil: Don't limit frequency if devfreq boost max
  • msm: kgsl: Relax CPU latency requirements to save power
  • dcache: increase DNAME_INLINE_LEN on ARM64 to 96 bytes (Improve the efficiency of caching long name files)
  • dts: sdmmagpie: Remove 1804mhz of Low-Power cluster (Non-efficient)
v1.11
  • schedutil: Wait for up_delay before using non-efficient frequencies
  • schedutil: Set default value for hispeed_load, hispeed_freq, pl
  • schedutil: Remove iowait boost
  • scsi: ufs: Hardcode and relax UFS CPU latency requirement
  • scsi: ufs: disable clock scaling
  • sched: Avoid walt irq work in offlined cpu
  • sched/tune: Introduce SchedTune Assist, enable prefer_idle for top-app, foreground
  • msm: thermal: simple: Introduce simple MSM thermal solution
  • power supply: qpnp-qg: Allow to set charge_full greater than charge_full_design (for those users replaced large-capacity battery)
v1.10
  • zram: use z3fold backend
  • add lower freq to llcc-bw bus
 
Last edited:
  • Love
Reactions: arifn82

San4255

New member
Dec 4, 2020
3
1
View attachment 5273111

Compatibility:

Based on Android R Xiaomi official kernel source.
Works on ROMs based on Android 11 stock vendor, such as MIUI, EvolutionX, and etc.


Features:
  • Built with latest aosp-clang and enabled ThinLTO, LLVM Polly compilation optimization
  • GPU undervolted
  • ZRAM: Use z3fold backend, use lz4 as default compressor, swappiness allows up to 200
  • Optimize frequency tables and OPP capacities (Make CPU work at the most efficient frequency possible)
  • Dynamic cpuset for background task
  • Enabled power efficient workingqueue and adjust some driver to use it
  • Backport and enable HAVE_MOVE_PMD and HAVE_MOVE_PUD
  • Use BBR as default
  • Wakelock blocker
  • KLAPSE Support
  • A lot of other optimizations
Known issues:
  • Proximity sensor not working (fixed)
  • Dt2w may not work on some AOSP based ROMs

Installation:

Download: GitHub Release
Source: GitHub

Anyone can port this kernel without additional authorization.
I face random reboots. After boot 4-5 sec works then freeze for some time nd reboot. Rom evolution x. Stock vendor based
 
  • Like
Reactions: rajesh14289

ztc1997

Senior Member
Feb 5, 2013
120
832
Thanks a lot for this great job..... For this Kernel...provides very good battery backup and smooth performance....in miui hellas 21.4.28

It would be great to have LMK changing profiles+KCal..... All other kernels have that.....it would complete this kernel

So,I'm requesting for these features @ztc1997

Hope You'll consider adding them....thanks again
kcal has been re-added in v1.19.1.

According to Google’s suggestion, this kernel has used userspace lmkd to replace in-kernel lmk, which has a number of issues.
To configure lmkd, see to aosp doc.
 
  • Like
Reactions: Cpt.mactavish

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    BLUU_exported_66.jpg

    Compatibility:
    Based on Android R Xiaomi official kernel source.
    Works perfectly on MIUI 12, may works on other ROMs based on Android 11 stock vendor. OSS vendor NOT supported.

    Features:
    • Built with latest aosp-clang and enabled ThinLTO, LLVM Polly compilation optimization
    • GPU undervolted
    • ZRAM: Use lz4 as default compressor, swappiness allows up to 200 (default 130)
    • PELT scheduler mechanism for power efficiency
    • Optimize EAS energy model
    • Enabled power efficient workingqueue and adjust some driver to use it
    • Use BBR as default
    • Wakelock blocker
    • kcal and KLapse support
    • A lot of other optimizations
    Known issues:
    • Proximity sensor not working (fixed)
    • Dt2w may not work on some AOSP based ROMs (You can force enable dt2w by changing /sys/touchpanel/double_tap to 1)

    Installation:

    Download: GitHub Release
    Source: GitHub
    Support: Telegram

    Anyone can port this kernel without additional authorization.
    1
    Change logs:

    v1.20.2
    • Allow user to skip thermal throttling when charging (It is NOT enabled by default for security reason. For user who facing slow charging, enable Usb Fast Charge or Force Fast Charge in any kernel tuning apps, then re-plug the charger.)
    v1.20.1
    • Add Zstd compression algorithm
    • Minor bug fixes
    v1.20.0
    • Perform ion freeing buffer and PID map reads on the LITTLE CPU cluster
    • Update jump_label from upstream
    • Remove some debug/unused features
    v1.19.1
    • Re-add kcal and KLapse by user request
    • Fine-tune cpu input boost and schedutil parameters
    v1.19.0
    • Remove some unstable changes
    • Rollback to original frequency table
    • Add cpu input boost
    v1.18.0
    • Switch to PELT scheduler mechanism
    • Some scheduler fine-tuning from Pixel 4
    v1.17.0
    • Add automatic compaction mechanism
    • Fix for wrong physical panel dimensions
    v1.16.1
    • dt2w can now take effect immediately
    • Increase vmstat interval to 20 seconds
    • Revert dynamic Stune Boost and sched_boost
    • Revert some unstable changes
    v1.16.0
    • Add sdFAT fs support thanks to @chiru2000 (Fix for random reboot when an SD card inserted)
    v1.15.2
    • Revert dynamic cpuset for background tasks
    • Some optimizations of cpuset and memory allocation
    v1.15.1
    • Revert some unstable changes
    v1.15.0
    • Add Dynamic Stune Boost
    • Add sched_boost on input events
    v1.14.0
    • Expose dt2w switcher to userspace (/sys/touchpanel/double_tap)
    • Disable in-kernel LMK, use userspace lmkd instead
    • Some other improvements
    v1.13:
    • Disable Full Refcount Validation
    • Import some improvement of zram, cpuidle, proc, cfq
    • Default io scheduler switch back to cfq
    • tcp: Disable timestamps by default
    • hwtracing: Add a driver for disabling coresight clocks
    • Disable some debug/useless features
    v1.12.2
    • Switch back to original thermal control driver (Will control heat but reduce performance)
    v1.12.1
    • Re-enable MEMCG (Disable it will cause the proximity sensor not work)
    • Switch back to Android LMK
    • Set default swappiness to 130
    • sysctl: Rename swappiness to rswappiness
    • Decrease Down frequency temperature (For safety)
    v1.12
    • Add f2fs rapid gc by arter97
    • Update lz4 lib and use lz4 as default compressor of zram
    • Update PID map reads optimization from sultan kernel
    • schedutil: Unlock highest freqs when devfreq boost max
    • Boost whenever the top app changes
    • Import some optimization for CRC32 and XOR (Heavily used by network protocols)
    • msm: kgsl: use kmem_cache pool for draw objects (Reduce millions of times of memory allocating)
    • Block some userspace boost
    v1.11.1
    • Change the compiler to aosp-clang 12.0.4 (Stability of proton-clang cannot be guaranteed)
    • scsi: ufs: set IRQ's affinity to CPU1 (Reduce the load on CPU0 a little)
    • scsi: ufs Async suspend/resume callbacks.
    • schedutil: Don't limit frequency if devfreq boost max
    • msm: kgsl: Relax CPU latency requirements to save power
    • dcache: increase DNAME_INLINE_LEN on ARM64 to 96 bytes (Improve the efficiency of caching long name files)
    • dts: sdmmagpie: Remove 1804mhz of Low-Power cluster (Non-efficient)
    v1.11
    • schedutil: Wait for up_delay before using non-efficient frequencies
    • schedutil: Set default value for hispeed_load, hispeed_freq, pl
    • schedutil: Remove iowait boost
    • scsi: ufs: Hardcode and relax UFS CPU latency requirement
    • scsi: ufs: disable clock scaling
    • sched: Avoid walt irq work in offlined cpu
    • sched/tune: Introduce SchedTune Assist, enable prefer_idle for top-app, foreground
    • msm: thermal: simple: Introduce simple MSM thermal solution
    • power supply: qpnp-qg: Allow to set charge_full greater than charge_full_design (for those users replaced large-capacity battery)
    v1.10
    • zram: use z3fold backend
    • add lower freq to llcc-bw bus
    1
    I am using miui 12.1.4 hellas
    Everything is very good only has a very slow charging error
    Hope you fix it soon <3
    1
    Doesn't work on my device, freezes a few seconds after successfully booting, then restarts.
    ROM: xiaomi.eu_multi_HMK30_21.4.7_v12-11
    1
    View attachment 5273111

    Compatibility:

    Based on Android R Xiaomi official kernel source.
    Works on ROMs based on Android 11 stock vendor, such as MIUI, EvolutionX, and etc.


    Features:
    • Built with latest aosp-clang and enabled ThinLTO, LLVM Polly compilation optimization
    • GPU undervolted
    • ZRAM: Use z3fold backend, use lz4 as default compressor, swappiness allows up to 200
    • Optimize frequency tables and OPP capacities (Make CPU work at the most efficient frequency possible)
    • Dynamic cpuset for background task
    • Enabled power efficient workingqueue and adjust some driver to use it
    • Backport and enable HAVE_MOVE_PMD and HAVE_MOVE_PUD
    • Use BBR as default
    • Wakelock blocker
    • KLAPSE Support
    • A lot of other optimizations
    Known issues:
    • Proximity sensor not working (fixed)
    • Dt2w may not work on some AOSP based ROMs

    Installation:

    Download: GitHub Release
    Source: GitHub

    Anyone can port this kernel without additional authorization.
    I face random reboots. After boot 4-5 sec works then freeze for some time nd reboot. Rom evolution x. Stock vendor based