Optimize battery life across DTB pinctrl, schedutil, SDHCI, and background daemons

This commit is contained in:
Luxferre committed 2026-10-30 19:28:07 +02:00
1 parent 9c28fa1e4c
commit 0a24bf8aff
20 files changed
+59 -29

No files matched your search

+21 -4
View File
@@ -7,12 +7,29 @@ if [ -w /sys/class/graphics/fbcon/cursor_blink ]; then
fi
# Reduce periodic VM stat shepherd and dirty writeback timer wakeups
{ echo 10 > /proc/sys/vm/stat_interval; } 2>/dev/null || true
{ echo 1500 > /proc/sys/vm/dirty_writeback_centisecs; } 2>/dev/null || true
{ echo 3000 > /proc/sys/vm/dirty_expire_centisecs; } 2>/dev/null || true
{ echo 30 > /proc/sys/vm/stat_interval; } 2>/dev/null || true
{ echo 6000 > /proc/sys/vm/dirty_writeback_centisecs; } 2>/dev/null || true
{ echo 6000 > /proc/sys/vm/dirty_expire_centisecs; } 2>/dev/null || true
{ echo 0 > /proc/sys/kernel/nmi_watchdog; } 2>/dev/null || true
{ echo "1 4 1 4" > /proc/sys/kernel/printk; } 2>/dev/null || true
# Automount microSD card if present at boot
# Tune CPUFreq schedutil governor for rapid downclocking to 200 MHz at idle
# (qcom-cpufreq reports transition_latency=UINT_MAX, causing schedutil rate_limit_us
# to default to 6442450 us = 6.44s without this override)
for gov_dir in /sys/devices/system/cpu/cpufreq/schedutil /sys/devices/system/cpu/cpufreq/policy*/schedutil /sys/devices/system/cpu/cpu*/cpufreq/schedutil; do
if [ -d "$gov_dir" ]; then
{ echo 2000 > "$gov_dir/rate_limit_us"; } 2>/dev/null || true
{ echo 20000 > "$gov_dir/up_rate_limit_us"; } 2>/dev/null || true
{ echo 1000 > "$gov_dir/down_rate_limit_us"; } 2>/dev/null || true
fi
done
# Enable IEEE 802.11 power save on WCN3620 wlan0
if command -v iw >/dev/null 2>&1; then
iw dev wlan0 set power_save on 2>/dev/null || true
fi
# Automount microSD card if present at boot (unbinds 7864900.sdhci when slot is empty)
if [ -x /usr/bin/sxmo_sdcard.sh ]; then
/usr/bin/sxmo_sdcard.sh automount boot >/dev/null 2>&1 &
fi