Skip to content

A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.

docs: correct the performance claims that measurement disproved

ExTv8e434ac6698f
diff --git a/CLAUDE.md b/CLAUDE.md
index 7296155..4be4c52 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -215,7 +215,7 @@ The terminal emulator JNI is built from the vendored `terminal-emulator` module
## Performance tuning (TCG path; KVM is impossible without root)
-In `QemuEngine.buildCommand()`: `tcg,thread=multi`, larger `tb-size` for ≥2GB RAM, dedicated `iothread` on `virtio-blk-pci`, `-cpu max,sve=off`. Guest cmdline: `mitigations=off` (safe inside TCG), per-device `mq-deadline`. `init-podroid`/bootstrap: ZRAM lz4 swap at half RAM. `CONFIG_EXT4_FS_SECURITY=y` + `CONFIG_SQUASHFS_XATTR=y` keep `security.capability` xattrs across the overlay (rootless podman's `newuidmap` needs them). What won't work without root: `io_uring` (seccomp), CPU affinity, KSM, TAP networking, host hugepages.
+In `QemuEngine.buildCommand()`: `tcg,thread=multi`, larger `tb-size` for ≥2GB RAM, dedicated `iothread` on `virtio-blk-pci`, `-cpu max,pauth-impdef=on`. More vCPUs are not better here: on an 8-core phone, 8 measured slower than 4 on every metric. Guest cmdline: `mitigations=off` (safe inside TCG), per-device `mq-deadline`. `init-podroid`/bootstrap: ZRAM lz4 swap at half RAM. `CONFIG_EXT4_FS_SECURITY=y` + `CONFIG_SQUASHFS_XATTR=y` keep `security.capability` xattrs across the overlay (rootless podman's `newuidmap` needs them). What won't work without root: `io_uring` (seccomp), CPU affinity, KSM, TAP networking, host hugepages.
## Quirks & gotchas
diff --git a/app/src/main/java/com/excp/podroid/engine/QemuEngine.kt b/app/src/main/java/com/excp/podroid/engine/QemuEngine.kt
index 8381231..7ec58a1 100644
--- a/app/src/main/java/com/excp/podroid/engine/QemuEngine.kt
+++ b/app/src/main/java/com/excp/podroid/engine/QemuEngine.kt
@@ -550,7 +550,10 @@ class QemuEngine @Inject constructor(
val userKernelExtras = config.kernelExtraCmdline.trim()
args += "-M"; args += "virt,gic-version=3"
- // pauth-impdef swaps QEMU's slow QARMA5 PAuth for a fast non-crypto impl (≤50% TCG win on aarch64-on-aarch64).
+ // pauth-impdef swaps QEMU's slow QARMA5 PAuth for a fast non-crypto impl. The 50%
+ // figure quoted upstream does not show up here: measured against a QARMA5 control
+ // it is worth a few percent on xz and bc and nothing on boot or sha256, because
+ // the Alpine musl userspace is not built with PAC branch protection. Still free.
args += "-cpu"; args += "max,pauth-impdef=on"
val tbSizeMb = if (config.ramMb >= 2048) 512 else 256
// thread=multi: one host thread per vCPU; larger tb-size reduces re-translation for JIT-heavy guests.
diff --git a/app/src/main/java/com/excp/podroid/util/DeviceResourcePolicy.kt b/app/src/main/java/com/excp/podroid/util/DeviceResourcePolicy.kt
index 1a96a3a..e9a5943 100644
--- a/app/src/main/java/com/excp/podroid/util/DeviceResourcePolicy.kt
+++ b/app/src/main/java/com/excp/podroid/util/DeviceResourcePolicy.kt
@@ -48,7 +48,10 @@ object DeviceResourcePolicy {
}
fun balancedCpus(cpuCount: Int): Int {
- // Half the host cores, capped at 4 for battery/thermals on phones.
+ // Half the host cores, capped at 4. Battery and thermals are the obvious
+ // reason; the measured one is that the cap is also simply faster. On an
+ // 8-core phone under TCG, 8 vCPUs came out slower than 4 on every metric
+ // (boot, sha256, xz, bc, and the node workloads), reproduced across two runs.
val target = (cpuCount / 2).coerceAtLeast(1).coerceAtMost(4)
return nearestAtMost(CPU_OPTIONS, target)
}