]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
oomd: don't collect candidate stats on every interval
authorAnita Zhang <the.anitazha@gmail.com>
Tue, 6 Jul 2021 09:46:13 +0000 (02:46 -0700)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 6 Jul 2021 23:19:53 +0000 (00:19 +0100)
cb13961ada52c1b27f6d6c2c6e37a2901f01ed30 updated the oomd logic to
collect candidate data when a kill was about to happen. However there
was still a call left over in the main loop to collect candidate data on
every interval. Remove this since it's unneeded.

Fixes #20122

src/oom/oomd-manager.c

index ca319f4b0dd94d96de57429c04ab97c189e7aece..9cae0c9c8af36a00c0da6ed9e7851de3e02dbee9 100644 (file)
@@ -424,13 +424,6 @@ static int monitor_memory_pressure_contexts_handler(sd_event_source *s, uint64_t
         if (r < 0)
                 log_debug_errno(r, "Failed to update monitored memory pressure cgroup contexts, ignoring: %m");
 
-        r = update_monitored_cgroup_contexts_candidates(
-                        m->monitored_mem_pressure_cgroup_contexts, &m->monitored_mem_pressure_cgroup_contexts_candidates);
-        if (r == -ENOMEM)
-                return log_oom();
-        if (r < 0)
-                log_debug_errno(r, "Failed to update monitored memory pressure candidate cgroup contexts, ignoring: %m");
-
         /* Since pressure counters are lagging, we need to wait a bit after a kill to ensure we don't read stale
          * values and go on a kill storm. */
         if (m->mem_pressure_post_action_delay_start > 0) {