Fix xkopher link focus and unlock clock; battery longevity pass

Map xkopher link focus through wrapped display rows and reset horizontal scroll in no-wrap mode. Refresh the status bar clock on unlock and from dmenu before republishing root WM_NAME. Re-analysis found two low-risk wins: force lz4 for the active zram swap and disable proactive compaction. Rebuild dmenu.so and smallweb.so, update guards and docs, redeploy live, and rebuild the image.
This commit is contained in:
Luxferre committed 2026-11-08 08:45:53 +02:00
1 parent 85c6a7b886
commit 3543556735
22 files changed
+402 -54

No files matched your search

+125
View File
@@ -913,3 +913,128 @@ Fixes, without changing the long steady-state poll interval:
failure. **Config -> Sync net time** calls it via
`bananarchy-sync-net-time.sh` and shows a desktop notification, so the user
can always force a sync without a shell.
---
## 17. Battery longevity re-analysis (post-`85c6a7b` live measurement)
A fresh 60 s idle window was measured on 2026-11-08 at ~10.3 h uptime with the
panel dark (`brightness=0`, `bl_power=4`), Wi-Fi connected to
`OffOurStreets_`, USB RNDIS up, and both SIM applications `ready`. The phone
was charging at `540000` uA with no `current_now` and no coulomb counter, so
all results below are wakeup/IRQ/context-switch counts, not discharge mA.
`capacity` was 44%, `health=Good`, `voltage_now=4054397` uV and
`voltage_ocv` returned `No data available`.
### 17.1 Measurement caveat: modem registration anomaly
`msm-modem-uim-selection status` reported
`NAS_REG_STATE=not-registered-searching`, `SEC_NAS_REG_STATE=not-registered`,
`mmcli -L` returned `No modems were found`, and the slot mapping was
`PRIMARY_GW_SLOT=2` / `SECONDARY_GW_SLOT=1` (swapped relative to the earlier
verified `1` / `2` state). `AT+COPS?` returned `+COPS: 0` with no operator.
This is a separate functional issue; no PIN verification was attempted. A
searching modem can draw more RF current than a registered idle modem, so the
radio-related conclusions below are conservative and need a battery-powered
A/B run once registration is restored.
### 17.2 Baseline: the application processor is already near its floor
60 s, screen off, Wi-Fi up, both SIM applications ready:
| Source | Rate |
| --- | --- |
| `arch_timer` | 15.01/s |
| `arch_mem_timer` | 11.64/s |
| `mmc0` | 0.56/s |
| `smd-edge` | 0.52/s |
| `wcn36xx_rx` | 0.34/s |
| `wcn36xx_tx` | 0.11/s |
| `pm8916_vm_bms` | 0.02/s |
| CPU idle | 97.93% overall, 99.48% cpu0, 96.37% cpu1 |
| `cpu-sleep-0` entries | 12.47/s cpu0, 7.54/s cpu1 |
| WFI entries | 0.97/s cpu0, 1.05/s cpu1 |
Top context-switch deltas were kernel threads (`rcu_preempt` 5.35/s,
`kcompactd0` 1.97/s, four `kworker` threads 1.11/1.10/0.50/0.47/s), then
`NetworkManager` 0.37/s, `wpa_supplicant` 0.26/s, `nmcli device monitor`
0.11/s, `dbus-daemon` 0.11/s, `udevd` 0.06/s and `init` 0.06/s. All 26
preloaded `dwm-plugin` daemons and `Xorg` were absent from the top 30, which
confirms the zero-lag resident-plugin model is not the remaining drain.
Runtime PM was already effective: `1c00000.gpu`, both SDHCI hosts, SPI, DMA
controllers, IOMMU and the modem `bam-dmux` were suspended; genpd `mx`,
`mx_ao`, `cx` and all GDSCs were off, with only `cx_ao` on. GPU devfreq was
`simple_ondemand` at 409.6 MHz with a 100 ms poll. 21 clocks remained enabled,
including `bimc_ddr_clk_src`, `gcc_mss_q6_bimc_axi_clk`, USB HS clocks and the
serial-console `gcc_blsp1_uart1_apps_clk`. Regulators with users were the dummy
regulator, `s2`, `l5`, `l7`, `l8` and `l13`.
`/sys/power/state` was still 0 bytes, `/proc/device-tree/psci` absent,
cpuidle driver `qcom_spm` with WFI + `cpu-sleep-0`, `CONFIG_SUSPEND` off,
`CONFIG_NO_HZ_IDLE=y`, `CONFIG_HZ=300`, `CONFIG_PREEMPT=y`,
`CONFIG_PERF_EVENTS=y`, `CONFIG_FUNCTION_GRAPH_TRACER=y`,
`CONFIG_ENERGY_MODEL` off and `CONFIG_CPU_IDLE_GOV_MENU=y`. The ABI-breaking
config list from section 14 still applies; a full pmaports module tree rebuild
remains declined.
### 17.3 Two low-risk wins found and implemented
1. **The active zram swap used `zstd`, not the shipped `lz4` setting.**
`postmarketos-zram-swap` calls `/usr/bin/zramstart`, which sources
`/usr/share/misc/source_deviceinfo` and defaults
`deviceinfo_zram_swap_algo` to `zstd`; it ignores
`/etc/conf.d/zram-init`. Live `/sys/block/zram0/comp_algorithm` showed
`[zstd]`. All five `devices/*/deviceinfo*` files now set
`deviceinfo_zram_swap_algo="lz4"`, and the `zram-init` config carries a
compatibility note. This restores the intended U12/K13 CPU saving without
changing the kernel or module ABI.
2. **Proactive compaction kept `kcompactd0` awake.** The default
`vm.compaction_proactiveness=20` produced 1.97 context switches/s from
`kcompactd0`. A controlled 60 s A/B with
`vm.compaction_proactiveness=0` reduced that to 0.02/s and raised measured
CPU idle from 97.93% to 99.22%; combined timer IRQs fell from 26.65/s to
17.39/s. The A/B window also showed a 3.42/s `ci_hdrc_msm` USB IRQ from
SSH/charger activity, so this is a wakeup saving, not a measured mA
saving. `vm.compaction_proactiveness=0` is now set in
`etc/sysctl.d/99-bananarchy-power.conf` and
`etc/local.d/10-power-save.start`.
### 17.4 DSDS eco A/B was inconclusive without discharge current
With `DSDS_SECONDARY_MODE=eco` and `DSDS_PARK_DELAY=2`, the secondary GW
session parked cleanly (`secondary_parked=yes`, `SECONDARY_GW_SLOT=0`) and
restored on wake. The 60 s IRQ rates did not improve versus baseline
(`mmc0` 1.24/s, `wcn36xx_rx` 0.74/s, `smd-edge` 0.61/s), likely because the
modem was already searching and the measurement included policy/config file
writes. Eco mode remains an opt-in trade (SIM2 unreachable while parked); its
RF saving can only be quantified on battery power with a registered modem.
### 17.5 Remaining opportunities, in priority order
1. **Restore modem registration and the primary/secondary slot mapping.**
This is a functional prerequisite for any radio-power A/B measurement.
2. **Battery-powered A/B for `WIFI_LISTEN_INTERVAL=10`, `MODEM_DRX_MODE=6-9`
and `DSDS_SECONDARY_MODE=eco`.** All three are already configurable via
`/etc/bananarchy-power-policy.conf`; defaults stay conservative because
higher DRX modes and longer listen intervals delay inbound data, and
`AT$QCDRX=9` previously made the AT channel briefly unresponsive.
3. **Replace `nmcli device monitor` with NetworkManager dispatcher hooks.**
It accounts for 0.11 context switches/s and duplicates the dispatcher path
already used for DPM and time sync.
4. **`commit=60` on the rootfs mount.** Could cut a fraction of the 0.56/s
`mmc0` IRQs, but risks data loss on sudden power cut; deliberately not
shipped.
5. **Remove `earlycon console=ttyMSM0` from the cmdline.** Cmdline-only and
ABI-safe, would gate the 3.686 MHz UART clock, but removes the serial debug
lifeline; deliberately kept.
6. **PSCI `SYSTEM_SUSPEND` in lk2nd.** Still the only path to DDR self-refresh
and `mem` suspend. Until then `bimc_ddr_clk_src` stays enabled and no
kernel config change can fix it.
7. **AP-side Wi-Fi DTIM tuning.** Not controllable from the phone.
The AP and userspace are already close to their idle floor. Further 24 h
battery life has to come from modem/Wi-Fi RF policy, DDR self-refresh, or a
battery-powered measurement campaign; another kernel config trim or full
module tree rebuild is not justified.