Swap: Difference between revisions
Axodentally (talk | contribs) Clarify swap on zvol situation. Add notes to zram (recommendation to use userspace oom-killer, zswap instead of zram with writeback). Expand zswap section. |
m boot.zswap configuration module was added. Removed manual configuration of boot.kernelParams. Added reference to boot.zswap option. |
||
| Line 90: | Line 90: | ||
Unlike zram, zswap requires a disk-based swap device or file to back it. | Unlike zram, zswap requires a disk-based swap device or file to back it. | ||
Zswap is controlled by kernel parameters and can be enabled in your NixOS configuration by | Zswap is controlled by kernel parameters and can be enabled in your NixOS configuration by using the {{nixos:option|boot.zswap}} options. | ||
{{file|/etc/nixos/configuration.nix|nix| | {{file|/etc/nixos/configuration.nix|nix| | ||
<nowiki> | <nowiki> | ||
boot. | boot.zswap = { | ||
enable = true; | |||
# … | |||
}; | |||
</nowiki> | </nowiki> | ||
}} | }} | ||
| Line 106: | Line 104: | ||
You can verify zswap's runtime status via <code>cat /sys/module/zswap/parameters/enabled</code> and inspect usage statistics with <code># grep -r . /sys/kernel/debug/zswap/</code> | You can verify zswap's runtime status via <code>cat /sys/module/zswap/parameters/enabled</code> and inspect usage statistics with <code># grep -r . /sys/kernel/debug/zswap/</code> | ||
== Disable swap == | == Disable swap == | ||