diff options
author | Anita Zhang <the.anitazha@gmail.com> | 2021-02-02 14:16:03 -0800 |
---|---|---|
committer | Anita Zhang <the.anitazha@gmail.com> | 2021-02-02 17:52:48 -0800 |
commit | 0a9f93443be9e04fa77317bc5e28742b433277c6 (patch) | |
tree | 9b17a938938730ac1035f57f4d4ff8e09e5db5a9 /src/oom/oomd.c | |
parent | 94a8e2d6db689b0349091829e809e751fff9b812 (diff) | |
download | systemd-0a9f93443be9e04fa77317bc5e28742b433277c6.tar.gz |
oom: rework *MemoryPressureLimit= properties to have 1/10000 precision
Requested in
https://github.com/systemd/systemd/pull/15206#discussion_r505506657,
preserve the full granularity for memory pressure limits (permyriad)
instead of capping out at percent.
Diffstat (limited to 'src/oom/oomd.c')
-rw-r--r-- | src/oom/oomd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/oom/oomd.c b/src/oom/oomd.c index 3f3ef944ee..a5b4451913 100644 --- a/src/oom/oomd.c +++ b/src/oom/oomd.c @@ -18,14 +18,14 @@ static bool arg_dry_run = false; static int arg_swap_used_limit = -1; -static int arg_mem_pressure_limit = -1; +static int arg_mem_pressure_limit_permyriad = -1; static usec_t arg_mem_pressure_usec = 0; static int parse_config(void) { static const ConfigTableItem items[] = { - { "OOM", "SwapUsedLimitPercent", config_parse_percent, 0, &arg_swap_used_limit }, - { "OOM", "DefaultMemoryPressureLimitPercent", config_parse_percent, 0, &arg_mem_pressure_limit }, - { "OOM", "DefaultMemoryPressureDurationSec", config_parse_sec, 0, &arg_mem_pressure_usec }, + { "OOM", "SwapUsedLimitPercent", config_parse_percent, 0, &arg_swap_used_limit }, + { "OOM", "DefaultMemoryPressureLimit", config_parse_permyriad, 0, &arg_mem_pressure_limit_permyriad }, + { "OOM", "DefaultMemoryPressureDurationSec", config_parse_sec, 0, &arg_mem_pressure_usec }, {} }; @@ -159,7 +159,7 @@ static int run(int argc, char *argv[]) { if (r < 0) return log_error_errno(r, "Failed to create manager: %m"); - r = manager_start(m, arg_dry_run, arg_swap_used_limit, arg_mem_pressure_limit, arg_mem_pressure_usec); + r = manager_start(m, arg_dry_run, arg_swap_used_limit, arg_mem_pressure_limit_permyriad, arg_mem_pressure_usec); if (r < 0) return log_error_errno(r, "Failed to start up daemon: %m"); |