XenialDog 64bit (Ubuntu 'Xenial Xerus' LTS, 64-bit)

A home for all kinds of Puppy related projects
Message
Author
User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#301 Post by fredx181 »

The Flying Cat wrote:Is there a relatively painless way of installing another kernel? Or change kernel upgrade script to use another metapackage, say HWE from LTS releases or custom from PPA like liquorix? Maybe via integrating config files.
Was kinda curious about testing https://liquorix.net/, seems like it might be fast:)
Indeed, as stemsee wrote, the liquorix kernel will be problematic because it doesn't have aufs (porteus-boot needs it)
For testing, I just installed 4.14 kernel using "new-kernel" script, attached (NOT fake .gz, extract and run it) from here and works fine:
https://launchpad.net/~canonical-kernel ... hive-extra
Direct links to amd64 packages (you need also the linux-image-extra package (it contains aufs):
https://launchpad.net/~canonical-kernel ... _amd64.deb
https://launchpad.net/~canonical-kernel ... _amd64.deb
Just download the deb packages, run the new-kernel script and select them both (using yad file-selector).
You can also search for other linux-image .deb packages, but as said, the linux-image-extra-.....-generic... is required.

Fred
Attachments
new-kernel.tar.gz
Extract, run "new-kernel", and select .deb packages
(3.61 KiB) Downloaded 166 times

The Flying Cat
Posts: 40
Joined: Mon 10 Oct 2016, 12:23

#302 Post by The Flying Cat »

Yep, new 4.14.0-16 kernel as expected have first wave of meltdown/spectre patches

Code: Select all

root@live:~# cat /proc/cpuinfo | grep bugs
bugs		: cpu_meltdown
As an intel cpu owner I expected to get 0-10% performance drop (so liquorix could've been nice offset :P )
But so far I have seen none

Code: Select all

4.14.0-13
systemd-analyze
Startup finished in 5.495s (kernel) + 5.015s (userspace) = 10.510s
4.14.0-16
root@live:~# systemd-analyze
Startup finished in 5.263s (kernel) + 4.126s (userspace) = 9.390s
glmark2 also shows no performance drop, actually also small increase probably due better firmware (I heard they did a good job on opensource drivers)
I guess I'll fiddle a bit more with this

Forgot to mention: this is on Bionic Dog (really nice one btw)

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#303 Post by wiak »

backi wrote: Here are 2 scripts to enable or disable zram on Demand :

Enable :

#!/bin/bash
swapon /dev/zram0

Disable :

#!/bin/bash
swapoff /dev/zram0

Regards !
Hi backi,

Yes, its useful to be able to enable or disable the zram swap when wished. I should point out that sometimes there is more than one zram swap created. Possible it is one per cpu core. Certainly on my intel core II duo machine the swap automatically provided is combination of /dev/ram0 and /dev/ram1. One way of disabling both at once is simply to disable all swap with:

Code: Select all

swapoff -a
Cheers, wiak

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#304 Post by backi »

Hi wiak !
I should point out that sometimes there is more than one zram swap created. Possible it is one per cpu core.
Yes thats`s the case .

Just one observation ---swapoff -a also disables swap-partition .

Zram is a cool thing for low-ram machines !

Regards ! :)

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#305 Post by wiak »

backi wrote: Just one observation ---swapoff -a also disables swap-partition .
Yes, I don't use a swap partition. But if you have a swap partition also does the system 'know' to use zram first before using slow swap partition?

wiak

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#306 Post by fredx181 »

wiak wrote:But if you have a swap partition also does the system 'know' to use zram first before using slow swap partition?
You can set priority with the -p option, for example, I have swap partition sda6 and in /etc/rc.local:

Code: Select all

modprobe zram 

echo $((800*1024*1024)) > /sys/block/zram0/disksize    # 800MB size

mkswap /dev/zram0

swapon /dev/zram0 -p 1 # higher priority for zram
swapon /dev/sda6 -p 0
(this may be the old fashioned way to setup zram, I used to do it this way long time ago and just kept it)
Also for porteus-boot, you need to add noswap to the kernel boot line (since swapon is done from rc.local this way)

Fred

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#307 Post by backi »

Hi !
Yes, I don't use a swap partition. But if you have a swap partition also does the system 'know' to use zram first before using slow swap partition?
By observing Conky i came to the Conclusion that Zram will be used automatically first .But could be wrong .
One should also consider "Swappiness " to avoid premature swapping .
I think a good value would be 10 .
Here how to set Swappiness :
https://askubuntu.com/questions/103915/ ... swappiness

Regards !

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#308 Post by fredx181 »

backi wrote:One should also consider "Swappiness " to avoid premature swapping .
I think a good value would be 10
Sure. But most Dogs have it already by default, in /etc/sysctl.conf :

Code: Select all

vm.swappiness=10
For SSD disks I often read that it's recommended to set swappiness to 1

Fred

dancytron
Posts: 1519
Joined: Wed 18 Jul 2012, 19:20

#309 Post by dancytron »

This is the script I dug up off the internet to do zram. I modified it to use lz4.

Code: Select all

#!/bin/sh
### BEGIN INIT INFO - copied from https://wiki.debian.org/ZRam 
##"zramctl --raw" to check status.  usage "zram.sh start | stop"  See #120 from build_setup.txt.
#copied portion begins --
# Provides:          zram
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     S
# Default-Stop:      0 1 6
# Short-Description: Use compressed RAM as in-memory swap
# Description:       Use compressed RAM as in-memory swap
### END INIT INFO

# Author: Antonio Galea <antonio.galea@gmail.com>
# Thanks to Przemysław Tomczyk for suggesting swapoff parallelization
# Distributed under the GPL version 3 or above, see terms at
#      https://gnu.org/licenses/gpl-3.0.txt

FRACTION=75

MEMORY=`perl -ne'/^MemTotal:\s+(\d+)/ && print $1*1024;' < /proc/meminfo`
CPUS=`nproc`
SIZE=$(( MEMORY * FRACTION / 100 / CPUS ))

case "$1" in
  "start")
    param=`modinfo zram|grep num_devices|cut -f2 -d:|tr -d ' '`
    modprobe zram $param=$CPUS
    for n in `seq $CPUS`; do
      i=$((n - 1))
#next line added by dan 1-18-18 see #122.
      echo lz4 > /sys/block/zram$i/comp_algorithm
      echo $SIZE > /sys/block/zram$i/disksize
      mkswap /dev/zram$i
      swapon /dev/zram$i -p 10
    done
    ;;
  "stop")
    for n in `seq $CPUS`; do
      i=$((n - 1))
      swapoff /dev/zram$i && echo "disabled disk $n of $CPUS" &
    done
    wait
    sleep .5
    modprobe -r zram
    ;;
  *)
    echo "Usage: `basename $0` (start | stop)"
    exit 1
    ;;
esac
Then put it in /usr/local/bin as zram.sh and start zram with "zram.sh start" and stop it with "zram.sh stop."

This is what it does on mine:

Code: Select all

root@live:~/Desktop# ./zram.sh start
Setting up swapspace version 1, size = 1.1 GiB (1179811840 bytes)
no label, UUID=b9077645-1d5f-44ce-a6ea-de2xxxxxxxxxxxxxx
Setting up swapspace version 1, size = 1.1 GiB (1179811840 bytes)
no label, UUID=120b35f7-42c3-4718-9f2f-2xxxxxxxxxxxx

root@live:~/Desktop# zramctl
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4           1.1G   4K   64B    4K       2 [SWAP]
/dev/zram1 lz4           1.1G   4K   64B    4K       2 [SWAP]

root@live:~/Desktop# swapon -s
Filename				Type		Size	Used	Priority
/dev/sda3                              	partition	1430524	0	-1
/dev/zram0                             	partition	1152160	0	10
/dev/zram1                             	partition	1152160	0	10
I just added this a couple of days ago, so I haven't done anything to make it start automatically yet. Seems to work so far.

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#310 Post by backi »

Hi Dancytron !

Quite interesting .
Zram-config must be installed via Synaptic ?..... (I have )....It can be found in /etc/inid.d/zram .
I assume lz4 makes it work faster .
Put your script in /usr/local/bin .Seems working .
But when using " zram.sh start" in Terminal got somehow different output in Terminal than yours .Nevertheless it works .Zram is shown in Conky/Htop .
Does it somehow conflict with formerly installed zram-config Script?
Cool . :)

Regards !

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#311 Post by wiak »

After installing with zram-config I find that /sys/block/zram0/comp_algorithm is already using lz4 on my XenialDog64 system.

wiak

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#312 Post by backi »

Hi wiak !
I am using DebDog Xenial 32 bit .
Naive as i am ......just installing zram-config makes lz4 compression enabled by default ?........no need to use Dancytrons Script ?
How to find it out if my Machine is using lz4 (just zram-config installed )?
Which are the magic Words (command) to find out ?

Greetings from good ole cold and rainy Germany !

Hendrix: Still Rainin', Still Dreamin'
https://www.youtube.com/watch?v=b0E6fLJixUs

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#313 Post by backi »

Hi wiak !

Found out myself ( /sys/block/zram0/comp_algorithm )

Lassar
Posts: 235
Joined: Tue 08 Jul 2014, 20:01

Found out how to get icewm to work on XenialDog

#314 Post by Lassar »

Icewm-xdgmenu needs a version 2 of a library, where as
zenaial dog has a version 3 of the library.

I tried copying the version 2 of the library over to zenialdog, and
it worked.

I guess I could use one the python scripts that does the same
thing.

Or someone could recompile icewm-xdgmenu to use version 3
of the library.

Where does one get the icewm-xdgmenu source code?

dancytron
Posts: 1519
Joined: Wed 18 Jul 2012, 19:20

#315 Post by dancytron »

backi wrote:Hi wiak !

Found out myself ( /sys/block/zram0/comp_algorithm )
"zramctl" will give you a status summary. Also, "swapon -s".

Code: Select all

root@live:~/Desktop# zramctl
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4           1.1G   4K   64B    4K       2 [SWAP]
/dev/zram1 lz4           1.1G   4K   64B    4K       2 [SWAP]

root@live:~/Desktop# swapon -s
Filename            Type      Size   Used   Priority
/dev/sda3                                 partition   1430524   0   -1
/dev/zram0                                partition   1152160   0   10
/dev/zram1                                partition   1152160   0   10

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#316 Post by wiak »

Oh, thanks dancytron, I just tried zramctl and it seems my system is actually just using lzo. Just reading the algorithm variable just said "[lzo] lz4"; I thought that meant lz4 was being used but zramctl suggests otherwise... So maybe I have to use that script you provided to fix that - but I'd rather somehow use zram-config; is there a simple way to make sure it uses lz4 that you know of?

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#317 Post by wiak »

Oh, thanks dancytron, I just tried zramctl and it seems my system is actually just using lzo. Just reading the algorithm variable just said "[lzo] lz4"; I thought that meant lz4 was being used but zramctl suggests otherwise... So maybe I have to use that script you provided to fix that - but I'd rather somehow use zram-config; is there a simple way to make sure it uses lz4 that you know of?

EDIT: Well that script you found seems to work anyway, but I'd still like zram-config method to work with lz4 out of the box - should surely be possible? (I don't want to also have to run the separate zram.sh script). I should study the scripts (zram.sh and also whatever is provided by zram-config, I suppose..., which may just be a matter of learning how to use that zramctl utility).

EDIT2: I tried:

Code: Select all

swapoff -a
zramctl -r /dev/zram0
zramctl -a lz4 -s 512M /dev/ram0
swapon /dev/zram0
But got error: swapon: /dev/zram0: read swap header failed

Not sure about the 512M or alternatively just tried 512000, but still get same error message. Clearly the answer will be in that script you found that I haven't studied yet...

okay, seems I had to again modprobe zram as in the zram.sh script and insert a mkswap command as also in that script - seems to be easier to use the script thus far, but I suspect there must be a startup script used by whatever comes with zram-config that could be modded to immediately provide lz4 rather than lzo, but I don't know how as yet. Any light shined on this would be appreciated.

wiak
Last edited by wiak on Sun 21 Jan 2018, 10:22, edited 1 time in total.

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#318 Post by backi »

Hi everyone !

Let me try to explain what i observed .

Let me do it Step by Step .

Have a Swap-Partition on Harddrive .
I have installed zram-config via Synaptic .
Zram is automatically activated on Bootup.Also Swap-partition.

Installed (additionally) dancytrons Script in /usr/local/bin (made it executable )
Now my Observation .

After booting in Xenial Dog 32 Bit i disable Swap-Partition and disable(automaticallyl enabled Zram manually.
So Conky shows no Swap (zero) .

1. Enabling Zram with zram.sh start now shows 496 MiB Swap Space .
2. Disabling Zram with zram.sh stop now shows 0 MiB (Zero) Swap Space
3. Enabling Zram zram.sh start AGAIN now shows 744 MiB Swap Space ("almost" Double )

So what i mean :
BEFORE just using only zram-config installed with Synaptics ,it created a 496 Mib Swap-Space .
AFTER installing Dancytrons Script (additionally ) and executing Procedure above 1. 2. and 3.
Swap space increased to 744 MiB Swap Space .

Do not have any Idea what it means .Maybe the "NEW" Script is taking over /dominating the "OLD" one ?Who knows ?
Maybe somebody else will get a clue from that .

Regards !
Last edited by backi on Sun 21 Jan 2018, 12:12, edited 1 time in total.

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#319 Post by backi »

Hi you guys !

https://wiki.debian.org/ZRam

The script which Dancytron posted .....i use it in DEBIAN DOGS since the Beginning .
Works flawless in Debian .Did not know it could work flawless in Ubuntu .......does it really ??????

Is Debian Dog (Stretch ,Jessie ) able to use lz4 ???Seems so if .....liblz4-tool is installed .
liblz4-tool is not installed by default .l

Xenial Dog there is also no liblz4-tool installed by default.


Searching Google for Zram lz4 compression found an interesting link :
https://starbeamrainbowlabs.com/blog/ar ... -zram.html

Some Thoughts on Zram and lz4 on the MX-Linux Forum :

https://mxlinux.org/forum/viewtopic.php?f=108&t=42935


Regards !
Last edited by backi on Sun 21 Jan 2018, 13:46, edited 2 times in total.

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#320 Post by backi »

To open another Can of Worms :

Enable ZSwap to increase performance :

https://ubuntu-mate.community/t/enable- ... ance/11302
https://wiki.archlinux.org/index.php/Zswap


Should a separate Topic called "Using Zram----Zswap " be created ?

Post Reply