LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 03-15-2021, 09:22 AM   #1
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
Zram on Slackware ARM


Has anyone found documention, blog posts, or white papers discussing zram on Slackware ARM? Specifically, using /tmp mounted in zram?

The only reliable information I found is here:
https://www.lotar.altervista.org/wik...m-in-slackware

What I am mostly interested in is how effective zram is on ARM... and if anyone uses it in production for meaningful workloads?

Last edited by mralk3; 03-15-2021 at 10:34 AM.
 
Old 03-15-2021, 01:32 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,015

Rep: Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340
for example: https://www.linuxquestions.org/quest...am-4175685851/
zram is not slackware specific.
 
Old 03-15-2021, 01:42 PM   #3
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Original Poster
Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
Quote:
Originally Posted by pan64 View Post
for example: https://www.linuxquestions.org/quest...am-4175685851/
zram is not slackware specific.
I am aware that it is available on all Linux systems that have the zram kernel module compiled or built in to the kernel.
 
Old 03-15-2021, 02:21 PM   #4
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Original Poster
Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
I wrote a Slackdoc to share what I could find. Hopefully, somemone else can use it as I am. I am very interested in information about how to use zarm as a file system to keep log files within it.

Zram in Slackware ARM and ARM64 Architectures
 
Old 04-18-2023, 04:14 AM   #5
jloco
Member
 
Registered: Apr 2016
Location: Detroit, MI
Distribution: Slackware
Posts: 189

Rep: Reputation: 173Reputation: 173
zram/swap aarch64 pbp

So, I randomly came across the guide linked here today google searching about zram.
Background: for a little while recently I had been running Debian (sid) on my PBP, as I wanted to see how the machine ran on another distro.

To my delight it ran pretty well, and a fresh out of the box install was much snappier than Slackware comes after install. Still, Debian isn't home and after a few weeks, running it had been enough for me. So back to Slackware with some new things to try. The different thing that stood out to me was Debian was using zram in place of a traditional swap partition. Now during the Slackware install I did setup a 4gb swap and enabled it, but now I want to try out some zram configs. All Debian was using was a 1gb zram, yet on the wiki page, it's setup to have 1gb zram per core. This equals 6gb of zram on the PBP, and is even higher than the included ram to begin with. I wonder if leaving this could hinder performance.

I'm interested to hear anyone else's experiences with zram, since this post has had 2 years to age, surely someone has this going by now. I'm going to try a few different things, and see how it fares. But outside of firefox, I haven't put anything resource intensive on here. I may install GNOME to see how that feels, since last time it was very sluggish on Slackware, but ran great on Debian. I've basically been using sway since it's so light on resources.

But I'd love to hear if anyone has any insight on zram on the PBP!
 
Old 04-27-2023, 07:06 PM   #6
xp19375
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 33

Rep: Reputation: Disabled
Quote:
Originally Posted by jloco View Post
So, I randomly came across the guide linked here today google searching about zram.
...

I'm interested to hear anyone else's experiences with zram, since this post has had 2 years to age, surely someone has this going by now. I'm going to try a few different things, and see how it fares. But outside of firefox, I haven't put anything resource intensive on here. I may install GNOME to see how that feels, since last time it was very sluggish on Slackware, but ran great on Debian. I've basically been using sway since it's so light on resources.

But I'd love to hear if anyone has any insight on zram on the PBP!
I just tried this today on my PBP using mralk3's howto. The current kernel has the zram module compiled, so you don't need to recompile it. Everything seems to work fine so far, although I haven't tried anything stressing yet. The only complication for me is that the zram module doesn't load on boot automatically, so after boot I have to run
Code:
modprobe -v zram num_devices=6
swapon -a
I think it takes a little time for the /dev/zram? devices to get created so if you put this in rc.local, you might have to add a "sleep 1" after the first command.
 
Old 04-28-2023, 02:36 PM   #7
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Original Poster
Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
Originally I was adding the zram block devices with a udev rule. I did it that way prior to MoZes adding in the /etc/rc.d/rc.platform.conf configuration file and the /etc/rc.d/rc.platform.d/ directory structure.

The way I do it now is by using rc.platform.conf to enable zram, configure the size, and how many block devices.

Zram support comes in the Aarch64 kernel already- no need to rebuild the kernel.

Here is an example of what I have on my pinebook pro and rockpro64 units at the end of rc.platform.conf

Code:
# Toggle ZRAM, set block device size and count
ZRAM_ENABLE=1
ZRAM_SIZE=2G
ZRAM_COUNT=1
Here is what I use on my pinebook pro and rockpro64 in /etc/rc.d/rc.platform.d/aarch64/zram.
Code:
####################################################################
# Script : /etc/rc.d/rc.platform/aarch64/zram
# Purpose: Perform boot time configuration activities for Hardware
#          Models using the rk3399 SoC.  This includes:
#          * RockPro64,
#          * Pinebook Pro
# Caller : This script is executed from /etc/rc.d/rc.platform
#          (which is loaded from /etc/rc.d/rc.M prior to rc.local) 
# Author : Brenton Earl <el0226@slackware.com> 
# Date...: 02-September-2022
####################################################################
# Note: This configuration file is managed by the Slackware packages
#       and is NOT user serviceable.  Any changes made here will be
#       removed when the 'a/sysvinit-scripts' package is upgraded.
#
#       To adjust the settings used for the actions applied here,
#       edit /etc/rc.d/rc.platform.conf and the settings will become
#       operative at the next boot.
####################################################################
#
# TODO Add Raspberry Pi and Honeycomb 

# Pinebook Pro and RockPro64 ZRAM settings:
case "$HWM" in
        "Pine64 Pinebook Pro"*|"Pine64 RockPro64"*)
        if [ "${ZRAM_ENABLE}" = "1" ]; then
                #ZRAM_SIZE=${ZRAM_SIZE:-1G}
                #ZRAM_COUNT=${ZRAM_COUNT:-4}

                echo "ZRAM:: Creating ${ZRAM_COUNT} block devices."
                modprobe zram num_devices=${ZRAM_COUNT} 

                echo "ZRAM:: Activating ${ZRAM_COUNT} swap devices at ${ZRAM_SIZE} each."
                for i in `seq 0 $(( ${ZRAM_COUNT[@]} - 1 ))` ; do
                        echo $ZRAM_SIZE > /sys/block/zram$i/disksize
                        mkswap /dev/zram$i > /dev/null 2>&1
                        swapon -p 50 /dev/zram$i
                done
        fi
        ;;
esac
It is pretty easy to add additional hardware models and drop these two files into /etc/rc.d after you do so. As an example, my raspberry pi 4 has 2 zram block devices and I use one as a swap file and another as a temporary file system (/tmp).

If you are building a lot of packages and have enough RAM to do so, I like to set up my build environment in RAM by using a zram block device as a temporary file system. Speeds things up a lot. Just be sure to edit your build scripts/configuration to save your packages to a more permanent storage after a build completes.
 
Old 04-28-2023, 02:53 PM   #8
jloco
Member
 
Registered: Apr 2016
Location: Detroit, MI
Distribution: Slackware
Posts: 189

Rep: Reputation: 173Reputation: 173
I had tampered with zram a bit. I changed what the wiki page recommends locally as well. I ended up setting up 2 - 2gb zram for swap and also a 1gb /tmp in zram. I'm hoping these will minimize writes to the emmc while building packages and such. So far I haven't run into any issues.

Someone elsewhere suggested doing the firefox cache in zram, and while it would be a decent idea for lowering writes, it seems I'd end up fetching the same data constantly, slowing down browsing overall. I haven't bothered messing with that yet though. Future task.

It did work seamlessly in my system after enabling in the rc.platform.conf file as well. As for changing all my slackbuilds, since I use many of them on other systems, I just mentally note I need to move packages out of /tmp before I reboot.

But as for zram overall... so far, so good. I need to set it up on x86 some day now
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Fedora 29 Linux OS Officially Released with GNOME 3.30, ZRAM for ARM Devices LXer Syndicated Linux News 0 11-01-2018 05:51 AM
LXer: zRAM Is Still Hoping For A Promotion LXer Syndicated Linux News 0 11-26-2013 02:41 AM
LXer: ZRAM Might Finally Be Moved Out Of Linux Staging LXer Syndicated Linux News 0 08-15-2013 08:10 AM
LXer: Ubuntu Linux Considers Greater Usage Of zRAM LXer Syndicated Linux News 0 12-08-2012 03:30 PM
LXer: Increased Performance In Linux With zRam (Virtual Swap Compressed in RAM) LXer Syndicated Linux News 8 10-04-2011 12:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 07:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration