Hi
currently you need to remove the zram module because it's autoloaded in case you want to use the zram num_devices-param
maybe it should not be autoloaded implicitly
/usr/sbin/rmmod zram 2> /dev/null > /dev/null /usr/sbin/modprobe -q zram num_devices=$num_cpus 2> /dev/null > /dev/nul ______________________________________
[root@testserver:~]$ cat /usr/sbin/zramstart #!/usr/bin/bash
num_cpus=$(grep -c processor /proc/cpuinfo) [ "$num_cpus" != 0 ] || num_cpus=1
last_cpu=$((num_cpus - 1)) FACTOR=20 [ -f /etc/sysconfig/zram ] && source /etc/sysconfig/zram || true factor=$FACTOR
memtotal=$(grep MemTotal /proc/meminfo | awk ' { print $2 } ') mem_by_cpu=$(($memtotal/$num_cpus*$factor/100*1024))
/usr/sbin/rmmod zram 2> /dev/null > /dev/null /usr/sbin/modprobe -q zram num_devices=$num_cpus 2> /dev/null > /dev/null
for i in $(seq 0 $last_cpu); do echo $mem_by_cpu > /sys/block/zram$i/disksize /usr/sbin/mkswap /dev/zram$i /usr/sbin/swapon -p 100 /dev/zram$i
done
On Tue, Apr 22, 2014 at 8:25 AM, Reindl Harald h.reindl@thelounge.net wrote:
Hi
currently you need to remove the zram module because it's autoloaded in case you want to use the zram num_devices-param
maybe it should not be autoloaded implicitly
I don't have any machine that has zram autoloaded. There's something on your system that is telling something to load the zram module. It won't load without something explicitly loading it.
/usr/sbin/rmmod zram 2> /dev/null > /dev/null /usr/sbin/modprobe -q zram num_devices=$num_cpus 2> /dev/null > /dev/nul ______________________________________
[root@testserver:~]$ cat /usr/sbin/zramstart #!/usr/bin/bash
num_cpus=$(grep -c processor /proc/cpuinfo) [ "$num_cpus" != 0 ] || num_cpus=1
last_cpu=$((num_cpus - 1)) FACTOR=20 [ -f /etc/sysconfig/zram ] && source /etc/sysconfig/zram || true factor=$FACTOR
memtotal=$(grep MemTotal /proc/meminfo | awk ' { print $2 } ') mem_by_cpu=$(($memtotal/$num_cpus*$factor/100*1024))
/usr/sbin/rmmod zram 2> /dev/null > /dev/null /usr/sbin/modprobe -q zram num_devices=$num_cpus 2> /dev/null > /dev/null
for i in $(seq 0 $last_cpu); do echo $mem_by_cpu > /sys/block/zram$i/disksize /usr/sbin/mkswap /dev/zram$i /usr/sbin/swapon -p 100 /dev/zram$i
done
I have no idea what this script is, or why it's removing the zram module like that. It doesn't appear packaged in Fedora, so I can't really tell you where to report your issue but this isn't a kernel problem that I can see...
josh
interesting, i have that behavior on a Rawhide VM with no services except sshd which explains the systemd device-unit from my mail some time ago
for now blacklist it and load it later with the zram.service works fine [root@buildserver:~]$ cat /etc/modprobe.d/disable-zram.conf blacklist zram
-------- Original-Nachricht -------- Betreff: does zram in fedora need any configuration Datum: Thu, 27 Mar 2014 17:18:09 +0100 Von: Reindl Harald h.reindl@thelounge.net Organisation: the lounge interactive design An: Mailing-List fedora-kernel kernel@lists.fedoraproject.org
Hi
since 3.14 is not that far away zram becomes interesting
the article below maybe outdated, on a rawhide-VM exists /dev/zram0 as well as a implicit systemd-unit, well does that mean it is automagically configured and if that is the case does systemd < 212 that also or is there handwork needed for the time F19/F20 get rebased to kernel 3.14?
[root@rawhide ~]# systemctl list-units | grep zram sys-devices-virtual-block-zram0.device loaded active plugged /sys/devices/virtual/block/zram0 ________________________________________________
Am 22.04.2014 14:38, schrieb Josh Boyer:
On Tue, Apr 22, 2014 at 8:25 AM, Reindl Harald h.reindl@thelounge.net wrote:
currently you need to remove the zram module because it's autoloaded in case you want to use the zram num_devices-param
maybe it should not be autoloaded implicitly
I don't have any machine that has zram autoloaded. There's something on your system that is telling something to load the zram module. It won't load without something explicitly loading it.
/usr/sbin/rmmod zram 2> /dev/null > /dev/null /usr/sbin/modprobe -q zram num_devices=$num_cpus 2> /dev/null > /dev/nul ______________________________________
[root@testserver:~]$ cat /usr/sbin/zramstart #!/usr/bin/bash
num_cpus=$(grep -c processor /proc/cpuinfo) [ "$num_cpus" != 0 ] || num_cpus=1
last_cpu=$((num_cpus - 1)) FACTOR=20 [ -f /etc/sysconfig/zram ] && source /etc/sysconfig/zram || true factor=$FACTOR
memtotal=$(grep MemTotal /proc/meminfo | awk ' { print $2 } ') mem_by_cpu=$(($memtotal/$num_cpus*$factor/100*1024))
/usr/sbin/rmmod zram 2> /dev/null > /dev/null /usr/sbin/modprobe -q zram num_devices=$num_cpus 2> /dev/null > /dev/null
for i in $(seq 0 $last_cpu); do echo $mem_by_cpu > /sys/block/zram$i/disksize /usr/sbin/mkswap /dev/zram$i /usr/sbin/swapon -p 100 /dev/zram$i
done
I have no idea what this script is, or why it's removing the zram module like that. It doesn't appear packaged in Fedora, so I can't really tell you where to report your issue but this isn't a kernel problem that I can see...
On Tue, Apr 22, 2014 at 8:46 AM, Reindl Harald h.reindl@thelounge.net wrote:
interesting, i have that behavior on a Rawhide VM with no services except sshd which explains the systemd device-unit from my mail some time ago
Yeah, you answered your own question on that thread, so I didn't look into it. Reading back, it seems you installed some zram-1.0.0 RPM that isn't in the Fedora repos. That seems to be what is providing all the various zram related items in your VM, because zram.service doesn't exist anywhere else.
josh
Am 22.04.2014 14:55, schrieb Josh Boyer:
On Tue, Apr 22, 2014 at 8:46 AM, Reindl Harald h.reindl@thelounge.net wrote:
interesting, i have that behavior on a Rawhide VM with no services except sshd which explains the systemd device-unit from my mail some time ago
Yeah, you answered your own question on that thread, so I didn't look into it. Reading back, it seems you installed some zram-1.0.0 RPM that isn't in the Fedora repos. That seems to be what is providing all the various zram related items in your VM, because zram.service doesn't exist anywhere else
i linked in that thread the src.rpm
the script with the rmmod ist part of that service and the rmmod with error supression is there because the virgin VM where i figured out how to use zram had the module unconditional loaded
On Tue, Apr 22, 2014 at 8:58 AM, Reindl Harald h.reindl@thelounge.net wrote:
Am 22.04.2014 14:55, schrieb Josh Boyer:
On Tue, Apr 22, 2014 at 8:46 AM, Reindl Harald h.reindl@thelounge.net wrote:
interesting, i have that behavior on a Rawhide VM with no services except sshd which explains the systemd device-unit from my mail some time ago
Yeah, you answered your own question on that thread, so I didn't look into it. Reading back, it seems you installed some zram-1.0.0 RPM that isn't in the Fedora repos. That seems to be what is providing all the various zram related items in your VM, because zram.service doesn't exist anywhere else
i linked in that thread the src.rpm
Yes...
the script with the rmmod ist part of that service and the rmmod with error supression is there because the virgin VM where i figured out how to use zram had the module unconditional loaded
OK. So it seems you found the area that is causing your issues, and it's that script/RPM. Glad you cleared it up.
josh
Am 22.04.2014 15:00, schrieb Josh Boyer:
On Tue, Apr 22, 2014 at 8:58 AM, Reindl Harald h.reindl@thelounge.net wrote:
Am 22.04.2014 14:55, schrieb Josh Boyer:
On Tue, Apr 22, 2014 at 8:46 AM, Reindl Harald h.reindl@thelounge.net wrote:
interesting, i have that behavior on a Rawhide VM with no services except sshd which explains the systemd device-unit from my mail some time ago
Yeah, you answered your own question on that thread, so I didn't look into it. Reading back, it seems you installed some zram-1.0.0 RPM that isn't in the Fedora repos. That seems to be what is providing all the various zram related items in your VM, because zram.service doesn't exist anywhere else
i linked in that thread the src.rpm
Yes...
the script with the rmmod ist part of that service and the rmmod with error supression is there because the virgin VM where i figured out how to use zram had the module unconditional loaded
OK. So it seems you found the area that is causing your issues, and it's that script/RPM. Glad you cleared it up
*no* the other way round /sys/devices/virtual/block/zram exists *because* zram was loaded and that triggers sys-devices-virtual-block-zram0.device
after blacklist zram /sys/devices/virtual/block/zram exists as well as the device-unit don't exist
a virgin rawhide VM with not anything zram related configured or installed has the zram module loaded - that fact was in my way by "develop" that service and RPM
https://lists.fedoraproject.org/pipermail/kernel/2014-March/005127.html
[root at rawhide ~]# systemctl list-units | grep zram sys-devices-virtual-block-zram0.device loaded active plugged /sys/devices/virtual/block/zram
On Tue, Apr 22, 2014 at 9:05 AM, Reindl Harald h.reindl@thelounge.net wrote:
Am 22.04.2014 15:00, schrieb Josh Boyer:
On Tue, Apr 22, 2014 at 8:58 AM, Reindl Harald h.reindl@thelounge.net wrote:
Am 22.04.2014 14:55, schrieb Josh Boyer:
On Tue, Apr 22, 2014 at 8:46 AM, Reindl Harald h.reindl@thelounge.net wrote:
interesting, i have that behavior on a Rawhide VM with no services except sshd which explains the systemd device-unit from my mail some time ago
Yeah, you answered your own question on that thread, so I didn't look into it. Reading back, it seems you installed some zram-1.0.0 RPM that isn't in the Fedora repos. That seems to be what is providing all the various zram related items in your VM, because zram.service doesn't exist anywhere else
i linked in that thread the src.rpm
Yes...
the script with the rmmod ist part of that service and the rmmod with error supression is there because the virgin VM where i figured out how to use zram had the module unconditional loaded
OK. So it seems you found the area that is causing your issues, and it's that script/RPM. Glad you cleared it up
*no* the other way round /sys/devices/virtual/block/zram exists *because* zram was loaded
What loaded it? It doesn't autoload.
and that triggers sys-devices-virtual-block-zram0.device
after blacklist zram /sys/devices/virtual/block/zram exists as well as the device-unit don't exist
a virgin rawhide VM with not anything zram related configured or installed has the zram module loaded - that fact was in my way by "develop" that service and RPM
I have a rawhide VM here too, it has nothing related to zram configuration, and the module isn't loaded. Every machine I have is like this.
[jwboyer@localhost ~]$ lsmod | grep zram [jwboyer@localhost ~]$ dmesg | grep zram [jwboyer@localhost ~]$ ls /dev/zram* ls: cannot access /dev/zram*: No such file or directory [jwboyer@localhost ~]$ uname -a Linux localhost.localdomain 3.15.0-0.rc2.git0.1.fc21.x86_64 #1 SMP Mon Apr 21 08:55:13 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux [jwboyer@localhost ~]$ modinfo zram filename: /lib/modules/3.15.0-0.rc2.git0.1.fc21.x86_64/kernel/drivers/block/zram/zram.ko description: Compressed RAM Block Device author: Nitin Gupta ngupta@vflare.org license: Dual BSD/GPL depends: intree: Y vermagic: 3.15.0-0.rc2.git0.1.fc21.x86_64 SMP mod_unload signer: Fedora kernel signing key sig_key: A4:E8:3E:17:78:1D:AE:9F:50:BF:F1:AA:78:FE:F3:13:D1:37:22:D7 sig_hashalgo: sha256 parm: num_devices:Number of zram devices (uint) [jwboyer@localhost ~]$ [jwboyer@localhost ~]$ rpm -q systemd systemd-212-1.fc21.x86_64 [jwboyer@localhost ~]$
So, I guess you need to figure out what loaded the zram module.
josh
On 04/22/2014 01:38 PM, Josh Boyer wrote:
I have a rawhide VM here too, it has nothing related to zram configuration, and the module isn't loaded.
Nor should it be it's going to take us sometime to implement this correctly into the distribution and arguably that module should be packaged seperatly in a zram package.
JBG
Am 22.04.2014 19:17, schrieb Jóhann B. Guðmundsson:
On 04/22/2014 01:38 PM, Josh Boyer wrote:
I have a rawhide VM here too, it has nothing related to zram configuration, and the module isn't loaded.
Nor should it be it's going to take us sometime to implement this correctly into the distribution and arguably that module should be packaged seperatly in a zram package
why do you need a sub-package? if it is not loaded all is fine
today i started using zram on testing and development virtual machines maybe that it was loaded automatically is already fixed, the first testing was a realy Rawhide 3.15 kernel and after that i blacklisted it but for now still keep the "rmmod" before re-load the module
below you have all needed for zram working and i have currently besides the F20 development-servers a Rawhide VM with 256 MB RAM and with zram it survives even "yum reinstall *" ______________________________________________________________
[root@testserver:~]$ cat /usr/lib/systemd/system/zram.service [Unit] Description=Enable compressed swap in memory using zram After=multi-user.target
[Service] RemainAfterExit=yes ExecStart=/usr/sbin/zramstart ExecStop=/usr/sbin/zramstop Type=oneshot
[Install] WantedBy=multi-user.target ______________________________________________________________
[root@testserver:~]$ cat /etc/sysconfig/zram FACTOR=25 ______________________________________________________________
[root@testserver:~]$ cat /etc/modprobe.d/disable-zram.conf blacklist zram ______________________________________________________________
[root@testserver:~]$ cat /usr/sbin/zramstart #!/usr/bin/bash
num_cpus=$(grep -c processor /proc/cpuinfo) [ "$num_cpus" != 0 ] || num_cpus=1
last_cpu=$((num_cpus - 1)) FACTOR=20
[ -f /etc/sysconfig/zram ] && source /etc/sysconfig/zram || true
factor=$FACTOR
memtotal=$(grep MemTotal /proc/meminfo | awk ' { print $2 } ')
mem_by_cpu=$(($memtotal/$num_cpus*$factor/100*1024))
/usr/sbin/rmmod zram 2> /dev/null > /dev/null
/usr/sbin/modprobe -q zram num_devices=$num_cpus 2> /dev/null > /dev/null
for i in $(seq 0 $last_cpu); do echo $mem_by_cpu > /sys/block/zram$i/disksize /usr/sbin/mkswap /dev/zram$i /usr/sbin/swapon -p 100 /dev/zram$i done ______________________________________________________________
[root@testserver:~]$ cat /usr/sbin/zramstop #!/usr/bin/bash
for i in $(grep '^/dev/zram' /proc/swaps | awk '{ print $1 }'); do /usr/sbin/swapoff "$i" done
if grep -q "^zram " /proc/modules; then sleep 1 /usr/sbin/rmmod zram fi
Am 22.04.2014 20:34, schrieb Jóhann B. Guðmundsson:
On 04/22/2014 05:31 PM, Reindl Harald wrote:
why do you need a sub-package?
To add the files and configuration similar to what you are using.
Zram does not work out of the box as in it requires manual administrator or user setup so there is no point in enabling it by default
until you don't have the other files (i linked my src.rpm not so long ago here) there is no reason to move a 24 KB small kernel-module to a subpackage, even if you have the other files there is no reason - the package overhead and metadata in the repos are larger
so no - there is no need for a subpackage it's statet that it does not get autoloaded and so you are done
you only have to take my src.rpm, imporve it and add it to the fedora repos, it loads zram and configures it
no need that the kernel-guys have to bother with that they only need to watch that it don't get loaded without a reason
On 04/22/2014 07:40 PM, Reindl Harald wrote:
so no - there is no need for a subpackage
Anything that requires manual setup on behalf of the user/administrator to work or a half baked mod probing/calculating script to decide how many devices you want like zram does, should be package separately, outside the kernel "core/default" package with a big fat code pile of crap warning.
That code doesn't have the ability to dynamically add/remove devices so welcome to the 21 century of kernel coding!
I guess the most cleanest, consistent implementation we and distributions in general can get with zram is to patch fstab to support zram options
JBG
Am 23.04.2014 09:37, schrieb Jóhann B. Guðmundsson:
On 04/22/2014 07:40 PM, Reindl Harald wrote:
so no - there is no need for a subpackage
Anything that requires manual setup on behalf of the user/administrator to work or a half baked mod probing/calculating script to decide how many devices you want like zram does, should be package separately, outside the kernel "core/default" package with a big fat code pile of crap warning
what is you problem?
* it's not enabled by default * nobody is forced to spend any second with it * the ones which want like i do can use it instead wait until a solution good enough for you is out there
That code doesn't have the ability to dynamically add/remove devices so welcome to the 21 century of kernel coding!
so just don't use it instead make noise here, go ahead and tell all of the above Linus while other continue to use it
On 04/23/2014 08:18 AM, Reindl Harald wrote:
what is you problem?
I'm perfectly problem free I just happen to know how broken zram after having to patch udev for a race condition it had with swapon
- it's not enabled by default
Good
- nobody is forced to spend any second with it
Even better
- the ones which want like i do can use it instead wait until a solution good enough for you is out there
You and the rest that cant wait cant come here then complaining that your own custom made or found on the internet zram rpm/implementation is not working in the distribution with the obvious problem being your own implementation as Josh has pointed out on numerous times.
All I said there is a lot of work we need to do if we as an distribution are going to ship/support zram
JBG
Am 23.04.2014 10:28, schrieb Jóhann B. Guðmundsson:
On 04/23/2014 08:18 AM, Reindl Harald wrote:
what is you problem?
I'm perfectly problem free I just happen to know how broken zram after having to patch udev for a race condition it had with swapon
- it's not enabled by default
Good
- nobody is forced to spend any second with it
Even better
- the ones which want like i do can use it instead wait until a solution good enough for you is out there
You and the rest that cant wait cant come here then complaining that your own custom made or found on the internet zram rpm/implementation is not working in the distribution with the obvious problem being your own implementation as Josh has pointed out on numerous times.
*no* *no* *no* and no again
i was working *all the time* i just asked to have a look at the loading-behavior
i explained *multiple* times that not so long ago zram was loaded on a *Rawhide* 3.15 RC0 kernel without any configuration and the output "zram" of "lsmod" even was the reason that i looked at it resulting in the unit-file and startup-script
so please do me a favour and if you don't want to read or understand what i say go out of my way
All I said there is a lot of work we need to do if we as an distribution are going to ship/support zram
to ship no to support, maybe
kernel@lists.fedoraproject.org