Package Details: zramswap 5-1

Git Clone URL: https://aur.archlinux.org/zramswap.git (read-only, click to copy)
Package Base: zramswap
Description: Sets up zram-based swap devices on boot
Upstream URL: http://en.wikipedia.org/wiki/ZRam
Licenses: GPL
Submitter: Svenstaro
Maintainer: rpodgorny
Last Packager: rpodgorny
Votes: 230
Popularity: 1.55
First Submitted: 2011-10-05 23:35
Last Updated: 2019-12-20 16:58

Required by (0)

Sources (3)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 9 10 11 ... Next › Last »

swiftgeek commented on 2014-05-22 03:13

Do You even know about what AUR package You are commenting on?
http://pkgbuild.com/git/aur-mirror.git/tree/zramswap/zramctrl?id=eb801b8fd234cd615edcd5f4d7ab0b627f163c24
This happened to sit here for YEARS :< AFAIR it was provided by falconidy as part of bigger package of scripts for systemd in its early days, and few months later dropped to AUR
---
Zramswap is custom arch-specific script from eons ago. systemd-swap is mostly a clean rewrite of that with a new name that is more accurate than zramswap. Also new features and better config!

melodie commented on 2014-05-22 02:48

swiftgeek,

I have not been impolite to you so please treat me well too.

« This package doesn't provide anything beyond that script.»

So be it, and please don't feed me with "systemd-swap" telling me it's name is "zramswap". This is not right.


→ So would you want to have codes and references?

Some points to be sure you get it:
- replacing a program/feature by a new set of features **with the same name** is not the way to go: imho.

- I don't know what is wrong about using awk? The first scripts I was handed over to use compcache did use some awk commands too:
https://code.google.com/p/compcache/

The first scripts I used when I have pointed to the zram method many years ago, was a set of lines in a rc.local file. At this time it had been added to a distribution where people had never heard of it yet (around 2010). zRAM was not yet even a kernel module.

Why do you want me to read comments? I have gone to read the github page you pointed me to, I have discovered there that keenerd has added a patch not so long ago: last year during summer.

Code to read? Let's read code together will you? Here is the code from mystillef:
http://mystilleef.blogspot.fr/2011/10/enable-zram-in-fedora.html

other former codes:
http://bazaar.launchpad.net/~elementary-os/elementaryos/zramswap-enabler/view/head:/debian/zramswap.upstart

oh do you notice? No awk here! ;)

In Mystillef scripts there is one awk command : in the zramstop script (you can unpack the archive provided to check).

In the script I used back a few years ago before the first zram kernel module was delivered, there is a also one awk command, right in the second of these two lines:
***************

gprintf "Sizing zram swap device\n"

FREE_MEM=`free -t -m | egrep Mem | awk {'print $2'}`

***************

I was using a "awk" script?! I didn't even know it!

If I understand well the __real issue__ here would be that you have been the packager, and you don't want to maintain it anymore? Maybe someone else will want to continue maintaining it? So please don't hurry and don't throw the baby with the bath.

swiftgeek commented on 2014-05-22 02:15

@melodie WTF⁵⁰⁰
Script for this package used zram devices for swap and nothing else. End of story. This package doesn't provide anything beyond that script.
NOBODY brought anything more than idea (remember this was an »awk« script) and now new script with new name provides everything mentioned before and more!
And nobody is forcing anyone to use any particular swap technique - and that's a change from old script!
FFS please read comments, code (both! old and new), don't FUD etc.

melodie commented on 2014-05-22 01:31

Hi,

Other people might want to bring their idea about it before you decide?

For myself I know that zram is a kernel module which is originally part of the compcache project.

I also know that with _some_ configurations done in the _kernels_ it has sometimes brought freeze trouble in systems, or just hang during boot instead of being loaded, and this, until the specific configuration in the kernel was modified (I'll bring a link from an Ubuntu bug as example here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1246664 and the fix provided at this point of the discussion: comment #58), I say, just to make a point about this part: the zRAM kernel module is NOT the same as a swap file.

Else, the debate running about swapping methods and the different caches existing continues to run among people who work around the kernels and also among the people who perform benchmarks around these features.

What is wrong with the original zramswap script?

swiftgeek commented on 2014-05-22 00:12

If anynone would read the comments or checked aur's git would know that:
• zramswap is the old unmaintainable awk script that was going to be rewritten to bash since ever and systemd-swap IS that rewrite with changed name, author and maintainer (so it was good for me to be lazy, because this rewrite is much better than the one i would make)

• using zram for swap is mostly the same as using file for swap -.- just compressed and lives inside ram

• while it's possible to read what old script was doing, improving it isn't feasible - nobody since months and years even tried to do anything mayor with that script and every change made to it was painful and extremely time consuming
http://pkgbuild.com/git/aur-mirror.git/tree/zramswap/zramctrl?id=eb801b8fd234cd615edcd5f4d7ab0b627f163c24

Nefelim4ag commented on 2014-05-21 22:51

@melodie
You're like Sherlock ;)
I have conversation with old maintainer "Swift Geek", and i suggest to remove this package. He explained that can not leave people with orphaned package. And for find solution, we must find compromise.
This package it compromise, he leave orphan package, i adopt him. I notified people in comment and post_install.

Copy of comment:
Comment by Nefelim4ag

2014-05-21 13:12

From now, this is duplicate of https://aur.archlinux.org/packages/systemd-swap/ package, for not leave users with orphan package (zramswap).
Anybody, how read this, please install systemd-swap instead zramswap. Because zramswap is dead and be deleted from aur in few months.

melodie commented on 2014-05-21 22:45

PS: this page is not the right one:
https://aur.archlinux.org/packages/sy/systemd-swap/

this one is:
https://aur.archlinux.org/packages/systemd-swap/

melodie commented on 2014-05-21 22:44

PS: the page here does not exist:
https://aur.archlinux.org/packages/sy/systemd-swap/

but the page here does:
https://aur.archlinux.org/packages/sy/systemd-swap/PKGBUILD

:-|

melodie commented on 2014-05-21 22:39

Hi,

This package is NOT zramswap: I have just seen my aur package manager submit an update for the zramswap program I have been using for such a long time, and I have been very surprised to read the description in the PKGBUILD:
**********
pkgdesc="This is script for creating hybrid swap space from zram swaps, swap files and swap partitions. Swap file - auto create dinamic growing swap file and mount it via loop. For enable: sudo systemctl enable systemd-swap. Config in /etc/systemd-swap.cfg"

**********

Whereas the description for the zramswap (version 1.1.1) which is installed into my system is:

**********
"Description : Sets up zram-based swap devices on boot"

**********

I am not saying that your systemd-swap program is not good, I don't know it, but I DISAGREE STRONGLY about the process that consists in providing it as if it were zramswap ITSELF : this seems to me very close to dishonest. :-(

You program being also here:
https://aur.archlinux.org/packages/sy/systemd-swap/

and the PKGBUILD:
https://aur.archlinux.org/packages/sy/systemd-swap/PKGBUILD

shows this different between the *present* zramswap and the one *systemd-swap*:

diff =
< pkgname=zramswap
> pkgname=systemd-swap

Here is what the **zramswap** script installed here does and which works a treat as we can see:
******************
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda5 partition 4607996 0 -1
/dev/zram0 partition 506528 0 100
/dev/zram1 partition 506528 0 100


*******************


and here is the content of the script:
*******************
$ cat /usr/lib/systemd/scripts/zramctrl
#!/bin/sh


start() {
exec awk -v ZRAM_SIZE=$ZRAM_SIZE '

FILENAME == "/proc/cpuinfo" && ($1 == "processor" || $1 == "Processor") {
cpucount++
next
}

FILENAME == "/proc/meminfo" && $1 == "MemTotal:" {
if (ZRAM_SIZE == "")
ZRAM_SIZE = 20
mem_total = int( (0 + $2) * 1024 * ( ZRAM_SIZE/100 ) )
next
}

END {
mem_per_cpu = int(mem_total / cpucount)

system("modprobe zram num_devices=" cpucount)

for (i = 0; i < cpucount; i++) {
print mem_per_cpu > "/sys/block/zram" i "/disksize"
system("mkswap /dev/zram" i " -L zram" i)
swapdevs = swapdevs " /dev/zram" i
}

system("swapon -p 100" swapdevs)
}
' /proc/cpuinfo /proc/meminfo
}

stop() {
exec awk '
FNR > 1 && $1 ~ /^\/dev\/zram[0-9]+$/ {
activeswaps = activeswaps " " $1
}

END {
system("swapoff" activeswaps)
system("rmmod zram")
}
' /proc/swaps
}

case $1 in
start|stop) "$1" ;;
esac

***********

and it's start file:
***********

$ cat /usr/lib/systemd/scripts/zramctrl
#!/bin/sh


start() {
exec awk -v ZRAM_SIZE=$ZRAM_SIZE '

FILENAME == "/proc/cpuinfo" && ($1 == "processor" || $1 == "Processor") {
cpucount++
next
}

FILENAME == "/proc/meminfo" && $1 == "MemTotal:" {
if (ZRAM_SIZE == "")
ZRAM_SIZE = 20
mem_total = int( (0 + $2) * 1024 * ( ZRAM_SIZE/100 ) )
next
}

END {
mem_per_cpu = int(mem_total / cpucount)

system("modprobe zram num_devices=" cpucount)

for (i = 0; i < cpucount; i++) {
print mem_per_cpu > "/sys/block/zram" i "/disksize"
system("mkswap /dev/zram" i " -L zram" i)
swapdevs = swapdevs " /dev/zram" i
}

system("swapon -p 100" swapdevs)
}
' /proc/cpuinfo /proc/meminfo
}

stop() {
exec awk '
FNR > 1 && $1 ~ /^\/dev\/zram[0-9]+$/ {
activeswaps = activeswaps " " $1
}

END {
system("swapoff" activeswaps)
system("rmmod zram")
}
' /proc/swaps
}

case $1 in
start|stop) "$1" ;;
esac

************

I would like it to stay that way, until it is itself in need of an update for any technical reason and I don't see any reason to change now. No freeze, no issue of any kind, on a fully up to date system.

Please let systemd-swap be a new one and zramswap keep it's place!

Thanks.


gourdcaptain commented on 2014-05-21 21:59

I might also note that systemd-swap's a bit more general purpose script and they may want to disable the other components in the config file. (I'm a guy using the zram swap for a overpowered netbook with 8 GB of RAM and a tiny SSD as a security margin in case I somehow run out of RAM, but I don't want actual swap because I don't want the wear and tear on the SSD.