5
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy

I have a swap partition and I would like to try lz4 and z3fold on the zswap

nano /etc/default/grub

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX="vga=normal nomodeset iommu=pt"

GRUB_DEVICE=UUID=2da46135-a1a2-4833-ba81-d9802358ddbd

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash cgroup_enable=memory swapaccount=1 zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=20 zswap.zpool=z3fold "

I understand that zswap is enabled already on 22.04 but I put the zswap.enabled in there just in case.

nano /etc/initramfs-tools/modules

lz4
lz4_compress
z3fold
update-grub
update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-5.15.0-47-generic
update-initramfs: Generating /boot/initrd.img-5.4.0-125-generic

After reboot I see

dmesg | grep -i zswap

[   36.460295] zswap: loaded using pool lzo/zbud

grep -R . /sys/module/zswap/parameters

/sys/module/zswap/parameters/same_filled_pages_enabled:Y
/sys/module/zswap/parameters/enabled:N
/sys/module/zswap/parameters/max_pool_percent:20
/sys/module/zswap/parameters/compressor:lzo
/sys/module/zswap/parameters/zpool:zbud
/sys/module/zswap/parameters/accept_threshold_percent:90

lsmod

z3fold                 32768  0
lz4                    16384  0
lz4_compress           36864  1 lz4
... etc

Why don't the modules/parameters get enabled?

2
  • 1
    Please be precise with details; 22 is a specialist flavor of Ubuntu 22.04 LTS Server, with the year format (22) instead of year.month (22.04) used to highlight the snap only product; yet you use both 22 & 22.04 which are different Ubuntu products. They are very similar yes, but have differences, so please be clear.
    – guiverc
    Commented Sep 4, 2022 at 22:54
  • I've fixed it mate Commented Sep 7, 2022 at 14:57

1 Answer 1

1

Check for a /etc/default/grub.ucf-dist file. If that exists, it may be overriding the /etc/default/grub file. Check what gets written into the /boot/grub/grub.cfg file (the kernel lines should have your zswap params).


The grub.ucf-dist file gets created when an update encounters a tailored version of grub.cfg. Probably best to reapply the changes to grub.cfg and remove the grub.ucf-dist so it can't be overridden (and lost).

1
  • /etc/default/grub.ucf-dist shows no zswap stuff nor does /boot/grub/grub.cfg so should I just add my GRUB_CMDLINE_LINUX_DEFAULT line to the /etc/default/grub.ucf-dist ? (as shown here:) GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=hidden GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR='lsb_release -i -s 2> /dev/null || echo Debian' GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="vga=normal nomodeset iommu=pt" Commented Sep 8, 2022 at 18:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .