diff options
author | Anita Zhang <the.anitazha@gmail.com> | 2021-03-26 03:01:38 -0700 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-03-30 14:44:09 +0200 |
commit | 37a7e15968b5dc0d2e3c2160586aeb6b4cd6c90b (patch) | |
tree | eb85353ed5076b3edfde09b048180e75cc40fa10 /src/oom/oomd-util.h | |
parent | b240c08d0970b0e90f204d54eec653f3c379fd60 (diff) | |
download | systemd-37a7e15968b5dc0d2e3c2160586aeb6b4cd6c90b.tar.gz |
oomd: make it more clear when a kill happens
Improve the logging to only print if systemd-oomd killed something. And
also print which cgroup was targeted.
Demote general swap above/pressure above messages to debug.
[zjs: fix some issuelets found in review]
Diffstat (limited to 'src/oom/oomd-util.h')
-rw-r--r-- | src/oom/oomd-util.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/oom/oomd-util.h b/src/oom/oomd-util.h index 560697a4f4..51423130d1 100644 --- a/src/oom/oomd-util.h +++ b/src/oom/oomd-util.h @@ -122,9 +122,10 @@ int oomd_cgroup_kill(const char *path, bool recurse, bool dry_run); /* The following oomd_kill_by_* functions return 1 if processes were killed, or negative otherwise. */ /* If `prefix` is supplied, only cgroups whose paths start with `prefix` are eligible candidates. Otherwise, - * everything in `h` is a candidate. */ -int oomd_kill_by_pgscan_rate(Hashmap *h, const char *prefix, bool dry_run); -int oomd_kill_by_swap_usage(Hashmap *h, bool dry_run); + * everything in `h` is a candidate. + * Returns the killed cgroup in ret_selected. */ +int oomd_kill_by_pgscan_rate(Hashmap *h, const char *prefix, bool dry_run, char **ret_selected); +int oomd_kill_by_swap_usage(Hashmap *h, bool dry_run, char **ret_selected); int oomd_cgroup_context_acquire(const char *path, OomdCGroupContext **ret); int oomd_system_context_acquire(const char *proc_swaps_path, OomdSystemContext *ret); |