2023-07-31 10:00:47 +08:00
|
|
|
From ad2da19e1e80a9ab9d0dfae17a74f5009e4d1898 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: openEuler Buildteam <buildteam@openeuler.org>
|
|
|
|
|
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 +-
|
2024-01-08 19:20:01 +08:00
|
|
|
src/core/manager.c | 2 +-
|
2023-07-31 10:00:47 +08:00
|
|
|
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
|
2024-01-08 19:20:01 +08:00
|
|
|
index 3c06b65..72f366e 100644
|
2023-07-31 10:00:47 +08:00
|
|
|
--- a/man/systemd-system.conf.xml
|
|
|
|
|
+++ b/man/systemd-system.conf.xml
|
2024-01-08 19:20:01 +08:00
|
|
|
@@ -501,7 +501,7 @@
|
2023-07-31 10:00:47 +08:00
|
|
|
<listitem><para>Configure the default value for the per-unit <varname>TasksMax=</varname> setting. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
|
|
|
|
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 <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
|
|
|
|
|
+ of slice units. Defaults to 80% of the minimum of <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
|
|
|
|
|
and root cgroup <varname>pids.max</varname>.
|
|
|
|
|
Kernel has a default value for <varname>kernel.pid_max=</varname> and an algorithm of counting in case of more than 32 cores.
|
|
|
|
|
For example, with the default <varname>kernel.pid_max=</varname>, <varname>DefaultTasksMax=</varname> defaults to 4915,
|
2024-01-08 19:20:01 +08:00
|
|
|
diff --git a/src/core/manager.c b/src/core/manager.c
|
|
|
|
|
index 45c8966..ce20d6b 100644
|
|
|
|
|
--- a/src/core/manager.c
|
|
|
|
|
+++ b/src/core/manager.c
|
|
|
|
|
@@ -114,7 +114,7 @@
|
|
|
|
|
/* How many units and jobs to process of the bus queue before returning to the event loop. */
|
|
|
|
|
#define MANAGER_BUS_MESSAGE_BUDGET 100U
|
2023-07-31 10:00:47 +08:00
|
|
|
|
2024-01-08 19:20:01 +08:00
|
|
|
-#define DEFAULT_TASKS_MAX ((CGroupTasksMax) { 15U, 100U }) /* 15% */
|
|
|
|
|
+#define DEFAULT_TASKS_MAX ((CGroupTasksMax) { 80U, 100U }) /* 80% */
|
2023-07-31 10:00:47 +08:00
|
|
|
|
2024-01-08 19:20:01 +08:00
|
|
|
static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata);
|
|
|
|
|
static int manager_dispatch_cgroups_agent_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata);
|
2023-07-31 10:00:47 +08:00
|
|
|
diff --git a/src/core/system.conf.in b/src/core/system.conf.in
|
2024-01-08 19:20:01 +08:00
|
|
|
index 05eb681..472d1ca 100644
|
2023-07-31 10:00:47 +08:00
|
|
|
--- a/src/core/system.conf.in
|
|
|
|
|
+++ b/src/core/system.conf.in
|
2024-01-08 19:20:01 +08:00
|
|
|
@@ -58,7 +58,7 @@
|
2023-07-31 10:00:47 +08:00
|
|
|
#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
|
2024-01-08 19:20:01 +08:00
|
|
|
index f688eac..20c39ec 100644
|
2023-07-31 10:00:47 +08:00
|
|
|
--- a/units/user-.slice.d/10-defaults.conf
|
|
|
|
|
+++ b/units/user-.slice.d/10-defaults.conf
|
2024-01-08 19:20:01 +08:00
|
|
|
@@ -13,4 +13,4 @@ Documentation=man:user@.service(5)
|
2023-07-31 10:00:47 +08:00
|
|
|
StopWhenUnneeded=yes
|
|
|
|
|
|
|
|
|
|
[Slice]
|
|
|
|
|
-TasksMax=33%
|
|
|
|
|
+TasksMax=80%
|
|
|
|
|
--
|
2024-01-08 19:20:01 +08:00
|
|
|
2.33.0
|
2023-07-31 10:00:47 +08:00
|
|
|
|