Repository navigation
omamobile.config: swap on zram, and the 9a's zram notes - #515
Conversation
Build the zram driver as a module, with zstd (Omarchy's algorithm) as the default and lz4 available. Omarchy's settings configure swap on zram on every aarch64 machine (zram-generator, 90-omarchy.conf and the vm.* tuning in 99-omarchy-sysctl.conf), and stock Android runs one on the Pixel 9a (half the RAM), but our kernel has no driver, so a phone has no swap at all. On the 9a (7.4 GB) a cargo build next to Brave and the shell left 177 MB, stalled the session for minutes and ended at the OOM killer, which took the terminal's app scope with it. device/tegu/NOTES.md records the test: with half the RAM as zram, 5 GB more allocated ran without an OOM kill and with SSH answering; with Omarchy's RAM-sized zram, 6 GB more allocated hung the phone until a restart. Stock Android's own setting on the 9a, and how to set it up by hand until the image ships zram-generator, are there too. Nothing changes at boot until something configures a zram device: the modules load only on demand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01176vSgL9PRmxFqbaB3D9vk
|
Thanks for this, and for the careful notes: the before and after, stock's I built the kernel config with main's fragment and with yours, the way You're right that the cap matters. I looked at Omarchy 4.5.0, and its drop-in One small question for the notes, not blocking: after the 6 GB run, did the Your autofocus PR (#494) also adds a section at the top of the 9a notes; |
|
On the 6 GB run: not recorded, I'm afraid. The phone stopped answering at 09:56 and the next boot was at 10:02; there was no runtime watchdog then ( |
Build the zram driver as a module, with zstd (Omarchy's algorithm) as the default and lz4 available. Omarchy's settings configure swap on zram on every aarch64 machine (zram-generator, 90-omarchy.conf and the vm.* tuning in 99-omarchy-sysctl.conf), and stock Android runs one on the Pixel 9a (half the RAM), but our kernel has no driver, so a phone has no swap at all. On the 9a (7.4 GB) a cargo build next to Brave and the shell left 177 MB, stalled the session for minutes and ended at the OOM killer, which took the terminal's app scope with it. device/tegu/NOTES.md records the test: with half the RAM as zram, 5 GB more allocated ran without an OOM kill and with SSH answering; with Omarchy's RAM-sized zram, 6 GB more allocated hung the phone until a restart. Stock Android's own setting on the 9a, and how to set it up by hand until the image ships zram-generator, are there too. Nothing changes at boot until something configures a zram device: the modules load only on demand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What and why
Swap on zram for every phone: build the zram driver (
CONFIG_ZRAM=m, zstd as the default, lz4 available) inkernel/configs/omamobile.config, and record the Pixel 9a's test indevice/tegu/NOTES.md.Our kernel has no zram driver, so a phone has no swap at all. Omarchy configures swap on zram on every aarch64 machine (in Omarchy v4.5.0:
zram-generatorininstall/omarchy-aarch64.packages,default/systemd/zram-generator.conf.d/90-omarchy.conf, and thevm.*reclaim tuning inetc/sysctl.d/99-omarchy-sysctl.conf), and stock Android runs one on the 9a (half the RAM). Once the image moves past Omarchy 4.0.6, that config arrives by itself, and without the driver it finds no device.On the 9a (7.4 GB) a
cargo buildnext to Brave and the shell left 177 MB available, stalled the session (memory PSIfullabout 50 %, SSH timing out) and ended at the OOM killer, which took the terminal's app scope with it.Nothing changes at boot until something configures a zram device: the modules load only on demand. No package changes. Issues and PRs have nothing on swap or zram yet.
What I measured
The details are in
device/tegu/NOTES.md, under 2026-11-08.zram-size = ram / 2): I allocated 5 GB more on top of about 4 GB in use.fullpeaked at 32 % and dropped below 10 %.zram-size = ram, 7.3 GB): I allocated 6 GB more.zramsize=50%plus a 1 GB writeback file (vendor.zram.size=50p→fstab.zram.50p), and no swap partition.When the image picks up Omarchy's zram config, it may want a drop-in that caps it at
ram / 2. That is for a later PR, and the maintainer's call.How to try it by hand
On a kernel built with this fragment:
Resize only while zram is empty. Stopping the unit removes
/dev/zram0, andcat /sys/class/zram-control/hot_addbrings it back.Device and build
uname -r):7.3.0-rc6-omamobile-push1-ge8d722982099, a local build.kernel.configfor the test.zram.koandzsmalloc.kowent onto the running release withbin/omamobile modules-push, without a new boot image.Checks (no phone needed)
tools/pr-check origin/mainpassestests/allpassestests/packages: no package touchedversionbumped: no package changedCo-Authored-By:trailer, no AISigned-off-by:On the phone
ram / 2with the same 6 GB load that hungram.userdata, weakens the storage guard, or reads registers from userspace.The
not okrows below were there before this change:systemd-backlightis Pixel 9a: systemd-backlight fails at every boot (brightness restored before allow_tx is set) #512.tools/phone-smokereport🤖 Generated with Claude Code
https://claude.ai/code/session_01176vSgL9PRmxFqbaB3D9vk