richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
4295f9
From 9ac22ee1e9d1ae32ff2d824e5a0e763a18b36d7e Mon Sep 17 00:00:00 2001
4295f9
From: rpm-build <rpm-build>
4295f9
Date: Wed, 1 Aug 2018 13:19:39 +0200
4295f9
Subject: [PATCH] pid1: bump DefaultTasksMax to 80% of the kernel pid.max value
4295f9
4295f9
This should be hopefully high enough even for the very big deployments.
4295f9
4295f9
RHEL-only
4295f9
4295f9
Resolves: #1997200
4295f9
---
4295f9
 man/systemd-system.conf.xml | 4 ++--
4295f9
 src/core/main.c             | 2 +-
4295f9
 src/core/system.conf.in     | 2 +-
4295f9
 3 files changed, 4 insertions(+), 4 deletions(-)
4295f9
4295f9
diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml
4295f9
index c11dd46143..72c8db5890 100644
4295f9
--- a/man/systemd-system.conf.xml
4295f9
+++ b/man/systemd-system.conf.xml
4295f9
@@ -389,10 +389,10 @@
4295f9
         <listitem><para>Configure the default value for the per-unit <varname>TasksMax=</varname> setting. See
4295f9
         <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
4295f9
         for details. This setting applies to all unit types that support resource control settings, with the exception
4295f9
-        of slice units. Defaults to 15% of the minimum of <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
4295f9
+        of slice units. Defaults to 80% of the minimum of <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
4295f9
         and root cgroup <varname>pids.max</varname>.
4295f9
         Kernel has a default value for <varname>kernel.pid_max=</varname> and an algorithm of counting in case of more than 32 cores.
4295f9
-        For example with the default <varname>kernel.pid_max=</varname>, <varname>DefaultTasksMax=</varname> defaults to 4915,
4295f9
+        For example with the default <varname>kernel.pid_max=</varname>, <varname>DefaultTasksMax=</varname> defaults to 26214,
4295f9
         but might be greater in other systems or smaller in OS containers.</para></listitem>
4295f9
       </varlistentry>
4295f9
 
4295f9
diff --git a/src/core/main.c b/src/core/main.c
4295f9
index da6c50a1c4..f4fe7517fd 100644
4295f9
--- a/src/core/main.c
4295f9
+++ b/src/core/main.c
4295f9
@@ -92,7 +92,7 @@
4295f9
 #include <sanitizer/lsan_interface.h>
4295f9
 #endif
4295f9
 
4295f9
-#define DEFAULT_TASKS_MAX ((TasksMax) { 15U, 100U }) /* 15% */
4295f9
+#define DEFAULT_TASKS_MAX ((TasksMax) { 80U, 100U }) /* 80% */
4295f9
 
4295f9
 static enum {
4295f9
         ACTION_RUN,
4295f9
diff --git a/src/core/system.conf.in b/src/core/system.conf.in
4295f9
index e88280bd0a..f2c75fcd32 100644
4295f9
--- a/src/core/system.conf.in
4295f9
+++ b/src/core/system.conf.in
4295f9
@@ -54,7 +54,7 @@
4295f9
 #DefaultBlockIOAccounting=no
4295f9
 #DefaultMemoryAccounting={{ 'yes' if MEMORY_ACCOUNTING_DEFAULT else 'no' }}
4295f9
 #DefaultTasksAccounting=yes
4295f9
-#DefaultTasksMax=15%
4295f9
+#DefaultTasksMax=80%
4295f9
 #DefaultLimitCPU=
4295f9
 #DefaultLimitFSIZE=
4295f9
 #DefaultLimitDATA=