On Thu, Sep 20, 2018 at 12:04:14PM -0700, Dulaney wrote:
On Sult 20, 2018 aig 10:59:44m -0600, sgrìobh Chris Murphy:
On Thu, Sep 20, 2018 at 10:34 AM, mcatanzaro@gnome.org wrote:
I've seen suggestions to use 0 as well.
I would try 1. I'm pretty sure 0 will just disable swap which doesn't really help us figure out if it's just the swappiness setting being too aggressive.
Yeah, 0 essentially disables swap. Go with 1.
vm.swapiness doesn't really solve the problem of "we need large swap so hibernation always works, but we don't want to use that swap for actual swapping because that'd be slow as hell". I think we need a new kernel setting "how much swap to use for swap", and then we could set that to 1 GB or 20% of RAM. Essentially the idea is to force oom even if there's free swap. ... After spelling this out, I think this setting might already exist: memory.swap.max in cgroups v2. IIRC, it is not available on v1, which is still the default in Fedora (*). Also, it doesn't exist for the root slice, but only for non-root slices. But setting it for system.slice, machine.slice, and user.slice each might get us a long way. I think setting swap.max to some reasonable value by default (e.g. using a systemd generator that look at the overall system characteristics) might be an interesting solution to the swap problems described so vividly in this thread.
Zbyszek
(*) Or the least the memory controller is too heavy to enable by default?