2

Condition: to activate zswap module in Ubuntu 16.04 successfully for Matlab/.... computation
Relevant part in /etc/default/grub

...
zswap.enabled=1              # NB only change here 
GRUB_CMDLINE_LINUX="" 
                             # NB also tried to have the line here unsuccessfully    
...

I try to activate zswap and run sudo update-grub

Searching for GRUB installation directory ... found: /boot/grub
/etc/default/grub: line 12: zswap.enabled=1: command not found

I also tried the code where zswap line is after GRUB_CMDLINE_LINUX="" unsuccessfully.

My current setting after heynnema's answer

  • Have the following in /etc/default/grub, which works unspecifically; dmesg | grep zswaps returns something

    # https://wiki.archlinux.org/index.php/Zswap
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lzo"
    
  • Run sudo update-grub.

Its effect on the maximum Ram?

There are some threads about it is saving some pages in the pool, etc zswap: How to determine whether it is compressing swap pages? However, there is no studies about its effect on the maximum Ram for the computaion.

System: Linux Ubuntu 16.04 64 bit Linux kernel: 4.6
Linux kernel options: wl
Matlab: 2016a
Hardware: Macbook Air 2013-mid
Related threads: How can I enable zswap?, Zswap Arch Linux, zswap: How to determine whether it is compressing swap pages?

1 Answers1

6

You put your zswap.enabled in the wrong place.

Change this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
zswap.enabled=1

To this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash zswap.enabled=1"

then sudo update-grub and reboot.

If it doesn't work, it may not be available/compatible with 16.04.

heemayl
  • 91,753
heynnema
  • 70,711