>It is also unclear that it can prevent full OOM (both 
>RAM and swap completely full) in all cases

Kernel's killer is also cannot prevent full OOM in all cases. earlyoom prevent 
full OOM (and situations close to OOM) much more effective - faster (selects 
victim in 5-50ms, monitoring interval is 0.1-1s) and softer (sends SIGTERM 
first).

>fail 
>to kill processes when it would be necessary to prevent swap thrashing 

OK, earlyoom does not prevent thrashing, but kernel also does not prevent it.
Thrashing may be reduced with killers that supports response to PSI: oomd [1], 
nohang [2], psi-monitor [3] (psi-monitor is used by default in Endless OS).

>I strongly believe that this kernel problem can only be solved within the 
>kernel, by a synchronous (hence race-free) hook on all allocations.

It's already solved in the kernel: just set `vm.overcommit_memory=2` and 
`vm.overcommit_ratio=50`:
"When this flag is 2, the kernel uses a "never overcommit" policy that attempts 
to prevent any overcommit of memory." [4]

1. https://github.com/facebookincubator/oomd
2. https://github.com/hakavlad/nohang
3. https://github.com/endlessm/eos-boot-helper/tree/master/psi-monitor
4. https://www.kernel.org/doc/Documentation/sysctl/vm.txt
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to