On Do, 07.05.20 08:49, Ulrich Windl (Ulrich.Windl@xxxxxxxxxxxxxxxxxxxx) wrote: > >>> Lennart Poettering <lennart@xxxxxxxxxxxxxx> schrieb am 06.05.2020 um 17:16 > in > Nachricht > <19374_1588778203_5EB2D4DB_19374_121_1_20200506151636.GL89018@gardel-login>: > > On Mo, 04.05.20 11:52, nitish nagesh (nagesh.nitish@xxxxxxxxx) wrote: > > > >> Hello, > >> > >> We have this odd want to move a daemon between different systemd > slices. > >> Not sure if that's even a valid thing to do, but here is the > >> requirement. > > > > The Linux kernel gets a bit confused with accounting if you migrate > > running processes between cgroups. One usually shouldn't do that > > except when forking off/execing new stuff. > > IMHO Linux should either handle the case correctly, or forbid it. Well, until recently there wasn't even a clone-into-cgroup API in the Linux kernel. Which meant you first had to fork off your process and then afterwards migrate it to the destination cgroup, i.e. it first had to be forked off and then migrated because there was no other API. This has been fixed now however, and we can clone directly into a cgroup, so that the process never exists elsewhere. we are not using that in systemd yet, but with that they could in theory forbid migration entirely and have accounting "atomic", i.e. that a process exists in a specific cgroup or in another for its entirely lifetime, but never migrates. Lennart -- Lennart Poettering, Berlin _______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel