summaryrefslogtreecommitdiff
path: root/src/oom/oomd-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-02-17 17:56:26 +0100
committerLennart Poettering <lennart@poettering.net>2021-02-18 22:40:47 +0100
commitd06e7fb53233bac014d1c3c9899ee291dcda1f71 (patch)
tree480cafc30a86f5374adb85dbdefab6bf0101fa39 /src/oom/oomd-util.h
parentd9d3f05def0057cc064a05f8cbfb5f398779cd8c (diff)
downloadsystemd-d06e7fb53233bac014d1c3c9899ee291dcda1f71.tar.gz
oomd: increase accuracy of SwapUsedLimit= to permyriads too
oomd.conf has two parameters with fractionals: SwapUsedLimit= and DefaultMemoryPressureLimit=, but one accepts permyriads, the other only percentages, for no apparent reason. One carries the "Percent" in the name, the other doesn't. Let's clean this up: always accept permyriads, and drop the suffix, given that it is misleading. I figure we should internally try to focus on scaling everything relative to UINT32_MAX, and if that isn't in the cards at least 10000, but never permille nor percent unless there's a really really good reason for it (e.g. interface defined by someone else).
Diffstat (limited to 'src/oom/oomd-util.h')
-rw-r--r--src/oom/oomd-util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/oom/oomd-util.h b/src/oom/oomd-util.h
index bffccf75da..181443ae7a 100644
--- a/src/oom/oomd-util.h
+++ b/src/oom/oomd-util.h
@@ -61,8 +61,8 @@ int oomd_pressure_above(Hashmap *h, usec_t duration, Set **ret);
* current sum is higher than the last interval's sum (there was some reclaim activity). */
bool oomd_memory_reclaim(Hashmap *h);
-/* Returns true if the amount of swap free is below the percentage of swap specified by `threshold_percent`. */
-bool oomd_swap_free_below(const OomdSystemContext *ctx, uint64_t threshold_percent);
+/* Returns true if the amount of swap free is below the permyriad of swap specified by `threshold_permyriad`. */
+bool oomd_swap_free_below(const OomdSystemContext *ctx, int threshold_permyriad);
/* The compare functions will sort from largest to smallest, putting all the contexts with "avoid" at the end
* (after the smallest values). */