Skip to content

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

perf(rootfs): zstd-19 squashfs + dedicated iothread for /dev/vdb

ExTv016317ab25f4
diff --git a/Dockerfile b/Dockerfile
index d5352b3..ddea9db 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -70,6 +70,7 @@ RUN printf '%s\n' \
'CONFIG_FUSE_FS=y' \
'CONFIG_EXT4_FS_SECURITY=y' \
'CONFIG_SQUASHFS_XATTR=y' \
+ 'CONFIG_SQUASHFS_ZSTD=y' \
'CONFIG_IKCONFIG=y' \
'CONFIG_IKCONFIG_PROC=y' \
'CONFIG_IP_NF_RAW=y' \
@@ -120,7 +121,7 @@ RUN cd linux-${KERNEL_VERSION} \
NETFILTER_XT_TARGET_MASQUERADE NF_NAT_MASQUERADE \
NFT_COMPAT NFT_MASQ NFT_NAT \
VETH TUN NF_TABLES NF_NAT NETFILTER OVERLAY_FS FUSE_FS \
- EXT4_FS_SECURITY SQUASHFS_XATTR \
+ EXT4_FS_SECURITY SQUASHFS_XATTR SQUASHFS_ZSTD \
IKCONFIG IKCONFIG_PROC; do \
grep -q "^CONFIG_${opt}=y\$" .config \
|| { echo "FATAL: CONFIG_${opt} is not =y after merge" >&2; \
diff --git a/app/src/main/java/com/excp/podroid/engine/PodroidQemu.kt b/app/src/main/java/com/excp/podroid/engine/PodroidQemu.kt
index 855ff00..a37b820 100644
--- a/app/src/main/java/com/excp/podroid/engine/PodroidQemu.kt
+++ b/app/src/main/java/com/excp/podroid/engine/PodroidQemu.kt
@@ -526,7 +526,10 @@ class PodroidQemu @Inject constructor(
val rootfsImg = File(context.filesDir, "alpine-rootfs.squashfs")
if (rootfsImg.exists()) {
- args += "-device"; args += "virtio-blk-pci,drive=drive2,num-queues=${config.cpus}"
+ // Dedicated iothread for the read-only squashfs so its decompression
+ // reads don't queue behind storage.img writes on iothread0.
+ args += "-object"; args += "iothread,id=iothread1"
+ args += "-device"; args += "virtio-blk-pci,drive=drive2,num-queues=${config.cpus},iothread=iothread1"
args += "-drive"; args += "file=${rootfsImg.absolutePath},if=none,id=drive2,format=raw,readonly=on,cache=writeback,aio=threads"
}
diff --git a/build-rootfs/Dockerfile.rootfs b/build-rootfs/Dockerfile.rootfs
index 243cf46..79bd409 100644
--- a/build-rootfs/Dockerfile.rootfs
+++ b/build-rootfs/Dockerfile.rootfs
@@ -19,7 +19,7 @@ COPY build-rootfs.sh /work/build-rootfs.sh
RUN chmod +x /work/build-rootfs.sh && /work/build-rootfs.sh
RUN mksquashfs /work/rootfs /work/alpine-rootfs.squashfs \
- -comp gzip -all-root -noappend
+ -comp zstd -Xcompression-level 19 -all-root -noappend
# (No -no-xattrs: rootless podman's newuidmap/newgidmap need their
# file capabilities preserved; they're stored as security.capability xattr.)