Proper vfio-pci (or vfio_pci?)

Message
Author
User avatar
j2mcgreg
Global Moderator
Posts: 7301
Joined: Tue Oct 23, 2007 12:04 pm

Re: Proper vfio-pci (or vfio_pci?)

#11 Post by j2mcgreg »

In this particular case, swap space is a sort of kludge which makes the system work. But, because it's a file, you can make it's initial size on the small side, say 3 - 4 GB.
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;

In Linux, newer isn't always better. The best solution is the one that works.

UpsetMOSFET
Posts: 6
Joined: Mon Mar 04, 2024 4:17 pm

Re: Proper vfio-pci (or vfio_pci?)

#12 Post by UpsetMOSFET »

I came to talk about vfio. I still hope that issue can be resolved.

I'm going to go with the instructions for zram, as given on the MX website. Since we've talked about zram, ZFS, and a swapfile, I want to link to this reddit comment that also brings those three components in, and follows a use case very similar to mine. I imagine there will probably be a handful of people that end up here with the same mentality. sic:
quasides wrote:...
swap is NOT ment to be additional RAM.
even tough it also has it usecases to prevent systemfreeze at high memory pressure and prevent overfilling, gives oom time to cleanup etc its not its purpose.

you need swap for memory management. specially anonymouse pages cant get anywhere if theres no swap. so it absolutly make sense just for having memory management to have a large ZRAM.

this is specially true on hypervisor. main trouble here is you cant have swap on a disk. because if one swapdrive fails any process on this swap or trying write to crashes, chances are then you end up with a corrupted VM.

you should not use mdraid for swap either as there some issues with dire io and... well lets jsut say its a rabbit hole.

zfs swap also behaves badly on high memory pressure and can up in an endless loop of memory needs and use.

bottom line, in a hypervisor you need swap for memory management and reallocation, but you dont want it on any avaliable softwareraid method. you have 2 choices. zram or a dedicated hardware raid (mirror or raid 10) for a swapdrive

and while this can be really perfomant (like running 2 small optanes) it has one big catch. the entire relyablity of your node now hangs on an additional controller (asside from the main controller).

if that one fails you will probably have crashed vms, worse, if you turn on memory sharing you can potentially crash all your vms at once.

the much safer alternative: more ram, 8-16gb zram and be done with it. no extra optanes, no extra raid controller and even more performance.
no additional point of failure introduced.

now calculate what 1 raidcontroller and 2 optanes cost vs how much more ram you can have. well no problem to run a 128gb zram then isnt it :)

ofc on workstations these are no real issue.
there zfs just makes memory management more efficent and faster

only on workstations with low ram where you try to get additional ram the compression really plays a role.

the compression and more pages are just a little cherry on top that allows smaller zram sizes for large tasks, like big ass vms getting shoved around in memory

User avatar
DukeComposed
Posts: 1516
Joined: Thu Mar 16, 2023 1:57 pm

Re: Proper vfio-pci (or vfio_pci?)

#13 Post by DukeComposed »

UpsetMOSFET wrote: Wed Mar 06, 2024 5:37 pm I'm going to go with the instructions for zram
There's nothing functionally wrong with using memory to act as a backup for when you run out of memory. Just consider it a hard-coded, dedicated reservation of DRAM that can't be used by anything else. To me that seems self-defeating, especially when disk space is plentiful. I'm reminded of The Hunt for Red October, where the helicopter has an emergency fuel reserve. The pilot says "I've got a 10-minute reserve but I'm not allowed to invade that, except in time of war," followed by Alec Baldwin's response, paraphrasing, "If you turn back now there just might be a war, so if you have 10 more minutes' worth of fuel, then we stay here 10 more minutes."

I'd rather have that memory reserve available for computing, and use disk space for swap. But I'm not you, you're not me. As I said before, do what you have to do with your memory management tweaks to let you sleep at night.

Post Reply

Return to “Hardware /Configuration”