From: Anita Zhang Date: Thu, 28 Jan 2021 23:47:26 +0000 (-0800) Subject: oom: skip over cgroups with no memory usage X-Git-Tag: v248-rc1~142^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74f834e9e273947bbba4af68f8ba39a656fff282;p=thirdparty%2Fsystemd.git oom: skip over cgroups with no memory usage --- diff --git a/src/oom/oomd-util.c b/src/oom/oomd-util.c index 8f138d64c6c..fa8b8b70b19 100644 --- a/src/oom/oomd-util.c +++ b/src/oom/oomd-util.c @@ -219,7 +219,8 @@ int oomd_kill_by_pgscan(Hashmap *h, const char *prefix, bool dry_run) { return r; for (int i = 0; i < r; i++) { - if (sorted[i]->pgscan == 0) + /* Skip cgroups with no reclaim and memory usage; it won't alleviate pressure */ + if (sorted[i]->pgscan == 0 && sorted[i]->current_memory_usage == 0) break; r = oomd_cgroup_kill(sorted[i]->path, true, dry_run);