ItoRenz-Build / device_xiaomi_land

0 stars 2 forks source link

Putting the cores to sleep Land #4

Open nawigacja opened 2 years ago

nawigacja commented 2 years ago

If I think well, in MIUI and CM 13.0 the file /rootdir/etc/init.qcom.post_boot.sh was mainly responsible for putting the cores to sleep. I think it would be fine to adapt and initiate it in new Androids. https://github.com/Panyoujies/android_device_xiaomi_land/blob/cm-13.0/rootdir/etc/init.qcom.post_boot.sh

E.G. Redmi Note 4 (xiaomi-mido) has something like this https://github.com/zeelog/android_device_xiaomi_mido/blob/lineage-19.1/rootdir/etc/init.qcom.post_boot.sh

Redmi 4X] https://github.com/Stargazer19/device_xiaomi_santoni/blob/Havoc/rootdir/init.qcom.post_boot.sh

nawigacja commented 2 years ago

I looked at init.qcom.power.rc from CM13.0. In 13.0, 2 larger cores sleep beautifully, sometimes only 6 cores work. And so when I used init.qcom.power.rc from LOS 14.1 in CM13.0, the larger 2 cores stopped sleeping, all 8 were working. Well, I used the init.qcom.power.rc file from CM 13.0 in LOS 14.1 but no difference here. All 8 cores are working :/

Need to integrate core_ctr in kernel hmm

# Core control write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 0 write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4 write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 90 write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 40 write /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms 100 write /sys/devices/system/cpu/cpu0/core_ctl/is_big_cluster 1

In CM13.0, it works beautifully and we can have 0,1,2,3,4 active large cores.

How to put to sleep 2 small cores - write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 2 write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4

nawigacja commented 2 years ago

Hmm echo 2 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus

ro.vendor.qti.core_ctl_min_cpu=2 ro.vendor.qti.core_ctl_max_cpu=4

nawigacja commented 1 year ago

https://github.com/markkiths/android_kernel_asus_msm8916/commit/272d5a842571bca60dc6274a368d63c5fd5f97bb