]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: Make realize_queue behave FIFO
authorMichal Koutný <mkoutny@suse.com>
Fri, 1 May 2020 12:00:42 +0000 (14:00 +0200)
committerMichal Koutný <mkoutny@suse.com>
Tue, 28 Jul 2020 13:49:24 +0000 (15:49 +0200)
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

index 031b28a6846d89c3d896ef91166b5f52b3f2aca6..f146f650559c4461d9ab83693cb68cde71b5646f 100644 (file)
@@ -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;
 }