Compessor lz4

#1

i have this erorrs in dmesg whit new version kenel or systemd

[    2.651513] zswap: default compressor lz4 not available
[    2.651515] zswap: pool creation failed

Does anyone know if it is harmless
or can it be solved?
Thank for help
Cheers

edit
I forgot I have no swap
sorry

#2

if I follow this guide:
https://wiki.archlinux.org/index.php/Zswap#Enable_LZ4_compression_.28faster_than_lzo_and_deflate.2C_less_compression.29

I get the following error just from the indicated command:

1 root@don-pc /home/don # echo 1 > /sys/module/zswap/parameters/enabled      :(
echo: write error: no device matches
#3

Do you have the lz4 package installed?

Do you use swap space on this system?

Do you have a reason to use lz4 over the default lzo?

When running mkinitcpio to rebuild your initramfs does it throw any errors?

#4

Don’t trust me on this one but the wiki contradict itself

If you cat /sys/module/zswap/parameters/enabled it will be either N or Y, not 0 or 1, you can see the defaults with the following command as shown on the wiki page you linked

grep -R . /sys/module/zswap/parameters
----
/sys/module/zswap/parameters/enabled:Y
/sys/module/zswap/parameters/max_pool_percent:25
/sys/module/zswap/parameters/zpool:z3fold
/sys/module/zswap/parameters/compressor:lz4

Try

echo Y > /sys/module/zswap/parameters/enabled
#5
  1. yes
  2. no
  3. nothing
  4. no
    Since this information appeared to me at start I asked if I had to do something.
    Thank @natemaia
#6

To use the lz4 compression algorithm with zswap, add lz4 lz4_compress to the MODULES array in /etc/mkinitcpio.conf and then run

mkinitcpio -p linux

^ That command is for the stock kernel package, if you are using linux-lts, linux-hardened or linux-zen then substitute those names instead.

And I think ArchLabs uses a swap file, check with free -h.

#7

Ok, check your /etc/mkinitcpio.conf and make sure lz4 isn’t used anywhere, as HoaS said above, then check /etc/default/grub for it as well (GRUB_CMDLINE_LINUX), then run (as root)

mkinitcpio -p linux

grub-mkconfig -o /boot/grub/grub.cfg

That should remove the errors during boot, lemme know

#8

This will show any applied kernel parameters even if ArchLabs isn’t controlling the boot process:

cat /proc/cmdline
#9

Thanks guys for your answers.
I wanted to ask you if zswap with 8gb of ram is worth activating it?
Cheers

#10

Hi, @Head_on_a_Stick
But in the wiki they say you have to do these steps, am I wrong?

    Add lz4 lz4_compress to the mkinitcpio#MODULES array.
    Replace the ramdisk environment with a newly generated one:

    # mkinitcpio -g /boot/initramfs.img

    Add zswap.compressor=lz4 to your kernel parameters.

On next reboot, see #Current parameters to check if zswap now uses lz4 as compressor. 

thank

edit
The strange thing is that I added:

 zswap.compressor=lz4 

without updating grub then it does not appear in the Kernel parameters
but if I check boot time load message, it seems to work.

[don@don-pc ~]$ dmesg | grep zswap
[    2.741062] zswap: loaded using pool lz4/z3fold
[don@don-pc ~]$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-linux-zen root=UUID=91a7796a-ed61-4963-9026-4456b3389029 rw quiet pcie_aspm=force libata.noacpi=1 nowatchdog systemd.legacy_systemd_cgroup_controller=true intel_pstate=disable elevator=noop
[don@don-pc ~]$ 

So this step should I do it?
3 Add zswap.compressor=lz4 to your kernel parameters.

On next reboot, see #Current parameters to check if zswap now uses lz4 as compressor.

#12

Where did you add that?

Do you have any swap? Please post the output of free -h.

The installation guide uses mkinicpio -p to generate a new initramfs image and it was written by Arch developers rather than Arch users, unlike the zswap page.

#13

I put zswap.compressor=lz4 on /etc/default/grub.

[don@don-pc ~]$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-linux-zen root=UUID=91a7796a-ed61-4963-9026-4456b3389029 rw quiet pcie_aspm=force libata.noacpi=1 nowatchdog systemd.legacy_systemd_cgroup_controller=true intel_pstate=disable elevator=noop
[don@don-pc ~]$ 

grub:

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR='ArchLabs'
GRUB_CMDLINE_LINUX_DEFAULT="quiet pcie_aspm=force libata.noacpi=1 nowatchdog systemd.legacy_systemd_cgroup_controller=true intel_pstate=disable elevator=noop zswap.compressor=lz4"
GRUB_CMDLINE_LINUX=
# scsi_mod.use_blk_mq=y dm_mod.use_blk_mq=y

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires to
# set 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"

But I didn’t generate the grub, so at the moment zswap.compressor = lz4 isn’t working.

free- h

[don@don-pc ~]$ free -h
              total        used        free      shared  buff/cache   available
Mem:          7,7Gi       2,1Gi       4,7Gi       246Mi       902Mi       5,1Gi
Swap:            0B          0B          0B
[don@don-pc ~]$ 

thank

#14

Remove the components from the initramfs image and the kernel command line options — there’s no point enabling zswap if you don’t have any swap.