代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 18561b46343c94af359d74a48c34974739b46eeb Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 13 Jan 2020 20:06:39 +0100
Subject: [PATCH] cgroup: update only siblings that got realized once
Fixes: #14475
Replaces: #14554
cherry-picked from upstream e1e98911 without conflict.
Signed-off-by: Yuanhong Peng <yummypeng@linux.alibaba.com>
---
src/core/cgroup.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index e0eb184fd2..00121e3f37 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -1964,7 +1964,15 @@ static void unit_add_siblings_to_cgroup_realize_queue(Unit *u) {
Unit *slice;
/* This adds the siblings of the specified unit and the siblings of all parent units to the cgroup
- * queue. (But neither the specified unit itself nor the parents.) */
+ * queue. (But neither the specified unit itself nor the parents.)
+ *
+ * Propagation of realization "side-ways" (i.e. towards siblings) is in relevant on cgroup-v1 where
+ * scheduling become very weird if two units that own processes reside in the same slice, but one is
+ * realized in the "cpu" hierarchy and once is not (for example because one has CPUWeight= set and
+ * the other does not), because that means processes need to be scheduled against groups. Let's avoid
+ * this asymmetry by always ensuring that units below a slice that are realized at all are hence
+ * always realized in *all* their hierarchies, and it is sufficient for a unit's sibling to be
+ * realized for a unit to be realized too. */
while ((slice = UNIT_DEREF(u->slice))) {
Iterator i;
@@ -1972,6 +1980,7 @@ static void unit_add_siblings_to_cgroup_realize_queue(Unit *u) {
void *v;
HASHMAP_FOREACH_KEY(v, m, slice->dependencies[UNIT_BEFORE], i) {
+
/* Skip units that have a dependency on the slice but aren't actually in it. */
if (UNIT_DEREF(m->slice) != slice)
continue;
@@ -1980,6 +1989,11 @@ static void unit_add_siblings_to_cgroup_realize_queue(Unit *u) {
if (UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(m)))
continue;
+ /* We only enqueue siblings if they were realized once at least, in the main
+ * hierarchy. */
+ if (!m->cgroup_realized)
+ continue;
+
/* If the unit doesn't need any new controllers and has current ones realized, it
* doesn't need any changes. */
if (unit_has_mask_realized(m,
@@ -2264,6 +2278,7 @@ void unit_add_to_cgroup_empty_queue(Unit *u) {
/* Let's verify that the cgroup is really empty */
if (!u->cgroup_path)
return;
+
r = cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, u->cgroup_path);
if (r < 0) {
log_unit_debug_errno(u, r, "Failed to determine whether cgroup %s is empty: %m", u->cgroup_path);
--
2.18.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。