Enable Zswap
Marcan is recommending to use Zswap instead of Zram for devices that have under 24gb of ram because unified memory is conflicting with zram. See this reddit announcement
Below is a way to add zswap using theses settings as a reference:
./configuration.nix
boot = {
kernelParams = [
"zswap.enabled=1"
"zswap.compressor=zstd"
"zswap.zpool=zsmalloc"
"zswap.max_pool_percent=50"
];
};
./hardware-configuration.nix
swapDevices = [ {
device = "/var/lib/swapfile";
size = 16*1024;
} ];
There might be a seamless solution via AppleSiliconsupport flake, though this is outside my area of expertise. Currently, Fedora Asahi uses LZ0 compression, but since zstd is already enabled in asahi-nixos kernel, I opted to use that instead.
FYI: My kernel log says: "compressor zstd not available, using default lzo" That's on 6.12.4-asahi...
FYI: My kernel log says: "compressor zstd not available, using default lzo" That's on 6.12.4-asahi...
same for me
@docbobo I found a solution https://github.com/sioodmy/dotfiles/commit/c391b65bd39f3aab11865920b1afeab8aae30459
I'm still seeing compressor zstd not available, using default lzo on 6.12.12-asahi.
@docbobo I found a solution sioodmy/dotfiles@c391b65
This is not a solution, you are switching from zswap to zram (these aren't the same thing). zstd is probably faster than lzo for most memory-intensive workloads at this point given how fast Apple Silicon is, so it would be very nice to have this in the kernel.
zstd is included in #341, which should close this issue if merged.