]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/oom/oomd-util.c
oomd: rework memory reclaim detection logic
authorAnita Zhang <the.anitazha@gmail.com>
Fri, 26 Mar 2021 07:39:25 +0000 (00:39 -0700)
committerAnita Zhang <the.anitazha@gmail.com>
Fri, 2 Apr 2021 02:51:54 +0000 (19:51 -0700)
commitdf637ede7b4e1d0faf8d620d626a0af230712a9e
tree098675a299dec041834738509040f2454210c4f3
parent37d8020ccc2f54260b581af416e02294c7591cfc
oomd: rework memory reclaim detection logic

systemd-oomd only monitors and kills within a selected cgroup subtree
For memory pressure kills, this means it's unnecessary to get the
pgscan rate across all the monitored memory pressure cgroups.
The increase will show up whether we do a total sum or not, but since
we only care about the increase in the subtree we're about to target
for a kill, we can simplify the code a bit by not doing this total sum.
src/oom/oomd-manager.c
src/oom/oomd-manager.h
src/oom/oomd-util.c
src/oom/oomd-util.h
src/oom/test-oomd-util.c