Git Product home page Git Product logo

Comments (10)

Nefelim4ag avatar Nefelim4ag commented on May 20, 2024

This not a bug, check:
cat /sys/block/zram0/max_comp_streams
Official kernel documentation:
https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next/+/refs/heads/akpm/Documentation/blockdev/zram.txt
quote:
2) Set max number of compression streams
Compression backend may use up to max_comp_streams compression streams,
thus allowing up to max_comp_streams concurrent compression operations.
By default, compression backend uses single compression stream.
Examples:
#show max compression streams number
cat /sys/block/zram0/max_comp_streams
#set max compression streams number to 3
echo 3 > /sys/block/zram0/max_comp_streams

from systemd-swap.

igreenman avatar igreenman commented on May 20, 2024

Agree I'm a little confused.
The previous version was the option zram_num_devices=$cpu_count.
And even when the option was commented out was two zram devices.
The latest version is only one zram device. Is that correct?
The system has two CPUs.

from systemd-swap.

Nefelim4ag avatar Nefelim4ag commented on May 20, 2024

Yes, previously i use several zram devices like https://aur.archlinux.org/packages/zramswap
After i found max_comp_streams options and rewrite some code for using kernel side feature.
And now, setup several zram devices for swap no needed, i can only set compression streams count with one zram device.

And even when the option was commented out was two zram devices. - if options commented and script setup several devices -> this is a bug of previously version.

The latest version is only one zram device. Is that correct?
The system has two CPUs.
Latest version setup only one device and if options for multi compression streams enabled, set 2 threads in max_comp_streams for your system.
This is right behavior.

from systemd-swap.

igreenman avatar igreenman commented on May 20, 2024

About zram[streams] option.

  1. How to set max_comp_streams correctly systemwide?
  2. Not very logical that if in config zram[streams] more than max_comp_streams, then the zram device is not created.

from systemd-swap.

Nefelim4ag avatar Nefelim4ag commented on May 20, 2024
  1. Systemwide? Only with hands :)
    echo | sudo tee /sys/block/zram*/max_comp_streams
  2. I repeat again, zram[streams] == max_comp_streams
    in script echo ${zram[streams]} > /sys/block/zram${[dev]}/max_comp_streams
    Value from zram[streams] sets to max_comp_streams
    if you set zram[streams]=4, after starting systemd-swap in max_comp_streams you have 4.
    We no need to create several device, 1 enough.
    Or in your system after set zram[streams]=4 zram device not setup? May be you not install zramctl? (this is external depends for systemd-swap, and this heeded for setups zram devices in script)

from systemd-swap.

igreenman avatar igreenman commented on May 20, 2024

FS#41361:
no zram devices with uncommented zram[streams]=${sys[cpu_count]} in /etc/systemd-swap.conf

And one /dev/zram0 with this string commented.

Second line means that zramctl is installed, isn't it?

from systemd-swap.

Nefelim4ag avatar Nefelim4ag commented on May 20, 2024

I am confused, in arch bug tracker you create bug because my tool no setup zram devices if you set streams count in config, on github you say what my tool must setup several device.

I retest on my system and all working perfect. If you have trouble please provide additional info, like steps for reproduce. Config copy paste, logs, some thing, what I can using for fix that.
one line command:
sudo bash -cx 'uname -a; modprobe --first-time zram; cd /etc/modprobe.d/; grep . *; ls /sys/block/; mount; swapon; zramctl status; cat /etc/systemd-swap.conf; bash -x /usr/lib/systemd/scripts/systemd-swap.sh stop; bash -x /usr/lib/systemd/scripts/systemd-swap.sh start; mount; swapon; zramctl status; ls /sys/block/; ls /sys/block/zram0/; strace zramctl find 1024M lz4 4;' &> ~/systemd-swap.log

from systemd-swap.

Nefelim4ag avatar Nefelim4ag commented on May 20, 2024

if you using kernel => 3.15 and not set zram[alg] option, and set zram[streams] - you can get case where zramctl can't work properly, i fix that in 2.24.5

from systemd-swap.

igreenman avatar igreenman commented on May 20, 2024

I apologize for the delay. I do not have access to the system right now.
Yes, the system has been in up to date conditions of a week ago (kernel ~3.15.5)
And I did not set zram[alg] option.
Thank you.

from systemd-swap.

Nefelim4ag avatar Nefelim4ag commented on May 20, 2024

Happy to help, so can you close issue and bug report? https://bugs.archlinux.org/task/41361

from systemd-swap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.