Skip to content

nixos: Add zram swap module#2543

Merged
7c6f434c merged 1 commit intoNixOS:masterfrom
wizeman:u/zramswap
Jun 12, 2014
Merged

nixos: Add zram swap module#2543
7c6f434c merged 1 commit intoNixOS:masterfrom
wizeman:u/zramswap

Conversation

@wizeman
Copy link
Member

@wizeman wizeman commented May 6, 2014

This allows you to use the Linux kernel's built-in compressed memory as
swap space functionality.

It is recommended to enable only for kernel 3.14 (which is when zram came out of
the staging drivers area) or higher.

Please note that there seems to be a bug either in my service or in systemd where, if you have this service enabled but then reduce the value of numDevices and do a "nixos-rebuild switch", then the swap systemd units which should disappear do not actually disappear but remain in a failed state instead (until you reboot).

Even more worrying is that (if I'm remembering correctly) when transitioning to the new configuration during nixos-rebuild switch, systemd won't actually disable/swapoff these swap units, but the zram devices which the swap units depend on will still be disabled/deactivated. This may or may not cause the system to crash, I'm not sure...

It would be really helpful if someone who knows how systemd works better than me would comment on how come systemd won't disable swap units when transitioning to a new configuration... could this be a bug in switch-to-configuration.pl, perhaps?

This allows you to use the Linux kernel's built-in compressed memory as
swap space functionality.

It is recommended to enable only for kernel 3.14 (which is when zram came out of
the staging drivers area) or higher.
@wizeman
Copy link
Member Author

wizeman commented May 6, 2014

By the way, this service will be more useful once #2378 lands, as it won't require you to manually change the configuration of your kernel to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants