You are not logged in.

#1 2025-07-11 22:18

Durhammer
Member
Registered: 2025-01-28
Posts: 211

How to enable zswap in Q4OS? [SOLVED, see page #20]

I dunno what's the issue -- I have "zswap.enabled=1" in /etc/default/grub but it doesn't enable zswap, according to:

$ cat  /sys/module/zswap/parameters/enabled
N

So what's the holdup?

FWIW, here's my setup:

$ inxi -Fzxxxdba
System:
  Kernel: 6.15.3-1-liquorix-amd64 arch: x86_64 bits: 64 compiler: gcc
    v: 12.2.0 parameters: audit=0 intel_pstate=disable amd_pstate=disable
    BOOT_IMAGE=/boot/vmlinuz-6.15.3-1-liquorix-amd64
    root=UUID=d0f0957b-4e3e-4776-b96a-20cad82e656b ro vt.cur_default=1
    systemd.log_level=0 rd.systemd.show_status=false systemd.show_status=0
    rd.udev.log_level=0 loglevel=0 splash fbcon=nodefer drm.vblankoffdelay=1
    modprobe.blacklist=iTCO_wdt
  Desktop: JWM v: 2.4.4 info: tint2 vt: 7 dm: LightDM v: 1.26.0
    Distro: Q4OS 5.8.1-n1 base: Debian GNU/Linux 12 (bookworm)
Machine:
  Type: Laptop System: SAMSUNG product: RF511/RF411/RF711 v: 10HX
    serial: <superuser required> Chassis: type: 9 serial: <superuser required>
  Mobo: SAMSUNG model: RF511/RF411/RF711 v: 10HX
    serial: <superuser required> BIOS: American Megatrends
    v: 10HX.M034.20110426.SSH date: 04/26/2011
Battery:
  ID-1: BAT1 charge: 35.1 Wh (79.1%) condition: 44.4/48.8 Wh (90.9%)
    volts: 10.8 min: 11.1 model: SAMSUNG Electronics type: Li-ion serial: N/A
    status: not charging
  Device-1: hidpp_battery_0 model: Logitech ERGO M575 Trackball
    serial: <filter> charge: 80% rechargeable: yes status: discharging
CPU:
  Info: model: Intel Core i7-2630QM bits: 64 type: MT MCP arch: Sandy Bridge
    gen: core 2 level: v2 built: 2010-12 process: Intel 32nm family: 6
    model-id: 0x2A (42) stepping: 7 microcode: 0x2F
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 837 high: 900 min/max: 800/2001 boost: disabled scaling:
    driver: acpi-cpufreq governor: ondemand cores: 1: 892 2: 819 3: 886 4: 900
    5: 800 6: 800 7: 800 8: 800 bogomips: 31926
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: ghostwrite status: Not affected
  Type: indirect_target_selection status: Not affected
  Type: itlb_multihit status: KVM: Split huge pages
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
    vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: old_microcode status: Not affected
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW;
    STIBP: conditional; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not
    affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
    vendor: Samsung Co driver: i915 v: kernel arch: Gen-6 code: Sandybridge
    process: Intel 32nm built: 2011 ports: active: LVDS-1,VGA-1
    empty: DP-1,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:0116 class-ID: 0300
  Device-2: NVIDIA GF108M [GeForce GT 540M] vendor: Samsung Co driver: N/A
    alternate: nouveau non-free: series: 390.xx+ status: legacy-active
    (EOL~late 2022) arch: Fermi code: GF1xx process: 40/28nm built: 2010-16
    pcie: speed: Unknown lanes: 63 link-max: gen: 2 speed: 5 GT/s
    bus-ID: 01:00.0 chip-ID: 10de:0df4 class-ID: 0302
  Device-3: Silicon Motion WebCam SCB-1100N type: USB driver: uvcvideo
    bus-ID: 4-1.1:3 chip-ID: 2232:1008 class-ID: 0e02
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: crocus gpu: i915
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1600x2820 s-dpi: 96 s-size: 422x744mm (16.61x29.29")
    s-diag: 855mm (33.68")
  Monitor-1: LVDS-1 pos: primary,bottom model: ChiMei InnoLux 0x1733
    built: 2012 res: 1600x900 hz: 60 dpi: 106 gamma: 1.2
    size: 382x215mm (15.04x8.46") diag: 448mm (17.6") ratio: 16:9
    modes: 1600x900
  Monitor-2: VGA-1 pos: top model: Dell P2214H serial: <filter> built: 2015
    res: 1080x1920 hz: 60 dpi: 102 gamma: 1.2 size: 268x477mm (10.55x18.78")
    diag: 547mm (21.5") ratio: 16:9 modes: max: 1920x1080 min: 720x400
  API: OpenGL v: 3.3 Mesa 22.3.6 renderer: Mesa Intel HD Graphics 3000 (SNB
    GT2) direct-render: Yes
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio
    vendor: Samsung Co 6 driver: snd_hda_intel v: kernel bus-ID: 2-1:2
    bus-ID: 00:1b.0 chip-ID: 8087:1024 chip-ID: 8086:1c20 class-ID: 0300
    serial: <filter> class-ID: 0403
  Device-2: NVIDIA GF108 High Definition Audio driver: snd_hda_intel
    v: kernel pcie: speed: Unknown lanes: 63 link-max: gen: 2 speed: 5 GT/s
    bus-ID: 01:00.1 chip-ID: 10de:0bea class-ID: 0403
  Device-3: Intel USB2.0 Device type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Device-4: AKAI MPKmini2 type: USB driver: hid-generic,snd-usb-audio,usbhid
    bus-ID: 2-2.2:4 chip-ID: 2011:0715 class-ID: 0103 serial: <filter>
  API: ALSA v: k6.15.3-1-liquorix-amd64 status: kernel-api
    tools: alsamixer,amixer
  Server-1: PulseAudio v: 16.1 status: active tools: pacat,pactl
Network:
  Device-1: Broadcom BCM4313 802.11bgn Wireless Network Adapter vendor: Askey
    driver: bcma-pci-bridge v: N/A modules: bcma pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 bus-ID: 02:00.0 chip-ID: 14e4:4727 class-ID: 0280
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Samsung Co RTL8111/8168/8211/8411 driver: r8169 v: kernel pcie:
    gen: 1 speed: 2.5 GT/s lanes: 1 port: b000 bus-ID: 03:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: down mac: <filter>
  IF-ID-1: wlp2s0b1 state: up mac: <filter>
Drives:
  Local Storage: total: 2.96 TiB used: 211.25 GiB (7.0%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 2B6Q scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 type: USB vendor: Seagate model: BUP Slim BK
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B type: N/A
    serial: <filter> rev: 0109
  ID-3: /dev/sdc maj-min: 8:32 type: USB vendor: Sabrent model: SABRENT
    size: 238.47 GiB block-size: physical: 4096 B logical: 512 B type: N/A
    serial: <filter> rev: 0204 scheme: GPT
  Optical-1: /dev/sr0 vendor: Optiarc model: DVD RW AD-7717H rev: 1.X0
    dev-links: cdrom
  Features: speed: 16 multisession: yes audio: yes dvd: yes
    rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition:
  ID-1: / raw-size: 244.89 GiB size: 239.98 GiB (98.00%)
    used: 38.67 GiB (16.1%) fs: ext4 dev: /dev/sda7 maj-min: 8:7
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 12 GiB used: 0 KiB (0.0%) priority: -2
    file: /swapfile
Sensors:
  System Temperatures: cpu: 53.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 251 Uptime: 23m wakeups: 3 Memory: 7.68 GiB
  used: 2.12 GiB (27.6%) Init: systemd v: 252 target: graphical (5)
  default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Packages: 2796 pm: dpkg pkgs: 2781 libs: 1473 tools: apt,apt-get,synaptic
  pm: flatpak pkgs: 15 Shell: Bash v: 5.2.15 running-in: lxterminal
  inxi: 3.3.26

Last edited by Durhammer (2025-07-23 21:07)

Offline

#2 2025-07-12 09:57

josek
Member
Registered: 2025-02-23
Posts: 75

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Do you have the zswap modules loaded in initramfs?
What do you use? lz4 or zstd?

Offline

#3 2025-07-14 17:40

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

josek wrote:

Do you have the zswap modules loaded in initramfs?
What do you use? lz4 or zstd?

Dunno about zswap modules in initramfs. How do I check that? Meanwhile, this is what is set in zswap parameters:

$ cat  /sys/module/zswap/parameters/*
90
lz4
N
20
Y
zsmalloc

Interestingly enough, those are not what's in the kernel paarameters in grub, at least as far as I see:

zswap.enabled=1 zswap.compressor=zstd zswap.zpool=z3fold

Obviously, I've forgotten when and where I set the parms!

Offline

#4 2025-07-14 22:44

josek
Member
Registered: 2025-02-23
Posts: 75

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Since you already have zswap.enabled=1 according to inxi, you only need to add zswap.compressor=zstd and zswap.zpool=z3fold if they aren't already. The order doesn't usually matter
Save changes and exit nano (Ctrl+O, Enter, Ctrl+X)

Step 2: Include Zswap Modules in Initramfs

This is the most likely step to fix the problem with zswap not being enabled or not using the correct parameters. We need to tell the system to load zswap and the specific modules (zstd for the compressor and z3fold for the zpool) during the initramfs phase.

Edit /etc/initramfs-tools/modules:
Open the file with a text editor with root privileges:

Bash

sudo nano /etc/initramfs-tools/modules
Add the lines:
At the end of the file, add the following lines (each on a new line):

zswap
zstd
z3fold
zswap: The main module.

zstd: The compression algorithm you want to use (if you want lz4, use lz4 instead).

z3fold: The zpool (memory allocator) you want to use (if you want zsmalloc, use zsmalloc instead).

Save changes and exit nano (Ctrl+O, Enter, Ctrl+X).

Update Initramfs:
This step is critical. It will rebuild the initramfs images to include the modules you just specified.

Bash

sudo update-initramfs -u -k all
-u: Updates the initramfs for the current kernel.

-k all: Ensures the images for all installed kernels are updated (useful if you have multiple kernels, such as Liquorix and the standard Debian kernel).

Step 3: Reboot the System

Step 4: Verify that Zswap is Enabled and with the Correct Parameters

Offline

#5 2025-07-15 15:30

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Thanks, @josek !! I'll give it a try. I'll actually try setting zsmalloc in grub, and not z3fold (the former has seemed better on other distros). Probably also keep zstd there as well, for same reasons. Thanks again!

Offline

#6 2025-07-19 15:09

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Thanks again, @josek. Turns out the only thing I didn't already have in /etc/initramfs-tools/modules was the line with zswap itself. I added that, ran the update command and rebooted, but nothing changed. Strange....

Any other ideas? Anyone?

Offline

#7 2025-07-19 19:14

josek
Member
Registered: 2025-02-23
Posts: 75

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Run this command and copy it here:
lsmod | grep zswap

If the Zswap module is loaded, you should see a line like zswap followed by numbers. If you don't see anything, the module isn't loading.

this command too
dmesg | grep zswap

and finally this
grep -R . /sys/module/zswap/parameters

Last edited by josek (2025-07-19 19:22)

Offline

#8 2025-07-19 21:09

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Thanks again @josek -- there's no output from either of those commands, so no real need to post. The lsmod output is:

$ grep -R . /sys/module/zswap/parameters
/sys/module/zswap/parameters/enabled:N
/sys/module/zswap/parameters/shrinker_enabled:Y
/sys/module/zswap/parameters/max_pool_percent:20
/sys/module/zswap/parameters/compressor:lz4
/sys/module/zswap/parameters/zpool:zsmalloc
/sys/module/zswap/parameters/accept_threshold_percent:90

What does this all tell you? Thanks a bunch for your insight!

Offline

#9 2025-07-19 21:17

josek
Member
Registered: 2025-02-23
Posts: 75

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Can you show me your grub output?

Offline

#10 2025-07-20 02:00

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

josek wrote:

Can you show me your grub output?

You mean, as in the output from running the update-grub command, or something else?

Offline

#11 2025-07-20 06:53

josek
Member
Registered: 2025-02-23
Posts: 75

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

no, I wanted to see how you have it configured...
This would be the command:
cat /etc/default/grub

To avoid having to modify anything and just show you the contents of the configuration file,

copy and paste to see what's missing

Last edited by josek (2025-07-20 06:58)

Offline

#12 2025-07-20 15:07

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Here you go, @josek:

~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="1"
GRUB_DISTRIBUTOR="Q4OS Desktop `get-q4os-version | awk -F '.' '{ print $1"."$2 }'` 'Aquarius'"
GRUB_CMDLINE_LINUX_DEFAULT="vt.cur_default=1 systemd.log_level=0 rd.systemd.show_status=false systemd.show_status=0 rd.udev.log_level=0 loglevel=0 splash fbcon=nodefer drm.vblankoffdelay=1 modprobe.blacklist=iTCO_wdt 
split_lock_detect=off video=SVIDEO-1:d preempt=full pci=noaer 
page_alloc.shuffle=1 debugfs=off module.sig_unenforce apparmor=0 ipv6.disable=1 
mitigations=off audit=0 tsc=reliable no_timer_check random.trust_cpu=1 
cryptomgr.notests nomce nowatchdog fsck.mode=skip vt.cur_default=1 
systemd.log_level=0 rd.systemd.show_status=false rd.udev.log_level=0 splash 
fbcon=nodefer quiet loglevel=0 systemd.log_color=0 systemd.show_status=0 
zswap.enabled=1 zswap.compressor=lz4 zswap.zpool=zsmalloc"
GRUB_CMDLINE_LINUX=""

# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
GRUB_DISABLE_OS_PROBER=false

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL="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="1920x1080,1366x768,1024x768,auto"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

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

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

# Uncomment to disable uefi setup
#GRUB_DISABLE_UEFIFW=true

# Background image
GRUB_BACKGROUND="/usr/share/grub/themes/q4os_seb/background.png"

# Theme
GRUB_THEME="/usr/share/grub/themes/q4os_seb/theme.txt"
GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"

Offline

#13 2025-07-20 16:26

josek
Member
Registered: 2025-02-23
Posts: 75

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

How strange, I don't see any syntax errors.

Although it is extremely unlikely for a modern kernel, especially on Q4OS 5, it is worth confirming that the kernel Durhammer is using actually has the zswap module compiled in.
Please run this command:
Bash

sudo modinfo zswap

Then, check again with cat /sys/module/zswap/parameters/enabled. If this works, the problem is definitely with how GRUB is loading parameters at startup
Durhammer re-checks the entire GRUB_CMDLINE_LINUX_DEFAULT line in your /etc/default/grub file and passes it to us exactly as is. Often, the devil is in the small details of the syntax.

Offline

#14 2025-07-20 16:49

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 5,125
Website

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

You also need to run command:
$ sudo update-grub

Offline

#15 2025-07-21 14:51

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Thanks, @josek and @q4osteam . Here's the output from the commands. Pretty sure I've done the update-grub previously but maybe nth time is the trick!

$ sudo modinfo zswap
modinfo: ERROR: Module zswap not found.

$ sudo update-grub
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/q4os_seb/theme.txt
Found background image: /usr/share/grub/themes/q4os_seb/background.png
Found linux image: /boot/vmlinuz-6.15.7-1-liquorix-amd64
Found initrd image: /boot/initrd.img-6.15.7-1-liquorix-amd64
Found linux image: /boot/vmlinuz-6.15.6-1-liquorix-amd64
Found initrd image: /boot/initrd.img-6.15.6-1-liquorix-amd64
Found linux image: /boot/vmlinuz-6.15.3-1-liquorix-amd64
Found initrd image: /boot/initrd.img-6.15.3-1-liquorix-amd64
Found linux image: /boot/vmlinuz-6.12.30+bpo-amd64
Found initrd image: /boot/initrd.img-6.12.30+bpo-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found antiX (23.1) on /dev/sda2
Found MX 23.6 Libretto (23.6) on /dev/sda6
Found SparkyLinux (7.8) on /dev/sda8
Found MX 23.6 Libretto (23.6) on /dev/sdb3
done
Suppressing operating system & ramdisk loading messages.
Completed.

~$ cat /sys/module/zswap/parameters/enabled
N

EDIT: Oh yeah, and for good measure:

~$ cat  /etc/initramfs-tools/modules
# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax:  module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod
zswap
zstd
zstd_compress
zsmalloc
z3fold

AND:

~$ sudo update-initramfs -c -k all
update-initramfs: Generating /boot/initrd.img-6.12.30+bpo-amd64
update-initramfs: Generating /boot/initrd.img-6.15.3-1-liquorix-amd64
W: Possible missing firmware /lib/firmware/i915/xe3lpd_dmc.bin for module i915
update-initramfs: Generating /boot/initrd.img-6.15.6-1-liquorix-amd64
W: Possible missing firmware /lib/firmware/i915/xe3lpd_dmc.bin for module i915
update-initramfs: Generating /boot/initrd.img-6.15.7-1-liquorix-amd64
W: Possible missing firmware /lib/firmware/i915/xe3lpd_dmc.bin for module i915

Gonna reboot now.

Last edited by Durhammer (2025-07-21 14:56)

Offline

#16 2025-07-21 15:00

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

So did all that, rebooted. Sigh....

$ cat /sys/module/zswap/parameters/enabled
N

More suggestions? As Lowell George wrote and sang, "I'm Willin'"....

Offline

#17 2025-07-22 09:18

josek
Member
Registered: 2025-02-23
Posts: 75

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

The command you provided, sudo modinfo zswap, and its output:

------------>>modinfo: ERROR: Module zswap not found <<-----
This tells us something definitive:

---------------->> The zswap module is NOT present or compiled in the kernel (or at least, in the kernels modinfo is looking for). <<--------

What does this mean?
It means that no matter how many times you add zswap.enabled=1 to your GRUB or run sudo update-grub, Zswap will never be activated because the underlying functionality doesn't exist in the kernel itself. It's like trying to turn on a light bulb that isn't screwed into the socket.

Check Available Kernels:
Your sudo update-grub output shows that you have several Liquorix kernels installed:

vmlinuz-6.15.7-1-liquorix-amd64

vmlinuz-6.15.6-1-liquorix-amd64

vmlinuz-6.15.3-1-liquorix-amd64

vmlinuz-6.12.30+bpo-amd64 (This is a standard Debian backports kernel, not a Liquorix kernel.)

It's possible that one of those kernels (perhaps 6.12.30+bpo-amd64 or an older version of Liquorix) does have Zswap. Ideally, I would try booting with each of them and, after rebooting, run cat /sys/module/zswap/parameters/enabled to see if any of them show Y. However, it's strange that Liquorix doesn't include it, which brings me to the next option.

Install a Different Kernel (or Reinstall Liquorix):

Compiling a Custom Kernel:
This is the most advanced and time-consuming option. It involves downloading the kernel source code, configuring it to include Zswap (by searching for the CONFIG_ZSWAP=y option in the configuration file), and compiling it. This is only possible if you can't find any other precompiled alternatives.

Let me know if you need help with the kernel

Last edited by josek (2025-07-22 09:20)

Offline

#18 2025-07-23 20:06

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Thanks, @josek!

Not sure where the third Liquorix kernel appeared, but it's not in the /boot/grub/grub.cfg file, so when I boot, I only have the options for the 6.15.7 and the 6.15.6 versions (though none of the entries in the menu show anything but "Q4OS Desktop 5.8" (maybe with "Aquarius" but nothing else).

I did boot into the 6.15.6 version, and it likewise does not have zswap enabled.  Most curious!

I'll have to mull things over. I mean, the system is working just fine without it, I suppose, but it's always nice to have a purported enhancement working!

Offline

#19 2025-07-23 20:18

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

Okay, update. I was able to sucessfully enable zswap, but ONLY by doing this command:

# echo 1 > /sys/module/zswap/parameters/enabled

...which had to be done by running sudo su.

Info from an Arch distro article about zswap showed to use this command, and it's kinda damning:

$ zgrep CONFIG_ZSWAP_DEFAULT_ON /proc/config.gz
# CONFIG_ZSWAP_DEFAULT_ON is not set

This output is the same, I presume representing static defaults, not whether or not zswap has been enabled by command.

So MAYBE I can enable zswap by adding the above command to a reboot time cron job. I'll give that a try and report back.

EDIT: AAAARRRRGGGGHHHHH....  No, no, no. Root @reboot crontab entry does not enable zswap, though the command entered as described above DOES work. So what does it take to put it into effect? This is nuts!

Also, this is what I get when I try just using sudo to enable zswap:

sudo /usr/bin/echo 1 > /sys/module/zswap/parameters/enabled
bash: /sys/module/zswap/parameters/enabled: Permission denied

Last edited by Durhammer (2025-07-23 20:32)

Offline

#20 2025-07-23 21:06

Durhammer
Member
Registered: 2025-01-28
Posts: 211

Re: How to enable zswap in Q4OS? [SOLVED, see page #20]

SUCCESS!!!

THIS is what it took to work -- created a new file, /etc/tmpfiles.d/zswap.conf that contains:

w /sys/module/zswap/parameters/max_pool_percent - - - - 25
w /sys/module/zswap/parameters/compressor - - - - zstd
w /sys/module/zswap/parameters/zpool - - - - zsmalloc
w /sys/module/zswap/parameters/enabled - - - - 1

Rebooted, and now I get:

$ cat /sys/module/zswap/parameters/enabled
Y
$ sudo dmesg | grep zswap
[    5.662076] zswap: loaded using pool zstd/zsmalloc

Thanks for all your help, @josek and @q4osteam . I can solve this puppy now.

Offline

Board footer

Powered by FluxBB