• Re: zram not zramfs for swap

    From andy5995@1:105/44 to Maurice Kinal on Thu Sep 3 21:47:07 2026
    Subject: Re: zram not zramfs for swap

    Maurice Kinal wrote to andy5995 on 08/31/2026 02:35 <=-

    Hej andy5995!

    Using zramfs is new to me, I've been using it for about a month. I
    have 14GB Ram.

    New to me as well. Offhand it sounds like /dev/ramX which I used to
    use before I became familiar with the kernel's tmpfs. Comparing tmpfs with nvme0n1p2 - which I currently have mounted on /dev/lfs;

    Hello Maurice!

    I unintentionally gave you incorrect info. zram not zram fs.

    [andy@prometheus build-asan](master)$ zramctl
    NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
    /dev/zram0 zstd 8G 1.2G 373M 388.1M [SWAP]

    zram is a Linux kernel module that allows you to set up compressed >filesystems in RAM.

    zram-tools uses this module to set up compressed swap space. This is useful >on systems with low memory or servers running a large amount of services with >data that's easily swappable but that you may wish to swap back fast without >sacrificing disk bandwidth.

    By default it allocates a maximum of 50% of memory, although it only uses >what it needs. You can configure this in /etc/default/zramswap.

    --
    -Andy Alt

    ... NoCarrierMail, the new multi-platform, multi-format offline reader!
    === NoCarrierMail/Linux v0.55
    --- SBBSecho 3.37-Win32
    * Origin: X-Bit BBS > Oregon USA > x-bit.org/info (1:105/44)
  • From Maurice Kinal@1:153/7001 to andy5995 on Fri Sep 4 05:17:02 2026
    Hey andy5995!

    I unintentionally gave you incorrect info. zram not zram fs.

    Happens all the time. I am meaning to research it but have been a tad distracted with the latest build. I'll try and catch up soon.

    Life is good,
    Maurice

    o- o- o- -o -o o- -o -o o- -o o- -o
    /) /) /) (\ (\ /) (\ (\ /) (\ /) (\
    ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^
    ... Sceal æghwylc mon alætan lændagas.
    Every man will have to relinquish the days loaned to him.
    --- GNU bash, version 5.3.15(1)-release (x86_64-pc-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)
  • From Maurice Kinal@2:280/464.113 to andy5995 on Fri Sep 4 13:49:20 2026
    Hej andy5995!

    # modinfo zram
    filename: /lib/modules/7.2.3/kernel/drivers/block/zram/zram.ko.gz description: Compressed RAM Block Device
    author: Nitin Gupta <ngupta@vflare.org>
    license: Dual BSD/GPL
    depends:
    intree: Y
    name: zram
    retpoline: Y
    vermagic: 7.2.3 SMP preempt mod_unload
    parm: num_devices:Number of pre-created zram devices (uint)

    Offhand it looks to me like compressed tmpfs, which sounds like a really good idea for systems with limited physical ram. You have my interest piqued and I am formulating a plan to test it soon. Normally I avoid compression but in this case it looks to be a desirable alternative to tmpfs. We'll see. Thanks for the heads up.

    Het leven is goed,
    Maurice

    -o -o o- o- -o -o o- o- -o o- -o -o -o o- -o o-
    (\ (\ /) /) (\ (\ /) /) (\ /) (\ (\ (\ /) (\ /)
    ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^
    ... ðone wisdom ðe ðe God sealde ðær ðær ðu hiene befæstan mæge, befæste.
    Wherever you can use the wisdom God gave you, use it.
    --- GNU bash, version 5.3.15(1)-release (x86_64-pc-linux-gnu)
    * Origin: Little Mikey's EuroPoint @ (2:280/464.113)
  • From Maurice Kinal@1:153/7001.53423 to andy5995 on Fri Sep 4 15:27:13 2026
    Hey andy5995!

    <Esc>:read !/usr/sbin/zramctl --version
    zramctl from util-linux 2.42.2

    <Esc>:read !/usr/sbin/zramctl --help

    Usage:
    zramctl [options] <device>
    zramctl -r <device> [...]
    zramctl [options] -f | <device> -s <size>

    Set up and control zram devices.

    Options:
    -a, --algorithm <alg> compression algorithm to use
    -b, --bytes print sizes in bytes, not in human-readable form
    -f, --find find a free device
    -n, --noheadings don't print headings
    -o, --output <list> columns to use for status output
    --output-all output all columns
    -p, --algorithm-params <parameter>...
    parameters for the compression algorithm
    -r, --reset <device>... reset the specified zram devices
    --raw use raw status output format
    -s, --size <size> device size
    -t, --streams <number> number of compression streams

    -h, --help display this help
    -V, --version display version

    Arguments:
    Values for <size> may be followed by a suffix: KiB, MiB,
    GiB, TiB, PiB, EiB, ZiB, or YiB (where the "iB" is optional).
    <alg> is the name of an algorithm; supported are:
    lzo, lz4, lz4hc, deflate, 842, zstd
    (List may be inaccurate, consult man page.)

    Available output columns:
    NAME zram device name
    DISKSIZE limit on the uncompressed amount of data
    DATA uncompressed size of stored data
    COMPR compressed size of stored data
    ALGORITHM the selected compression algorithm
    STREAMS number of concurrent compress operations
    ZERO-PAGES empty pages with no allocated memory
    TOTAL all memory including allocator fragmentation and metadata overhead
    MEM-LIMIT memory limit used to store compressed data
    MEM-USED peak memory usage to store compressed data
    MIGRATED number of objects migrated by compaction
    COMP-RATIO compression ratio: DATA/TOTAL
    MOUNTPOINT where the device is mounted

    For more details see zramctl(8).

    Life is good,
    Maurice

    o- -o -o o- o- o- o- o- o- -o o- -o -o o- o- -o
    /) (\ (\ /) /) /) /) /) /) (\ /) (\ (\ /) /) (\
    ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^
    ... Ða ne sacað þe ætsamne ne beoð.
    They do not quarrel who are not together.
    --- GNU bash, version 5.3.15(1)-release (x86_64-pc-linux-gnu)
    * Origin: One of us @ (1:153/7001.53423)