oomd: threshold swap kill candidates to usages of more than 5%
authorAnita Zhang <the.anitazha@gmail.com>
Fri, 26 Mar 2021 09:37:01 +0000 (02:37 -0700)
committerAnita Zhang <the.anitazha@gmail.com>
Mon, 5 Apr 2021 09:04:49 +0000 (02:04 -0700)
commit685b0985f0faeb349d1449f8e9d87a9c87e1e24f
treea2c189e3665af2467eb0d14520c272e55ad033ff
parentcb13961ada52c1b27f6d6c2c6e37a2901f01ed30
oomd: threshold swap kill candidates to usages of more than 5%

In some instances, particularly with swap on zram, swap used will be high
while there is still a lot of memory available. FB OOMD handles this by
thresholding kills to X% of total swap usage. Let's do the same thing here.

Anecdotally with these thresholds and my laptop which is exclusively swap
on zram I can sit at 0K / 4G swap free with most of memory free and
systemd-oomd doesn't kill anything.

Partially addresses aggressive kill behavior from
https://bugzilla.redhat.com/show_bug.cgi?id=1941170
man/oomd.conf.xml
src/oom/oomd-manager.c
src/oom/oomd-manager.h
src/oom/oomd-util.c
src/oom/oomd-util.h