From: Michal Koutný Date: Fri, 1 May 2020 12:00:42 +0000 (+0200) Subject: cgroup: Make realize_queue behave FIFO X-Git-Tag: v247-rc1~366^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a479c21ed2fda095a2e2f4b52de75487c76d332c;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 031b28a6846..f146f650559 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; }