From a479c21ed2fda095a2e2f4b52de75487c76d332c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Fri, 1 May 2020 14:00:42 +0200 Subject: [PATCH] cgroup: Make realize_queue behave FIFO The current implementation is LIFO, which is a) confusing b) prevents some ordered operations on the cgroup tree (e.g. removing children before parents). Fix it quickly. Current list implementation turns this from O(1) to O(n) operation. Rework the lists later. --- src/core/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 031b28a684..f146f65055 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -2112,7 +2112,7 @@ void unit_add_to_cgroup_realize_queue(Unit *u) { if (u->in_cgroup_realize_queue) return; - LIST_PREPEND(cgroup_realize_queue, u->manager->cgroup_realize_queue, u); + LIST_APPEND(cgroup_realize_queue, u->manager->cgroup_realize_queue, u); u->in_cgroup_realize_queue = true; }