diff options
author | Anita Zhang <the.anitazha@gmail.com> | 2021-01-24 09:16:19 +0100 |
---|---|---|
committer | Anita Zhang <the.anitazha@gmail.com> | 2021-01-24 10:59:03 +0100 |
commit | c20aa7b17166b9f331da33ad9288f9ede75c72db (patch) | |
tree | 8a9063977ace04e0d13d068faa15755063e27c2e /src/oom/oomd.c | |
parent | Merge pull request #18349 from poettering/import-fixlets2 (diff) | |
download | systemd-c20aa7b17166b9f331da33ad9288f9ede75c72db.tar.xz systemd-c20aa7b17166b9f331da33ad9288f9ede75c72db.zip |
oom: make memory pressure duration configurable through oomd.conf
Diffstat (limited to 'src/oom/oomd.c')
-rw-r--r-- | src/oom/oomd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/oom/oomd.c b/src/oom/oomd.c index 8cf776ec0f..1b0f8ff6c4 100644 --- a/src/oom/oomd.c +++ b/src/oom/oomd.c @@ -19,11 +19,13 @@ static bool arg_dry_run = false; static int arg_swap_used_limit = -1; static int arg_mem_pressure_limit = -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 }, {} }; @@ -160,7 +162,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); + r = manager_start(m, arg_dry_run, arg_swap_used_limit, arg_mem_pressure_limit, arg_mem_pressure_usec); if (r < 0) return log_error_errno(r, "Failed to start up daemon: %m"); |