<div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 16, 2022 at 5:53 PM Lennart Poettering <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mi, 16.03.22 17:30, Felip Moll (<a href="mailto:felip@schedmd.com" target="_blank">felip@schedmd.com</a>) wrote:<br>
<br>
> AFAIK RemainAfterExit for services actually does cleanup the cgroup tree if<br>
> there are no more processes in it.<br>
<br>
It doesn't do that if delegation is on (iirc, if not I'd consider that<br>
a bug). Same logic should apply here.<br>
<br></blockquote><div><br></div><div>I will recheck that, but I am quite sure that on some tests I did the cgroup was cleaned up on a delegated service after the main pid terminated.<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> If that behavior of keeping the cgroup tree even if there are no pids is<br>
> what you agree with, then I coincide is a good idea to include this option<br>
> to scopes.<br>
<br>
Yes, that is what I was suggesting this would do.<br>
<br></blockquote><div><br></div><div>Excellent.<br></div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> Or are you saying that I can just migrate processes wildly without<br>
> informing systemd and just doing an 'echo > cgroup.procs' from one<br>
> non-delegated tree to my delegated subtree?<br>
<br>
yeah, you can do that.<br>
<br></blockquote><div><br></div><div>Ok, so I understood that incorrectly from a former paragraph you wrote in our first e-mails. you said:</div><div><br></div><div>> Migrating processes wildly between cgroups is messy, because it fucks<br>
> up accounting and is restricted permission-wise. Typically you want to<br>
> create a cgroup and populate it, and then stick to that.</div><div><br></div><div>There, I understood you were referring to "systemd" accounting, not "kernel" accounting.</div><div>This has been a big misunderstanding for this issue.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Note that (independently of systemd) you shouldn't migrate stuff to<br>
aggressively, since it fucks up kernel resource accounting. i.e. it is<br>
wise to minimize process migration in cgroups and always migrate plus<br>
shortly after exec()<br></blockquote><div><br></div><div>Yeah, that makes sense and I am aware of it.</div><div>I am migrating before any real work is done, exactly as you describe.</div><div><br></div><div><br></div><div>I will continue a bit more with this and inform you on what I see, but we seem to be close to a solution.</div><div><br></div><div>Thank you!.<br></div><div> <br></div></div></div>