1 Star 0 Fork 2

zhoupeng01 / NutShell-systemd

forked from src-openEuler / NutShell-systemd
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
pid1-bump-DefaultTasksMax-to-80-of-the-kernel-pid.ma.patch 2.71 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
From bb46b12cbb84411e378cd45f2ac320a9ce53551c 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 +-
src/basic/cgroup-util.h | 4 ++--
src/core/system.conf.in | 2 +-
units/user-.slice.d/10-defaults.conf | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml
index e403fa5..afd51ed 100644
--- a/man/systemd-system.conf.xml
+++ b/man/systemd-system.conf.xml
@@ -360,7 +360,7 @@
<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%, which equals 4915 with the kernel's defaults on the host, but might be smaller
+ of slice units. Defaults to 80%, which equals 26214 with the kernel's defaults on the host, but might be smaller
in OS containers.</para></listitem>
</varlistentry>
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h
index a39ab45..f2f2c09 100644
--- a/src/basic/cgroup-util.h
+++ b/src/basic/cgroup-util.h
@@ -128,8 +128,8 @@ static inline bool CGROUP_BLKIO_WEIGHT_IS_OK(uint64_t x) {
}
/* Default resource limits */
-#define DEFAULT_TASKS_MAX_PERCENTAGE 15U /* 15% of PIDs, 4915 on default settings */
-#define DEFAULT_USER_TASKS_MAX_PERCENTAGE 33U /* 33% of PIDs, 10813 on default settings */
+#define DEFAULT_TASKS_MAX_PERCENTAGE 80U /* 80% of PIDs, 4915 on default settings */
+#define DEFAULT_USER_TASKS_MAX_PERCENTAGE 80U /* 80% of PIDs, 10813 on default settings */
typedef enum CGroupUnified {
CGROUP_UNIFIED_UNKNOWN = -1,
diff --git a/src/core/system.conf.in b/src/core/system.conf.in
index 8112125..9e75b14 100644
--- a/src/core/system.conf.in
+++ b/src/core/system.conf.in
@@ -51,7 +51,7 @@
#DefaultBlockIOAccounting=no
#DefaultMemoryAccounting=@MEMORY_ACCOUNTING_DEFAULT@
#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 c81a00e..3b14c35 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%
--
1.8.3.1
1
https://gitee.com/zhoupeng01/NutShell-systemd.git
git@gitee.com:zhoupeng01/NutShell-systemd.git
zhoupeng01
NutShell-systemd
NutShell-systemd
master

搜索帮助