Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zram-init fails if zramctl is available but no zstd support #15

Closed
sedlund opened this issue Mar 4, 2019 · 6 comments
Closed

zram-init fails if zramctl is available but no zstd support #15

sedlund opened this issue Mar 4, 2019 · 6 comments

Comments

@sedlund
Copy link

sedlund commented Mar 4, 2019

Same system as in #14 but now with util-linux installed for zramctl suport.

No log, except on console.

image

In this case with zramctl installed, it will not create a zram device at all.

zramctl in Alpine 3.9.1:

alpine@ip-172-31-43-27:$ zramctl -V
zramctl from util-linux 2.33
alpine@ip-172-31-43-27:$ zramctl --help

Usage:
 zramctl [options] <device>
 zramctl -r <device> [...]
 zramctl [options] -f | <device> -s <size>

Set up and control zram devices.

Options:
 -a, --algorithm **lzo|lz4|lz4hc|deflate|842**   compression algorithm to use
...

alpine@ip-172-31-43-27:~$ cat /proc/swaps
Filename                                Type            Size    Used    Priority


No zstd support.

Maybe defaulting to zstd in the default /etc/conf.d/zram-init might be a bit premature.

@vaeth
Copy link
Owner

vaeth commented Mar 4, 2019

The algorithms shown on the help page of zramctl are not the algorithms which it understands:
zramctl simply attempts to set the passed algorithm argument.
The error message you see is from the kernel: It seems your kernel does not have support for zstd compiled into the zram module. (Or maybe it exists only as a module and you have to modprobe something before?)

@sedlund
Copy link
Author

sedlund commented Mar 4, 2019

There is a loaded zstd module for btrfs. The alpine kernel seems not to include support for it with zram though, as evidenced by the output from the other issue I posted.

@sedlund sedlund closed this as completed Mar 4, 2019
@sedlund
Copy link
Author

sedlund commented Mar 4, 2019

Oops did not mean to close!

@sedlund sedlund reopened this Mar 4, 2019
@vaeth
Copy link
Owner

vaeth commented Mar 4, 2019

IMHO, this is not a bug. It is documented which kernel versions can provide support.

Having zstd support in the kernel is not enough for zram. It must also be supported by the crypto API, that is, you will need CONFIG_CRYPTO_ZSTD.

@sedlund
Copy link
Author

sedlund commented Mar 4, 2019

Thanks for your help with the other things. I will raise this one in the Alpine bug tracker.

Edit - Alpine bug:
https://bugs.alpinelinux.org/issues/10044

@sedlund
Copy link
Author

sedlund commented May 5, 2019

zram support is now compiled in recent alpine kernels.

https://git.alpinelinux.org/aports/commit/?id=4fcd763003fabfbff087413bd82d767b1862b6f9

thanks.

@sedlund sedlund closed this as completed May 5, 2019
@vaeth vaeth mentioned this issue May 24, 2019
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

No branches or pull requests

2 participants