Page 1 of 1

Swapspace

Posted: Sat Aug 24, 2024 3:30 am
by davidy
I realized just the other day that MX23.3 configures the zramswap service to run by default and removes the actual swap partition itself. Swapspace, which is in synaptic (tyvm), dynamically adjusts your swap on demand. I think I have noticed a difference too. Before when using double commander to transfer large or lots of files to my nas it would show a speedy progress and then stop, and then start again, continuously almost on my 2.5GbE line. Now it seems to just transfer more smoothly without all the hiccups. In any case, I was surprised to see it in the repos and wondered why it wasn't installed by default. I had no idea I was running without an actual swap partition the whole time I've been running 23.3 lol. I have no idea if it actually is helping my transfer speeds but there is also the udisks2-zram, zram support for udisks, in synaptic as well. I installed that too for the hell of it lol.
A virtual and dynamic swapspace instead of a static swap partition is kinda cool too I think.

Re: Swapspace

Posted: Sun Aug 25, 2024 11:56 am
by CharlesV
Interesting... I would think having all of those on board would be a little problematic. But I suppose that doesnt mean that they are engaged.

I tried dynamic swap a while back ( tyvm ) and had some weird issues when I was deep in blender. I removed it and 'blender issues' went away, so that went off my list. But I should check up on updates to it - possibly something has changed. (I know my machine has since then, so maybe another attempt.)

Re: Swapspace

Posted: Sun Aug 25, 2024 1:22 pm
by siamhie
davidy wrote: Sat Aug 24, 2024 3:30 am I realized just the other day that MX23.3 configures the zramswap service to run by default and removes the actual swap partition itself.

Is that only when you don't select your swap partition during the installation?

Code: Select all

○ zramswap.service
     Loaded: masked (Reason: Unit zramswap.service is masked.)
     Active: inactive (dead)
Description: Linux zramswap setup

Code: Select all

inxi -S -d --swap
System:
  Host: flux23 Kernel: 6.9.12-2-liquorix-amd64 arch: x86_64 bits: 64
  Desktop: Fluxbox v: 1.3.7 Distro: MX-23.3_fluxbox_x64 Libretto May 19
    2024
Drives:
  Local Storage: total: 8.64 TiB used: 1018.26 GiB (11.5%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WDS500G3XHC-00SJG0
    size: 465.76 GiB
  ID-2: /dev/nvme1n1 vendor: Western Digital model: WDS500G1X0E-00AFY0
    size: 465.76 GiB
  ID-3: /dev/sda vendor: Seagate model: ST8000DM004-2CX188 size: 7.28 TiB
  ID-4: /dev/sdb vendor: Samsung model: SSD 870 EVO 500GB size: 465.76 GiB
  Message: No optical or floppy data found.
Swap:
  ID-1: swap-1 type: partition size: 64 GiB used: 0 KiB (0.0%) dev: /dev/sdb2

Re: Swapspace

Posted: Sun Aug 25, 2024 3:31 pm
by dolphin_oracle
davidy wrote: Sat Aug 24, 2024 3:30 am I realized just the other day that MX23.3 configures the zramswap service to run by default and removes the actual swap partition itself.
it does not. zramswap is used by the installer in case swap isn't present, but its not configured by default on installed systems, and the option to use swap partitions or swapfiles is very much there. we also don't remove swap partitions if the are present, but they won't be used unless you tell the installer to use them (custom install option).

if the automatic installer option is used, a swapfile is created rather than a swap partition. but it has nothing to do with zramswap.

Re: Swapspace

Posted: Sun Aug 25, 2024 10:15 pm
by AK-47
Even if zramswap is enabled, it doesn't remove any partitions or stop the swap file being configured, it just configures zram in addition to whatever swap space you have told the installer to set up.

Re: Swapspace

Posted: Mon Aug 26, 2024 6:50 pm
by davidy
I installed mx 23.3 totally clean and let it use entire disk. It removed the swap space that I know I had when I was running 21.3. I sure as hell didn't. Either that or both gparted and gnome-disks no longer see swap. Not only that I know my swap in 21.3 was just a tad over my actual 16GB of ram. Fastfetch says I have one that's 19.72Gb with 0% used. Zram is running and configured too but I know nothing about that either.
Image
Got me. Besides when you let an installer "use entire disk" doesn't that literally mean you don't have to partition anything?? Seems like maybe my memory is bad -Nope. I distinctly remember writing down the actual sizes of all my partitions for future reference when I installed 21.3 a few years back. Trying to find those figures now. Funny how fastfetch says I have one but neither gparted nor gnome-disks actually sees it. I have noticed my transfer speeds are a bit smoother. The joys of an invisible swap. The only thing that doesn't work anymore is suspend. Hibernate works fine and I use it every day.
Strange. even if myOS disk was brand spanking new and I told mx to install clean using entire disk, that requires zero partition management last I checked. Where the invisible swap is is a mystery unto mx. MAGIC it be. lol
ESP 256MB
Root 915.22GB
Swap 16.04GB

Re: Swapspace

Posted: Mon Aug 26, 2024 7:05 pm
by siamhie
What does lsblk report?

Re: Swapspace

Posted: Mon Aug 26, 2024 7:12 pm
by davidy
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
zram0 254:0 0 256M 0 disk [SWAP]
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 256M 0 part /boot/efi
└─nvme0n1p2 259:2 0 931.3G 0 part /
nvme1n1 259:3 0 931.5G 0 disk
└─nvme1n1p1 259:4 0 931.5G 0 part /mnt/nvme1n1p1

Does this mean zram is my swap from the efi/boot?? Whatever you do please don't tell me I have to start over if in fact I do need an actual swap. Btw, I didn't 'configure' anything of the installer process but a couple services I knew I would not be using and of course the login stuff and timezone. That's it. I literally let the installer do what it does/did/didn't.

Re: Swapspace

Posted: Mon Aug 26, 2024 7:19 pm
by dolphin_oracle
like i said, if the auto install is used (whole disk) then a swapfile (not a partition) is created. by default, mounted under /swap I think.

if you had included your quick-system-info, we would know what swap is enabled.

also

Code: Select all

swapon --show

Re: Swapspace

Posted: Mon Aug 26, 2024 7:21 pm
by davidy

Code: Select all

Snapshot created on: 20240821_1231
System:
  Kernel: 6.10.6-2-liquorix-amd64 [6.10-6~mx23ahs] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 clocksource: tsc
    avail: acpi_pm parameters: audit=0 intel_pstate=disable
    BOOT_IMAGE=/boot/vmlinuz-6.10.6-2-liquorix-amd64 root=UUID=<filter> ro zswap.enabled=1
    zswap.compressor=lz4 zswap.max_pool_percent=50 zswap.zpool=z3fold quiet splash
    resume=UUID=<filter> resume_offset=31789056 mitigations=off vt.cur_default=6 vt.color=2
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 wm: xfwm4 v: 4.18.0 with: xfce4-panel tools:
    avail: xfce4-screensaver vt: 7 dm: LightDM v: 1.32.0 Distro: MX-23.3_ahs_x64 Libretto May 19 2024
    base: Debian GNU/Linux 12 (bookworm)
Machine:
  Type: Laptop System: System76 product: Lemur Pro v: lemp10 serial: <superuser required> Chassis:
    type: 9 serial: <superuser required>
  Mobo: System76 model: Lemur Pro v: lemp10 serial: <superuser required> UEFI: coreboot
    v: 2021-06-28_f8c3962 date: 05/10/2021
Battery:
  ID-1: BAT0 charge: 33.4 Wh (55.0%) condition: 60.7/73.9 Wh (82.1%) volts: 7.4 min: 7.7
    model: Notebook BAT type: Li-ion serial: <filter> status: discharging
  ID-2: hidpp_battery_0 charge: 24% condition: N/A volts: 3.7 min: N/A model: Logitech G Pro
    Wireless Gaming Mouse type: N/A serial: <filter> status: discharging
CPU:
  Info: model: 11th Gen Intel Core i7-1165G7 bits: 64 type: MT MCP arch: Tiger Lake gen: core 11
    level: v4 note: check built: 2020 process: Intel 10nm family: 6 model-id: 0x8C (140) stepping: 1
    microcode: 0xB6
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache: L1: 320 KiB
    desc: d-4x48 KiB; i-4x32 KiB L2: 5 MiB desc: 4x1.2 MiB L3: 12 MiB desc: 1x12 MiB
  Speed (MHz): avg: 627 high: 1248 min/max: 400/2801 boost: enabled scaling: driver: acpi-cpufreq
    governor: ondemand cores: 1: 935 2: 400 3: 1248 4: 400 5: 835 6: 400 7: 400 8: 400
    bogomips: 44851
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Vulnerable
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass status: Vulnerable
  Type: spectre_v1 status: Vulnerable: __user pointer sanitization and usercopy barriers only;
    no swapgs barriers
  Type: spectre_v2 status: Vulnerable; IBPB: disabled; STIBP: disabled; PBRSB-eIBRS: Vulnerable;
    BHI: Vulnerable
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] vendor: CLEVO/KAPOK driver: i915 v: kernel
    alternate: xe arch: Gen-12.1 process: Intel 10nm built: 2020-21 ports: active: eDP-1 empty: DP-1,
    DP-2, DP-3, DP-4, HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:9a49 class-ID: 0300
  Device-2: Chicony USB2.0 Camera driver: uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
    mode: 2.0 bus-ID: 1-7:26 chip-ID: 04f2:b685 class-ID: 0e02
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm4 v: 4.18.0 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93")
  Monitor-1: eDP-1 model: ChiMei InnoLux 0x1408 built: 2019 res: 1920x1080 hz: 60 dpi: 158
    gamma: 1.2 size: 309x173mm (12.17x6.81") diag: 354mm (13.9") ratio: 16:9 modes: 1920x1080
  API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris device: 1 drv: swrast gbm:
    drv: iris surfaceless: drv: iris x11: drv: iris inactive: wayland
  API: OpenGL v: 4.6 vendor: intel mesa v: 23.1.2-1~mx23ahs glx-v: 1.4 es-v: 3.2
    direct-render: yes renderer: Mesa Intel Xe Graphics (TGL GT2) device-ID: 8086:9a49
    memory: 15.11 GiB unified: yes
Audio:
  Device-1: Intel Tiger Lake-LP Smart Sound Audio driver: snd_hda_intel v: kernel
    alternate: snd_soc_avs,snd_sof_pci_intel_tgl bus-ID: 00:1f.3 chip-ID: 8086:a0c8 class-ID: 0403
  API: ALSA v: k6.10.6-2-liquorix-amd64 status: kernel-api tools: alsactl,alsamixer,amixer
  Server-1: PulseAudio v: 16.1 status: active tools: pacat,pactl,pavucontrol
Network:
  Device-1: Intel Wi-Fi 6 AX201 driver: iwlwifi v: kernel modules: wl bus-ID: 00:14.3
    chip-ID: 8086:a0f0 class-ID: 0280
  IF: wlan0 state: down mac: <filter>
  Device-2: Realtek USB 10/100/1G/2.5G LAN driver: r8152 type: USB rev: 3.2 speed: 5 Gb/s
    lanes: 1 mode: 3.2 gen-1x1 bus-ID: 2-1:2 chip-ID: 0bda:8156 class-ID: 0000 serial: <filter>
  IF: eth0 state: up speed: 2500 Mbps duplex: full mac: <filter>
  IF-ID-1: wg0-mullvad state: unknown speed: N/A duplex: N/A mac: N/A
  Info: services: NetworkManager
Bluetooth:
  Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1
    mode: 1.1 bus-ID: 1-10:5 chip-ID: 8087:0026 class-ID: e001
  Report: hciconfig ID: hci0 rfk-id: 2 state: down bt-service: N/A rfk-block: hardware: no
    software: no address: <filter>
  Info: acl-mtu: 1021:4 sco-mtu: 96:6 link-policy: rswitch sniff link-mode: peripheral accept
Drives:
  Local Storage: total: 1.82 TiB used: 482.61 GiB (25.9%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 980 PRO 1TB size: 931.51 GiB
    block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 2B2QGXA7 temp: 41.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:3 vendor: Samsung model: SSD 970 EVO Plus 1TB size: 931.51 GiB
    block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 2B2QEXM7 temp: 36.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 931.26 GiB size: 915.57 GiB (98.31%) used: 48.72 GiB (5.3%) fs: ext4
    dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 256 MiB size: 252 MiB (98.46%) used: 274 KiB (0.1%) fs: vfat
    dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) zswap: yes compressor: lz4
    max-pool: 50%
  ID-1: swap-1 type: file size: 19.47 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
  ID-2: swap-2 type: zram size: 256 MiB used: 0 KiB (0.0%) priority: 100 comp: lz4
    avail: lzo,lzo-rle,lz4hc,842,zstd max-streams: 8 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 70.0 C mobo: N/A
  Fan Speeds (rpm): cpu: 0
Repos:
  Packages: pm: dpkg pkgs: 2754 libs: 1432 tools: apt, apt-get, aptitude, nala, synaptic pm: rpm
    pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian/ bookworm-updates non-free-firmware non-free contrib main
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian/ bookworm non-free-firmware non-free contrib main
    2: deb http://security.debian.org/debian-security/ bookworm-security non-free-firmware non-free contrib main
    3: deb http://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/home:Alexx2000.list
    1: deb http://download.opensuse.org/repositories/home:/Alexx2000/Debian_12/ /
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://la.mxrepo.com/mx/repo/ bookworm main non-free
    2: deb http://la.mxrepo.com/mx/repo/ bookworm ahs
Info:
  Memory: total: N/A available: 15.47 GiB used: 2.63 GiB (17.0%)
  Processes: 343 Power: uptime: 1d 4h 20m states: freeze,standby,mem,disk suspend: s2idle
    avail: shallow wakeups: 0 hibernate: platform avail: shutdown, reboot, suspend, test_resume
    image: 6.15 GiB services: upowerd,xfce4-power-manager Init: SysVinit v: 3.08 runlevel: 5
    default: graphical tool: systemctl
  Compilers: gcc: 12.2.0 Client: shell wrapper v: 5.2.15-release inxi: 3.3.35
Boot Mode: UEFI
Swapon:
NAME TYPE SIZE USED PRIO
/swap/swap file 19.5G 0B -2
/dev/zram0 partition 256M 0B 100

Re: Swapspace

Posted: Mon Aug 26, 2024 7:22 pm
by dolphin_oracle
yep there you go. a swapfile on /swap/swap.

you do have zramswap as well. that isn't default, possible enabled by the service menu though. or maybe the zswap boot parameter that is apparently in use. also isn't default.

Re: Swapspace

Posted: Mon Aug 26, 2024 7:31 pm
by siamhie
I don't see a swap partition created (by you) on either nvme0n1 or nvme1n1.

example of my customized partition setup.
nvme0n1 has both my efi and root partitions. sdb has my swap partition.
These were all created (in gparted) prior to installation.

Code: Select all

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   7.3T  0 disk 
└─sda1        8:1    0   7.3T  0 part /media/Data
sdb           8:16   0 465.8G  0 disk 
├─sdb1        8:17   0 401.8G  0 part /media/Stream
└─sdb2        8:18   0    64G  0 part [SWAP]
nvme1n1     259:0    0 465.8G  0 disk 
└─nvme1n1p1 259:1    0 465.8G  0 part /media/VirtBox
nvme0n1     259:2    0 465.8G  0 disk 
├─nvme0n1p1 259:3    0   779M  0 part /boot/efi
└─nvme0n1p2 259:4    0   465G  0 part /

Code: Select all

swapon --show
NAME      TYPE      SIZE USED PRIO
/dev/sdb2 partition  64G   0B   -2

Re: Swapspace

Posted: Mon Aug 26, 2024 7:36 pm
by davidy
So MX did create one and it's 19+GB and it's using it and not zram? I did not enable zram, it was enabled by the installer. It was running the first time I cheked it's service. I installed over 21.3 as I had a backup of 21.3, keyword had. The real question is why does everything but gparted and gnomedisks show a swap? And do you think my system is m al=configured, or is it useable and working? I really have no idea. I'm a gui guy only.
My first swapon query missed a hyphen. I like zram but have absolutely no idea on if it even does anything at all. Personally I've never seen swap do anything much either unless you're trying to hibernate which this device does very well atm.
Thanks for the help and thank you mx installer for swapping my brain for another. It's bigger than I'm used to but it's also invisible so I never have to do makeup.

Re: Swapspace

Posted: Mon Aug 26, 2024 9:47 pm
by siamhie
davidy wrote: Mon Aug 26, 2024 7:36 pm The real question is why does everything but gparted and gnomedisks show a swap?

Because those programs (gparted/gnomedisks) will only show the partitions of a hard drive. Not any files.

swap-partition.png

Re: Swapspace

Posted: Tue Aug 27, 2024 12:19 am
by LinuxSpring1
So is it technically possible to have two swap files/partition? Like in this case there is a swap file about 20GB size put in the root (i.e. /) and other is zram swap.

Also wont zram internally use the RAM? So in this case about 256M of RAM is consumed by swap.

Re: Swapspace

Posted: Tue Aug 27, 2024 6:32 am
by dolphin_oracle
You can have as many swap setups as you want. You can have partitions , swap files, or zram, and any combination thereof. The files and partitions would just need fstab entries to be automatically used.

Re: Swapspace

Posted: Tue Aug 27, 2024 8:15 am
by AK-47
@davidy can you please post a minstall.log file? You can do this using the Quick System Info utility. That will tell more about what the installer would have, or at least should have, done.

Re: Swapspace

Posted: Tue Aug 27, 2024 8:30 am
by davidy
Sorry I had to take a break. Realized the /swap/swap with a chmod of 0600 (19.5gb file) IS 'swap'. Never saw that before. I thought it was either an actual partiton space or plain old memory. Zram uses the cpu? No matter what I can't tell if anything is actually being used, albeit hibernate is great.
Minstall.log: it has a size of 1byte on my disc so I assume it is empty, or something. QSI is empty on that tab too. /etc/fstab:

Code: Select all

# Pluggable devices are handled by uDev, they are not in fstab
UUID=0a2f2489-ad85-4760-a218-2efd713f3e93 / ext4 discard,noatime 1 1
UUID=0D36-7234 /boot/efi vfat noatime,dmask=0002,fmask=0113 0 0
/swap/swap swap swap defaults 0 0
/dev/nvme1n1p1 /mnt/nvme1n1p1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
I used a cmd I can't recall to count the processes and their priorities and it gave me 64 different kthread zram ones all with a priority (niceness?) of -20, I believe. Does having a coreboot bios make any difference? Is there maybe a udev cmd to somehow get the zram swap enabled. And do I even need the /swap/swap if it's not used or does that need enabling, too? Nice you can have tons of swaps, with but if they are never used (and in my case apparently not enabled?), and actually are slower than memory, when is swap mandatory or essential? I have never heard someone ever say, "tg I had all that swap space". And if I'm NOT using the swap space how is it hibernating in the 1st place? rambling

Re: Swapspace

Posted: Wed Aug 28, 2024 3:04 am
by davidy
Thanks guys.
I should mention I updated my post about clonezilla and hibernation. I was wrong. It will make a fully functional hibernated boot disk image. The key is to put the image on the root of your drive.
viewtopic.php?p=775238#p775238