From 169447f59332afb135296df06333d8e4d5f1c22a Mon Sep 17 00:00:00 2001 From: rope Date: Tue, 29 Sep 2026 19:34:32 +0100 Subject: [PATCH] Eee: MGLRU min_ttl, earlyoom on RAM alone Co-Authored-By: Claude Opus 5.5 --- hosts/FredOS-Eee.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hosts/FredOS-Eee.nix b/hosts/FredOS-Eee.nix index 1a1ec2b..67a60a8 100644 --- a/hosts/FredOS-Eee.nix +++ b/hosts/FredOS-Eee.nix @@ -101,8 +101,14 @@ in # 1GB RAM: compressed swap only (disk swap is off, see hardware file). zramSwap.enable = true; # A heavy page (bbc.co.uk) used to freeze everything; now the biggest - # process (the browser's web process) dies instead. + # process (the browser's web process) dies instead. zram lives in RAM, so + # swap never looks full: judge on RAM alone. services.earlyoom.enable = true; + services.earlyoom.freeSwapThreshold = 100; + # Even with no disk swap it still froze: the kernel kept evicting and + # re-reading program code from disk. MGLRU's min_ttl OOM-kills instead + # when it can't keep the last 1s of working set in RAM. + systemd.tmpfiles.rules = [ "w /sys/kernel/mm/lru_gen/min_ttl_ms - - - - 1000" ]; # The NixOS manual is a big from-source build on i686 for a page nobody reads. documentation.nixos.enable = false;