Giter Club home page Giter Club logo

Comments (5)

StuartIanNaylor avatar StuartIanNaylor commented on June 16, 2024

As in tmpfs ?

Or a ramdisk?

tmpfs is sort of cool as its seems complete and will push idle pages to swap.
zram would if the writeback cache option wasn't disabled for some reason in raspbian the pi alarm arch linux for arm it works but even then it is only partition based and would seem it was supposed to offer more but stopped there.
Then again its idle control is manual so could be quite useful for mounted drives with a writeback cache as you mark all as idle and if accessed the idle mark is lost.
At stages you can push out to swap all still marked as idle.

Never tried it but that could be pretty cool in creating a zdrive where often files become old and static and just take space but still there in the file system namespace without visible change or location difference..

As a swap backed compressed ram zram is not as good as zswap but zswap is not enabled for the pi even though it is better.
Prob might make an appearance in buster with a bit of luck, but its only better as its push to swap actually has an age algorithm.
To be honest not many actually understand zram & zswap as the ubuntu package is an obvious example of that, zswap really is understood as really you set size and enable.
With zswap many say it should not be more than a 3rd of the memory my advise is to ignore what anyone says especially from ubuntu or mainline distro's ignore all and play with it yourself.
If it was anything to do with ubuntu we would all believe that it is still single stream and you need a zram device or zswap for each core which actually multi-stream was implemented in 3.15.
If it does turn up in buster the first thing I will try with zswap is to use half of memory with total mem 1.5x disk space with page-cache set to zero and a swappiness of 80 or higher.
I will be told no but from experience testing and finding out yourself is better to listening to what is likely a series of Chinese whispers.

ramdisk doesn't have tmpfs push idle to swap and unless you are using ntfs and file compression its uncompressed.
Zram really should be compressed tmpfs but seems development stopped at a dedicated swap partition whilst really it should interface to the kernel 'frontspace'? 'frontswap'? my memory and terminology but the kernel namespace for the system swap interface.

from zram-config.

seamusdemora avatar seamusdemora commented on June 16, 2024

Yes - tmpfs vs ramdisk, good question! I was researching ramdisk (what is it used for?), and the thread I linked to above showed up in my search result. At the time I read it, I was not clear on the difference between ramdisk and tmpfs. And so I assumed the thread was about ramdisk, and didn't read closely enough to realize my incorrect assumption. Bottom line: sorry for the confusion.

But just so I'm clear: Is it true that zram and therefore zram-config are not applicable to ramdisk?

from zram-config.

StuartIanNaylor avatar StuartIanNaylor commented on June 16, 2024

Not sure at all why you are interested in ramfs as the newer tmpfs is likely a better alternative.
Zram is basically ramfs with compression but yeah ramdisk will not be included in zram-config as can not see the point but I have been thinking of including tmpfs as it has all the functions of ramfs but also the frontspace / frontswap system swap interface that still I can not remember its exact name.

zram_conf and all the other zram examples are exactly that main thing was to show zram is multistream and that zram services should be able to co-exist.
You are welcome to hack, clone and copy any of it.
If you want ramf just change the mount options and mkfs options in the script

from zram-config.

seamusdemora avatar seamusdemora commented on June 16, 2024

I got interested in RAM disks (which is not exactly the same as ramfs) because I discovered that RAM disks are allocated in the Raspbian kernel, and no one seems to know why - or what these RAM disks are used for.

I discovered they were there when I ran fdisk -l. I saw 16 RAM disks allocated:

Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
...

for ram0 - ram15. Since then, I've read that several Linux distros allocate RAM disks, but not all of the kernels list RAM disks in /proc/partitions (which is apparently why they show up in the fdisk -l output. Some have said listing them is erroneous kernel behavior.

Allocating RAM disks would make sense (to me at least) if they were used to reduce write activity to the SD card. But that explanation is largely absent as their raison d'Γͺtre - at least as far as I've read so far.

And as far as ramfs vs tmpfs, I don't know enough yet to have an informed opinion regarding which is "best". That's actually why I'm researching this :) It's fascinating really - a bit like watching the inside of an anthill... all the ants working hard, but not really understanding the purpose of all of it. But I digress :)

from zram-config.

StuartIanNaylor avatar StuartIanNaylor commented on June 16, 2024

If you want a really unknowable account in /boot an image of the kernel+modules is created, initramfs and various other names depending on distro.
Arch linux is always a great reference https://wiki.archlinux.org/index.php/Mkinitcpio

from zram-config.

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.