unperson [he/him]

  • 0 Posts
  • 68 Comments
Joined 4 years ago
cake
Cake day: July 28th, 2020

help-circle

  • am i right that you can create zswap block devices and mount them like with zram? (eg. mounting /var/tmp)

    zswap is a “front swap”, it needs a backing swap to function that’s crucial to the design. It automtically goes in front of all the swaps you have enabled.

    You could probably put the backing swap on a loop device on a tmpfs, but I don’t know how it will handle the loopback. It’s a better idea to put it on disk. It can be a slow or write-limited disk, it will not get used much. You definitely should not use zram and zswap at the same time.


  • nerd excuse me the embargo has an exception for food and medicine

    It’s really easy you see, you just need to pass an inspection and get a written permission from the President of the US, the payment must be made in cash in US dollars before shipment and through some non-American bank, and the shipping company must go straight from a US port to a Cuban port and back with no layovers.

    This is not a joke, it’s what is actually written in the law.


  • Yes, more or less, they are closely related:

    In regular swap, when you’re low on memory the kernel chooses some memory pages (low priority processes and least recently used) and writes them on disk on a file or partition. When the process that owns those pages need them back, the kernel goes fetch them one at a time. Since memory pages are 4KiB the speed on this depends on the 4k random access speed of your disk.

    You can have more than one swap, and the order they are used depends on their priority, or on the order they were enabled in if you didn’t specify any priority.

    zram is a kind of swap space that, instead of writing to disk, compresses the pages and writes them back in RAM. You set an uncompressed size for it and if the pages don’t compress well (usually encrypted on already-compressed data) then it will occupy the same amount of RAM. Since you can’t tell in advance what the compressed size will be and there’s no mechanism to stop it from filling up, you must be conservative on the size of zram. When the zram gets full all new pages will go to the next swap in priority order. This causes a problem where there’s old data you don’t care about taking RAM space in zram that cannot be reclaimed, and then your workload is going to regular swap which is slow.

    zswap is a layer on top of swap, the technical name is “frontswap”. For it to work you need to already have a swap configured. Before memory pages are written down on the swap file, they are compressed, and if the compression ratio is good enough the pages go to RAM instead of to the swap file. You set a compressed size for the zswap (by default, 20% of your total RAM) and when this limit gets full the least recently used pages are written to disk. The compression is so fast that you barely notice a hiccup while it’s happening, it feels like you magically have 50% more RAM than before.

    Answering your question, zswap is configured by kernel parameters, and now that you mention it it might work to put the parameters on the kernel cmdline instead of editing sysfs, this means configuring the boot loader and adding zswap.enabled=1 zswap.compressor=lz4 zswap.zpool=z3fold to the kernel cmdline.




  • Try this if you have low RAM, I lived with it for months when I had a broken DIMM and had to make do with 4 GB. The difference is incredible.

    /etc/tmpfiles.d/zswap.conf

    #Type Path                              Mode UID GID Age Argument
    w /sys/module/zswap/parameters/zpool	- - - -	z3fold
    w /sys/module/zswap/parameters/compressor	- - - - lz4
    w /sys/module/zswap/parameters/enabled	- - - - 1
    

    /etc/sysctl.d/00-swappiness.conf

    vm.swappiness = 100
    

    Depending on your workload you may increase swappiness to 200 with good results.

    You need to set up some 8 GB of swap, it’s mostly for accounting purposes and will barely get used so it can be anywhere. If you already have zram, disable zram, it’s counter productive. Use the swapon command with no arguments to check if you have zram.





  • I’ve got a hang-over pet policy from when I was a baby leftist to abolish rents on land, but with a twist: Any exchange of money for the use of a property is a sale. It’s absolutely financial neoLIB bullshit but I can’t take it off my mind.

    The idea being that if, over time, you pay the landlord for maintenance + the value of the house, you get the title for the house, and this is the law and you can go to court, prove that you’ve paid for rent over however many years, and get the title of the house.

    If you leave before that there’d be some system where the “rent” payments are split equally and you get the value back from whoever is currently living there, because you’re selling your share to them. Since the payments are split equally minority “shareholders” leave first. If nobody lives there but you’re paying taxes and maintenance, you still paying for the house so you accrue shares of the house.

    I think it might be palatable for neolibs, destroy the value of homes for rent-seeking, but preserve it for construction, which is what libs always complain about when you talk about abolishing rent.









  • Since the federation update, when I pick an emoji with the picker I get markdown to a URL that doesn’t contain the shortcode.

    For example dean-neutral inserts:

    ![dean-neutral](https://www.hexbear.net/pictrs/image/48c31f9a-8487-48f0-afce-9db1db5fb5d6.png "emoji dean-neutral") 
    

    Notice that the url to the png: https://www.hexbear.net/pictrs/image/48c31f9a-8487-48f0-afce-9db1db5fb5d6.png doesn’t contain the shortcode.

    So right now the database has posts mixed between what I’ll call the “old format” :shortcode: and the “new format” with the URL. The new format shows up in other instances and the old format doesn’t.

    Shouldn’t it be possible to run a migration in the database, and switch the old format with the new for all posts? Then disable this on-the-fly shortcode substitution that the frontend is doing.

    From then on we will have to use the picker, but the emoji can change name without braking old posts. And eventually the frontend conversion can be added to the backend to restore the old behaviour.

    This would simultaneously solve the issue where emojis don’t show up in other instances some times.