Skip to content

Commit 28ff36a

Browse files
committed
Disable zram on minimal netvm/usbvm
Those run with minimal amount of memory, and there is no place to spare some for compressed swap. Real swap is slower, but it's still better than killing processes on OOM... QubesOS/qubes-issues#10703
1 parent 8dcd831 commit 28ff36a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

vm-systemd/setup-minimal-vm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,20 @@ setup_minimal_netvm() {
3333
fi
3434
}
3535

36+
disable_zram() {
37+
systemctl mask --runtime --now systemd-zram-setup@zram0
38+
ln -nsf /dev/null /run/systemd/zram-generator.conf
39+
systemctl daemon-reload
40+
if command -v zramctl >/dev/null; then
41+
zramctl -r zram0
42+
fi
43+
}
44+
3645
if is_minimal_netvm; then
3746
setup_minimal_netvm
47+
disable_zram
3848
fi
3949

50+
if is_minimal_usbvm; then
51+
disable_zram
52+
fi

0 commit comments

Comments
 (0)