On Fri, Sep 14, 2018 at 9:16 AM, mcatanzaro@gnome.org wrote:
Anyway, I'm becoming increasingly convinced that any amount of swap is a misfeature. In practice, when applications start using swap, it means Fedora grinds to a halt from thrashing and needs to be force powered off.
I think it's just as problematic if the system is under memory pressure without sufficient swap, the kernel invokes OOM killer. My experience with OOM killer is in the realm of "ok so why don't you just kill...oh nice there goes sshd...I'm screwed" rather than killing firefox or chrome. I haven't dug into any of the logic the OOM killer is using, or whether it's configurable. But yeah top on my list of things to kill is the web browser because it has a session restore :-) and tends to be the biggest memory pig on the system by far.
Two ways to reduce the need for drive swap: zram device backed swap as the highest priority with an optional fallback on a disk based swap; or zswap which reserves a pool in memory with automatic fallback to disk swap. I've been using zswap for some time, and it moderates the abrupt performance loss that comes with traditional disk based swap.
We've been considering switching to a swap file (like Ubuntu), but perhaps the should be no swap at all.
I'm pretty sure hibernate (suspend to disk) does not support files. So I'll be slightly curious if, with all the hibernation work Ubuntu is apparently doing, they end up going with partitions or if they've got some other trick up their sleeve, like teaching the bootloader how to find and resume hibernation from a file.
At least on Windows and macOS, the hibernation file is a separate thing from swapfiles. Maybe there's a good reason for this distinction, I'm not sure.