summaryrefslogtreecommitdiff
path: root/src/oom
diff options
context:
space:
mode:
authorNick Rosbrook <nick.rosbrook@canonical.com>2022-11-29 15:49:05 -0500
committerNick Rosbrook <nick.rosbrook@canonical.com>2022-11-29 16:01:58 -0500
commit3c0562778b98014cc65579b1ed27d3e137f3ed04 (patch)
treed4c0820ddb49e24905d19fd3736fd9027c35ce09 /src/oom
parent3b44e33ff4fb2896244ff5b461b29b4ef7c10803 (diff)
downloadsystemd-3c0562778b98014cc65579b1ed27d3e137f3ed04.tar.gz
oomd: fix doc comment for oomd_fetch_cgroup_oom_preference
Explicitly state that ManagedOOMPreference is always honored when the unit's cgroup is owned by root.
Diffstat (limited to 'src/oom')
-rw-r--r--src/oom/oomd-util.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/oom/oomd-util.h b/src/oom/oomd-util.h
index 7fd9e92109..a758d5589b 100644
--- a/src/oom/oomd-util.h
+++ b/src/oom/oomd-util.h
@@ -109,9 +109,10 @@ static inline int compare_swap_usage(OomdCGroupContext * const *c1, OomdCGroupCo
* Returns the number of sorted items; negative on error. */
int oomd_sort_cgroup_contexts(Hashmap *h, oomd_compare_t compare_func, const char *prefix, OomdCGroupContext ***ret);
-/* If the cgroups represented by `ctx` and `prefix` are owned by the same user,
- * then set `ctx->preference` using the `user.oomd_avoid` and `user.oomd_omit`
- * xattrs. Otherwise, set `ctx->preference` to MANAGED_OOM_PREFERENCE_NONE.
+/* If the the cgroup is owned by root, or the cgroups represented by `ctx` and
+ * `prefix` are owned by the same user, then set `ctx->preference` using the
+ * `user.oomd_avoid` and `user.oomd_omit` xattrs. Otherwise, set
+ * `ctx->preference` to MANAGED_OOM_PREFERENCE_NONE.
*
* If `prefix` is NULL or the empty string, it is treated as root. If `prefix`
* does not specify an ancestor cgroup of `ctx`, -EINVAL is returned. Returns