]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: fix DefaultTasksMax initialization
authorFranck Bui <fbui@suse.com>
Wed, 2 Oct 2019 09:58:16 +0000 (11:58 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 3 Oct 2019 09:24:27 +0000 (11:24 +0200)
Otherwise DefaultTasksMax is always set to "inifinity".

This was broken by fb39af4ce42.

src/core/main.c

index 2e95edfbd8691648dadad93677acc00d0c0eaa09..425e958fe8c4c2e9ec9e01fa3cc1ff119f1e0d7e 100644 (file)
@@ -2133,7 +2133,7 @@ static void reset_arguments(void) {
         arg_default_blockio_accounting = false;
         arg_default_memory_accounting = MEMORY_ACCOUNTING_DEFAULT;
         arg_default_tasks_accounting = true;
-        arg_default_tasks_max = UINT64_MAX;
+        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
         arg_machine_id = (sd_id128_t) {};
         arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
         arg_default_oom_policy = OOM_STOP;
@@ -2149,8 +2149,6 @@ static int parse_configuration(const struct rlimit *saved_rlimit_nofile,
         assert(saved_rlimit_nofile);
         assert(saved_rlimit_memlock);
 
-        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
-
         /* Assign configuration defaults */
         reset_arguments();