<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 17, 2015 at 3:52 PM, Cristian RodrĂ­guez <span dir="ltr"><<a href="mailto:crrodriguez@opensuse.org" target="_blank">crrodriguez@opensuse.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Fri, Apr 17, 2015 at 4:06 PM, Matt Hoosier <<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>> wrote:<br>
> On Fri, Apr 17, 2015 at 12:22 PM, Lennart Poettering<br>
> <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>> wrote:<br>
>><br>
>> On Fri, 17.04.15 09:00, Matt Hoosier (<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>) wrote:<br>
>><br>
>> > Hi,<br>
>> ><br>
>> > I'm writing to see whether there's a "best" way to allow systemd to<br>
>> > inherit<br>
>> > ownership of a process forked from a hand-crafted /sbin/init process<br>
>> > before<br>
>> > that hand-crafted process turns over the keys to systemd by doing<br>
>> > exec("/lib/systemd/systemd") over the top of itself and allowing it to<br>
>> > take<br>
>> > over as PID 1.<br>
>><br>
>> We support this only really for "kernel-like" processes that are<br>
>> started from the initrd, and basically run as long as the system is up<br>
>> without every being restarted in between, thus effectively appearing<br>
>> much like a kernel process and nothing systemd should<br>
>> manage. Processes like this should be marked with argv[0][0] = '@',<br>
>> see for details:<br>
>><br>
>> <a href="https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/" target="_blank">https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/</a><br>
>><br>
>> > I know that sounds like an odd thing to ask about. The use-case has to<br>
>> > do<br>
>> > with being able to start some work extremely early during boot of<br>
>> > embedded<br>
>> > systems to achieve performance goals. I don't wish to subvert systemd,<br>
>> > and<br>
>> > in fact would love for systemd to be able to monitor the process, stop<br>
>> > it,<br>
>> > restart according to the normal [Service] configuration in a unit file<br>
>> > describing the process.<br>
>><br>
>> Hmm, are you sure that invoking the binary from systemd as first<br>
>> service is really that much slower than starting systemd only afterwards?<br>
><br>
><br>
> The bootcharting that I do seems to show that about 1.2 - 1.5 sec are spent<br>
> internal to systemd before any external processes get run for the particular<br>
> embedded CPU I'm using. That gap is a killer at the moment.<br>
<br>
</div></div>Did you watch this presentation ?<br>
<br>
<a href="https://www.youtube.com/watch?v=RFVlbaDqll8" target="_blank">https://www.youtube.com/watch?v=RFVlbaDqll8</a><br>
<br>
what part of systemd is taking 1.5 seconds to start, on what CPU and<br>
how much of RAM does the board has ?<br>
</blockquote></div><br></div><div class="gmail_extra"><span style="font-size:12.8000001907349px">Thanks, I hadn't found that presentation before. My board is essentially a Panda ES, with gigabytes of RAM.</span></div><div class="gmail_extra"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_extra"><span style="font-size:12.8000001907349px">A small point of clarification: when I say that systemd takes 1.5 seconds, I'm referring to the time that elapses between the moment that /lib/systemd/systemd is exec'ed and the time that the first unit is shown in the 'systemd-analyze plot'. I haven't done an internal profile on the systemd binary to see what might be happening during that window yet.</span><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">Could you say a word more about the sys_accept4() and <span style="color:rgb(0,0,0);white-space:pre-wrap">/sys/fs/cgroup issue? Was its only symptom that it caused systemd to run slower?</span></div><div style="font-size:12.8000001907349px"><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div style="font-size:12.8000001907349px"><span style="color:rgb(0,0,0);white-space:pre-wrap">-Matt</span></div></div></div>