daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
b9a53a
From e809564cfa5af01a26075682d49f81a987c41dd8 Mon Sep 17 00:00:00 2001
b9a53a
From: Franck Bui <fbui@suse.com>
b9a53a
Date: Wed, 2 Oct 2019 11:58:16 +0200
be3800
Subject: [PATCH] pid1: fix DefaultTasksMax initialization
b9a53a
b9a53a
Otherwise DefaultTasksMax is always set to "inifinity".
b9a53a
b9a53a
This was broken by fb39af4ce42.
b9a53a
b9a53a
(cherry picked from commit c0000de87d2c7934cb1f4ba66a533a85277600ff)
b9a53a
b9a53a
Resolves: #1809037
b9a53a
---
b9a53a
 src/core/main.c | 4 +---
b9a53a
 1 file changed, 1 insertion(+), 3 deletions(-)
b9a53a
b9a53a
diff --git a/src/core/main.c b/src/core/main.c
b9a53a
index d6550ea161..45d09b1e11 100644
b9a53a
--- a/src/core/main.c
b9a53a
+++ b/src/core/main.c
b9a53a
@@ -2088,7 +2088,7 @@ static void reset_arguments(void) {
b9a53a
         arg_default_blockio_accounting = false;
b9a53a
         arg_default_memory_accounting = MEMORY_ACCOUNTING_DEFAULT;
b9a53a
         arg_default_tasks_accounting = true;
b9a53a
-        arg_default_tasks_max = UINT64_MAX;
b9a53a
+        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
b9a53a
         arg_machine_id = (sd_id128_t) {};
b9a53a
         arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
b9a53a
 
b9a53a
@@ -2103,8 +2103,6 @@ static int parse_configuration(const struct rlimit *saved_rlimit_nofile,
b9a53a
         assert(saved_rlimit_nofile);
b9a53a
         assert(saved_rlimit_memlock);
b9a53a
 
b9a53a
-        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
b9a53a
-
b9a53a
         /* Assign configuration defaults */
b9a53a
         reset_arguments();
b9a53a