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?

Léo Léopold Hertz 준영
  • 4,617
  • 20
  • 77
  • 153

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
  • 90,425
  • 20
  • 200
  • 267
heynnema
  • 68,647
  • 15
  • 124
  • 180
  • How can you show that this activates `zswap`? The command `lsmod | grep zswap` gives blank. Command `swapon` also does not show anything about `zswap`. – Léo Léopold Hertz 준영 Jul 25 '16 at 18:40
  • Command `dmesg | grep zswap` gives `[ 2.867664] zswap: loaded using pool lzo/zbud` once. However, it does not tell me what is the effect of `zswap`. Can you evaluate its effect better? – Léo Léopold Hertz 준영 Jul 25 '16 at 19:04
  • Google "zswap" to understand more about how it works. I just wanted to tell you how to enable it correctly. I've never used it. Cheers, Al – heynnema Jul 25 '16 at 20:38
  • @Masi this page on zswap is excellent https://wiki.archlinux.org/index.php/Zswap – Alex Jones Jul 28 '16 at 12:33