From ad2da19e1e80a9ab9d0dfae17a74f5009e4d1898 Mon Sep 17 00:00:00 2001 From: openEuler Buildteam Date: Tue, 10 Mar 2020 21:01:43 +0800 Subject: [PATCH] pid1 bump DefaultTasksMax to 80% of the kernel pid.max value --- man/systemd-system.conf.xml | 2 +- src/core/main.c | 2 +- src/core/system.conf.in | 2 +- units/user-.slice.d/10-defaults.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index c11dd46..b259631 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -389,7 +389,7 @@ Configure the default value for the per-unit TasksMax= setting. See systemd.resource-control5 for details. This setting applies to all unit types that support resource control settings, with the exception - of slice units. Defaults to 15% of the minimum of kernel.pid_max=, kernel.threads-max= + of slice units. Defaults to 80% of the minimum of kernel.pid_max=, kernel.threads-max= and root cgroup pids.max. Kernel has a default value for kernel.pid_max= and an algorithm of counting in case of more than 32 cores. For example, with the default kernel.pid_max=, DefaultTasksMax= defaults to 4915, diff --git a/src/core/main.c b/src/core/main.c index da6c50a..f4fe751 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -92,7 +92,7 @@ #include #endif -#define DEFAULT_TASKS_MAX ((TasksMax) { 15U, 100U }) /* 15% */ +#define DEFAULT_TASKS_MAX ((TasksMax) { 80U, 100U }) /* 80% */ static enum { ACTION_RUN, diff --git a/src/core/system.conf.in b/src/core/system.conf.in index e88280b..f2c75fc 100644 --- a/src/core/system.conf.in +++ b/src/core/system.conf.in @@ -54,7 +54,7 @@ #DefaultIPAccounting=no #DefaultMemoryAccounting={{ 'yes' if MEMORY_ACCOUNTING_DEFAULT else 'no' }} #DefaultTasksAccounting=yes -#DefaultTasksMax=15% +#DefaultTasksMax=80% #DefaultLimitCPU= #DefaultLimitFSIZE= #DefaultLimitDATA= diff --git a/units/user-.slice.d/10-defaults.conf b/units/user-.slice.d/10-defaults.conf index cb3651b..be8fa28 100644 --- a/units/user-.slice.d/10-defaults.conf +++ b/units/user-.slice.d/10-defaults.conf @@ -14,4 +14,4 @@ After=systemd-user-sessions.service StopWhenUnneeded=yes [Slice] -TasksMax=33% +TasksMax=80% -- 2.27.0