Merged
Conversation
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.
Member
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?